Yes, positions for a given term are monotonically increasing.

Note that this is an old API; it's been replaced with the "normal"
postings API in 4.x.

Mike McCandless

http://blog.mikemccandless.com


On Mon, Feb 3, 2014 at 6:53 AM, andi rexha <a_re...@hotmail.com> wrote:
> Hi,
> I am extracting term vectors position in Lucene 3.6. First I extract the term 
> vector and get the indexes from the "indexOf" method as suggested for 
> extracting the position.
>
> TermPositionVector termFreqVector = (TermPositionVector) 
> reader.getTermFreqVector(i, termField);
> String[] terms = termFreqVector.getTerms();
> int[] indexesOf = termFreqVector.indexesOf(terms, 0, terms.length);
>
> Is the indexOf the same as the terms index?
>
> My main question anyway is weather I can assume that the position returned 
> from the position is ordered :
>
>
>                     int[] termPositions = 
> termFreqVector.getTermPositions(indexesOf[j]);
>
>
> so can I assume that  termPositions[i] > termPositions[j] for i > j   ??
>
>
> Thank you!
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to