lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From VIGNESH S <vigneshkln...@gmail.com>
Subject Re: MultiFields.getReader() returns null
Date Wed, 17 Jul 2013 13:03:27 GMT
Hi Mike,

I am Using a Custom Analyzer.

Fields fields = MultiFields.getFields(reader);

Terms trm = fields.terms(CONTENT_FIELD);  ---> Came null when i used
TextField

others when i use  fields.terms(),it came proper.


On Wed, Jul 17, 2013 at 6:00 PM, Michael McCandless <
lucene@mikemccandless.com> wrote:

> 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
>
>


-- 
Thanks and Regards
Vignesh Srinivasan
9739135640

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message