Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 43487 invoked from network); 2 May 2009 12:59:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 May 2009 12:59:47 -0000 Received: (qmail 60510 invoked by uid 500); 2 May 2009 12:59:45 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 60430 invoked by uid 500); 2 May 2009 12:59:45 -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 60420 invoked by uid 99); 2 May 2009 12:59:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 May 2009 12:59:45 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of seidymam@gmail.com designates 209.85.220.158 as permitted sender) Received: from [209.85.220.158] (HELO mail-fx0-f158.google.com) (209.85.220.158) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 May 2009 12:59:36 +0000 Received: by fxm2 with SMTP id 2so3224982fxm.5 for ; Sat, 02 May 2009 05:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=rLY8n0AOWfxJDsZYApG55EbsZj6k/ni4346foYzBv+s=; b=aXP2jScCA3gXYx6l5r9u+UarbgWw41F0eL/pRyvqdj+I7ZyX9IyRLzObTCL6sHCZHS rfDlY11ituqV9WKPiSJ5uQe35pkkTJg0ue8pHo9RR1tmsG/uqeMHouQjoZkMa1xiDtK9 WyIWC677b0PHj3SnAOpy7RJzCJZfOafOxH1T8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=s7CFVzlCWOcDIvULyutzObfIgNRz/N3UBxRfCqDc6qNFj2qLrJIW8fyVJMxVoeGddX BTU1tHKzUwiADD49l/TmdNWdTJy3RU6U1K8pBGC+z9fdUgnXJsJDXhfXkdq5Xi6o4pE9 qJNRPgIrHByxIUuGdWrP54trrB2uJ6gEvr5l0= MIME-Version: 1.0 Received: by 10.204.31.75 with SMTP id x11mr3626261bkc.1.1241269155100; Sat, 02 May 2009 05:59:15 -0700 (PDT) In-Reply-To: References: Date: Sat, 2 May 2009 15:59:15 +0300 Message-ID: <179b305e0905020559x499d6bfcp337344b24a9c73ba@mail.gmail.com> Subject: Re: not the length that matters, but the content From: Seid Mohammed To: java-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org thanks it solves On 5/2/09, Kamal Najib wrote: > I think one way to realize it is to run a phrase query.In your example for > example: > if you run phrasequery with " the quick brown fox" you will only have > maches like "*"+"the quickbrown fox"+"*",the * is any other string. that's > mean a doc will be considered as a match only if the doc contans a field > that contains the whole query as a substring. > Code: > when you instantiate the Query Object you should do somthing like this: > QueryParser parser = new QueryParser("contents",analyser); > Query query =parser.parse('"'+queryString+'"'); > > if the machtes are still not precise enough for you, you have to do it with > the similarity score , for example: > if the score similarity between " the quick brown fox" and doc1 is: 2.5654 > and between " the quick brown fox" and doc2 : 7.8982 you should take only > the matches with higher score, it's just an idea. > best regards. > kamal > Original Message: > > I want documents which have more number of query term matches to be >
returned, not the one with less number of terms to matter. >
that is, if I submit the query " the quickbrown fox" have two >
documents doc1: brown fox >
doc2: the quick brown fox jumps over the lazzy dog. >
I want the search result be doc2 . >
How can I do so. >
peice of code will be helpfull >
>
>
Thanks a lot >
>
Seid M >
-- >
"RABI ZIDNI ILMA" >
>
--------------------------------------------------------------------- >
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >
For additional commands, e-mail: java-user-help@lucene.apache.org >
>
> > -- > > -- "RABI ZIDNI ILMA" --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org