You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Sachin Kulkarni <ku...@hawk.iit.edu> on 2014/08/04 15:43:11 UTC

How does Lucene decide which fields to index?

Hi,

I am using lucene 4.6.0 to index a dataset.
I have the following fields:
doctitle, docbody, docname, docid, date.
But when I access the fields using indexReader.getTermVectors(indexedDocID)
then I only get two fields
docbody and docname.

How do I index so that I also get doctitle?

Thank you.

Regards,
Sachin Kulkarni

Re: How does Lucene decide which fields to index?

Posted by Ian Lea <ia...@gmail.com>.
You tell it what you want.  See the javadocs for
org.apache.lucene.document.Field and friends such as TextField.


--
Ian.


On Mon, Aug 4, 2014 at 2:43 PM, Sachin Kulkarni <ku...@hawk.iit.edu> wrote:
> Hi,
>
> I am using lucene 4.6.0 to index a dataset.
> I have the following fields:
> doctitle, docbody, docname, docid, date.
> But when I access the fields using indexReader.getTermVectors(indexedDocID)
> then I only get two fields
> docbody and docname.
>
> How do I index so that I also get doctitle?
>
> Thank you.
>
> Regards,
> Sachin Kulkarni

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: How does Lucene decide which fields to index?

Posted by Sachin Kulkarni <ku...@hawk.iit.edu>.
Thank you Ian and Kumaran.

I checked that when I am reading back from the IndexReader,  the fields are
getting stored but not indexed.

Since I am using Lucene's Benchmark utility to index the data, I have to
trace the code to see how it is using the in-built TREC parser to index
data.
But somewhere I am missing the important link in the process.

>From what I see, field.store is specified on all the fields, but
field.index is not specified explicitly.

Thank you again, I will keep looking into the code.

Regards,
Sachin




On Mon, Aug 4, 2014 at 10:26 AM, Kumaran R <ku...@gmail.com> wrote:

> You should know two things to get this.
> 1.Indexed fields can be searched.
> 2.Stored fields can be fetched.
>
> Check your code whether you are storing all fields.
>
>
> --
> Kumaran R
> Sent from Phone
>
> > On 04-Aug-2014, at 7:13 pm, Sachin Kulkarni <ku...@hawk.iit.edu>
> wrote:
> >
> > Hi,
> >
> > I am using lucene 4.6.0 to index a dataset.
> > I have the following fields:
> > doctitle, docbody, docname, docid, date.
> > But when I access the fields using
> indexReader.getTermVectors(indexedDocID)
> > then I only get two fields
> > docbody and docname.
> >
> > How do I index so that I also get doctitle?
> >
> > Thank you.
> >
> > Regards,
> > Sachin Kulkarni
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: How does Lucene decide which fields to index?

Posted by Kumaran R <ku...@gmail.com>.
You should know two things to get this.
1.Indexed fields can be searched.
2.Stored fields can be fetched.

Check your code whether you are storing all fields.


--
Kumaran R
Sent from Phone

> On 04-Aug-2014, at 7:13 pm, Sachin Kulkarni <ku...@hawk.iit.edu> wrote:
>
> Hi,
>
> I am using lucene 4.6.0 to index a dataset.
> I have the following fields:
> doctitle, docbody, docname, docid, date.
> But when I access the fields using indexReader.getTermVectors(indexedDocID)
> then I only get two fields
> docbody and docname.
>
> How do I index so that I also get doctitle?
>
> Thank you.
>
> Regards,
> Sachin Kulkarni

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org