lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Does Index have a Tokenizer Built into it
Date Wed, 18 Jul 2007 05:07:18 GMT

: After indexing I have been able to retrieve the TermPositionVector from the
: index and it has all of the data, but I cannot find a way where given a
: position I can retrieve the term at that position. Which is how I was hoping
: to create my contextual snippets.

there is no easy way to go from a position to a term -- coincidently there
is a very recent thread on this on java-dev...
http://www.nabble.com/Best-Practices-for-getting-Strings-from-a-position-range-tf4084187.html

...a new API may come out of it, but in the mean time you may be
interested in taking the approach the current highlighter uses (as
mentioned in that thread), of using the TermPositionVector to rebuild the
orriginal tokenstream, then skipping ahead to the positions you are
interested in.



-Hoss


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