lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Hermann <herm...@informatik.uni-freiburg.de>
Subject Re: Copying Payload from one Token to the next
Date Sun, 17 Oct 2010 18:02:58 GMT
Am Sonntag, 17. Oktober 2010, 19:35:33 schrieb Ahmet Arslan:

Hello,

> > how can i copy the Payload from the current token to the
> > following token in a
> > TokenFilter?

> org.apache.solr.analysis.BufferedTokenStream.java (that can peek n tokens
> ahead in the buffered input stream, without modifying the stream) and
> CommonGramsFilter.java may help.

Thanks for the hint i'll have a look if that allows me to improve my solution.

Anyway i found out what my problem was: For every Field() a "fresh" Analyzer 
is used (makes sense, since it allows to use a different Analyzer for every 
field). So that was the reason i could not transfer the Payload using a member 
variable in the Tokenfilter.

My current solution is to concatenate the Field() contents before adding a 
Field() to the document. This way i can pass the payload from one token to the 
next. That also solved my problem with scorePayload earlier, since now every 
token has its payload.

regards
Christoph Hermann

-- 
Christoph Hermann
Institut für Informatik
Tel: +49 761-203-8171 Fax: +49 761-203-8162
e-mail: hermann@informatik.uni-freiburg.de

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