You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Michael Mitiaguin <mi...@gmail.com> on 2007/05/24 06:03:20 UTC

WITH_POSITIONS_OFFSETS versus WITH_OFFSETS

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


Re: WITH_POSITIONS_OFFSETS versus WITH_OFFSETS

Posted by Grant Ingersoll <gs...@apache.org>.
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