Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 16537 invoked from network); 22 May 2007 13:25:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 May 2007 13:25:52 -0000 Received: (qmail 56242 invoked by uid 500); 22 May 2007 13:25:50 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 56214 invoked by uid 500); 22 May 2007 13:25:49 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 56203 invoked by uid 99); 22 May 2007 13:25:49 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2007 06:25:49 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [208.97.132.81] (HELO spunkymail-a2.g.dreamhost.com) (208.97.132.81) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2007 06:25:40 -0700 Received: from [192.168.0.2] (adsl-074-229-189-244.sip.rmo.bellsouth.net [74.229.189.244]) by spunkymail-a2.g.dreamhost.com (Postfix) with ESMTP id 7119B87B60 for ; Tue, 22 May 2007 06:25:18 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <34b8543c0705220509m38921b59x5a1334070b2f1059@mail.gmail.com> References: <34b8543c0705220229v362aa368je4a1ce8633a60ff5@mail.gmail.com> <307863C0-E6CD-46D1-83F6-5BEE9E57FAA2@apache.org> <34b8543c0705220509m38921b59x5a1334070b2f1059@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Grant Ingersoll Subject: Re: regaridng Reader.terms() Date: Tue, 22 May 2007 09:25:16 -0400 To: java-user@lucene.apache.org X-Mailer: Apple Mail (2.752.2) X-Virus-Checked: Checked by ClamAV on apache.org 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