lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: MultiFields.getReader() returns null
Date Wed, 17 Jul 2013 12:30:39 GMT
On Wed, Jul 17, 2013 at 1:52 AM, VIGNESH S <vigneshklncit@gmail.com> wrote:
> Hi Mike,
>
> The Problem I mentioned is I used 3 Fields subject title, Content.
>
> I indexed Subject and Title like this..
>
> doc.add(new StringField(subject, mAccountId, Field.Store.YES));
>
> doc.add(new StringField(title, mSearchParam, Field.Store.YES));
>
> I indexed Content like this[as a TextField]
>
> FieldType offsetsType = new FieldType(TextField.TYPE_STORED);
>
> offsetsType.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS);
> Document doc = new Document();
>  Field body = new Field(ContentIndex.KEY_TEXTCONTENT, "", offsetsType);
>  body.setStringValue(content);
>
> When I use Fields fields = MultiFields.getFields(mReader),I found only two
> fields coming subject and Title not the Content Field.

Then something is definitely wrong: indexing as TextField should
tokenize the string and make it into the index.

What analyzer are you using?

And when you say "I found only two fields coming subject and Title not
the Content Field", how are you getting those fields from the Fields
instance?

Can you make an isolated example showing the problem?

Mike McCandless

http://blog.mikemccandless.com

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


Mime
View raw message