lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <iori...@yahoo.com>
Subject Re: Copying Payload from one Token to the next
Date Sun, 17 Oct 2010 17:35:33 GMT
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.

--- On Sat, 10/16/10, Christoph Hermann <hermann@informatik.uni-freiburg.de> wrote:

> From: Christoph Hermann <hermann@informatik.uni-freiburg.de>
> Subject: Copying Payload from one Token to the next
> To: java-user@lucene.apache.org
> Date: Saturday, October 16, 2010, 9:31 PM
> Hello,
> 
> how can i copy the Payload from the current token to the
> following token in a 
> TokenFilter?
> 
> I have implemented a TokenFilter and thought, that i could
> use 
> input.incrementToken() to advance the stream to the next
> token and just copy 
> the Payload to this next token.
> But the problem with this approach is, that the token
> automatically gets 
> consumed, so on the next run i only get the third token
> (and so on).
> 
> What would be the best way to copy a payload from the
> current token to the 
> following ones?
> 
> regards
> Christoph Hermann
> 
> PS: Thanks Uwe for the hint regarding scorePayload. That
> helped me to identify 
> the problem above (the payload was not copied to all
> elements).
> 
> -- 
> 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
> 
> 


      

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