field.fieldsData is used for the stored field contents and so only *stored* in index, of course not analyzed (why should I analyze a stored field). The indexed tokens go of course through your analyzer and the returned tokens are indexed as terms. Where is the problem?
----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: Bernd Fehling [mailto:bernd.fehl...@uni-bielefeld.de] > Sent: Thursday, November 25, 2010 2:08 PM > To: java-user@lucene.apache.org > Subject: not indexing analyzed field > > I used KeywordAnalyzer and KeywordTokenizer as templates for a new > analyzer. > The analyzer works fine but the result never reaches the index. > > My analyzer is called in "DocInverterPerField.processFields" > with "stream.incrementToken()". > ... > try { > boolean hasMoreTokens = stream.incrementToken(); > > fieldState.attributeSource = stream; > > OffsetAttribute offsetAttribute = > fieldState.attributeSource.addAttribute(OffsetAttribute.class); > PositionIncrementAttribute posIncrAttribute = > fieldState.attributeSource.addAttribute(PositionIncrementAttribute.class); > > consumer.start(field); > ... > > The result goes to "fieldState.attributeSource" but is not in "field". > So "field.fieldsData" still has the old content before calling my analyzer. And > when calling "consumer.start(field)" the old content is going to the index and > not the new analyzed one. > Does the analyzer has to care about "Fieldable field.fieldsData" > or who is responsible for it? > > Regards > Bernd > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org