lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: Analyzer is not called upon executing addDocument()
Date Tue, 09 Jan 2018 16:46:45 GMT
Hi,

StringField is not analyzed. You need to use TextField. StringField is indexed as is as a
single unmodified token in index (e.g., to be used for identifiers or facets).

Uwe

-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Armins Stepanjans [mailto:armins.bagrats@gmail.com]
> Sent: Tuesday, January 9, 2018 2:52 PM
> To: java-user@lucene.apache.org
> Subject: Analyzer is not called upon executing addDocument()
> 
> Hi,
> 
> When I create a document with multiple StringFields and add it to
> IndexWriter using addDocument(Document), the StringFields within the
> Document are not tokenized nor filtered according to Analyzer's
> specifications, however when I test my Analyzer, while looping through
> tokens by explicitly calling incrementToken() on OfsetAttribute, created
> using Analyzer's TokenStream (as per instructions in Lucene docs (under
> "Invoking The Analyzer") :
> http://lucene.apache.org/core/7_1_0/core/org/apache/lucene/analysis/pac
> kage-summary.html),
> I obtain the expected results.
> 
> Please let me know if any parts of my code would be helpful to include for
> clarification.
> Could anyone tell me what seems like the critical point here?
> 
> Regards,
> Armīns


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