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 Siddharth Vijayakrishnan <sv...@gmail.com> on 2005/01/19 07:50:49 UTC

TermPositionVector

Hi,

I am adding a field to a document in the index as follows

doc.add(new     Field("contents",reader,Field.TermVector.WITH_POSITIONS))

Later,I query the index and get the document id of this document. The
following code, however, prints "false".

 TermFreqVector tfv = reader.getTermFreqVector(docId,"contents");
 System.out.println("Is a TermPositionVector  " + (tfv instanceof
TermPositionVector));

Using Field.TermVector.WITH_POSITIONS_OFFSETS, while creating the
field, also produces the same result.

Can someone tell me why this is happening ? 


Thanks,
Siddharth

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: TermPositionVector

Posted by Bernhard Messer <be...@intrafind.de>.
Siddarth,

i tested your code and the return is "true" and not "false" as you 
wrote. I assume that there is somethinf else which is wrong.

Bernhard

Siddharth Vijayakrishnan schrieb:

>Hi,
>
>I am adding a field to a document in the index as follows
>
>doc.add(new     Field("contents",reader,Field.TermVector.WITH_POSITIONS))
>
>Later,I query the index and get the document id of this document. The
>following code, however, prints "false".
>
> TermFreqVector tfv = reader.getTermFreqVector(docId,"contents");
> System.out.println("Is a TermPositionVector  " + (tfv instanceof
>TermPositionVector));
>
>Using Field.TermVector.WITH_POSITIONS_OFFSETS, while creating the
>field, also produces the same result.
>
>Can someone tell me why this is happening ? 
>
>
>Thanks,
>Siddharth
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org