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: regaridng Reader.terms()
Date Tue, 22 May 2007 13:25:16 GMT
You have to turn on term vectors when indexing.  Take a look at the  
Field constructor that passes in TermVector.

-Grant

On May 22, 2007, at 8:09 AM, Mohammad Norouzi wrote:

>> I would use a term vector to get this.  See
>> IndexReader.getTermFreqVector.  You can get the term vector for just
>> field 3.
>
>
> Grant, thanks, in my case, getTermFreqVector returns null, I dont  
> know why
> it accepts a docnumber as parameter, what is it? is that the same  
> doc id?
> if yes it restrict the result for just one document, am I right?
>
>
>> Let's suppose you modify your WhitespaceAnalyzer not to use a
>> WhitespaceTokenizer, but a modified version of the Tokenizer which
>> token-ize not by space but by something else, like '/'. (this is  
>> just an
>> example of course).
>> So suppose your real txt document contain :
>> /text2 text3/text4 text5/text6
>> When you add this document to the index using the tokenizer I  
>> explained,
>> terms returned by indexreader.terms should be:
>> text2 text3
>> text4 text5
>> text6
>
> Walter, thank you so much, may I ask you a question:
> if I am using an analyzer, say, XYAnalyzer while indexing, is it  
> affect on
> how to search?
> another thing that buffled me is that by using IndexReader.terms() no
> Analyzer specified so how it possible to do that?
>
> thank you again
>
>
>
> -- 
> Regards,
> Mohammad
> --------------------------
> see my blog: http://brainable.blogspot.com/

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