lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
Subject Re: WITH_POSITIONS_OFFSETS versus WITH_OFFSETS
Date Thu, 24 May 2007 11:05:48 GMT
WITH_OFFSETS gives the equivalent of Token.startOffset and  
Token.endOffset information which is the actual offset in the String  
(although it can be manipulated), while WITH_POSITIONS gives the  
position information (which can also be manipulated).  Position info  
tells where the token occurs relative to the other tokens, i.e. what  
order they occur in.

Using WITH_POSITIONS is in line with getTermPositions().

The practical use of using WITH_P_O is when you need both positions  
and offsets, I guess.  Maybe in highlighting or some advanced  
analysis cases.

HTH
-Grant

On May 24, 2007, at 12:03 AM, Michael Mitiaguin wrote:

> What practical of using  WITH_POSITIONS_OFFSETS ? Aren't  WITH_OFFSETS
> sufficient and if iterate getStartOffset effectively gives the value
> from array element of  getTermPositions ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

--------------------------
Grant Ingersoll
Center for Natural Language Processing
http://www.cnlp.org/tech/lucene.asp

Read the Lucene Java FAQ at http://wiki.apache.org/jakarta-lucene/ 
LuceneFAQ



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