Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 65323 invoked from network); 5 Oct 2006 08:08:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Oct 2006 08:08:56 -0000 Received: (qmail 78965 invoked by uid 500); 5 Oct 2006 08:08:49 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 78931 invoked by uid 500); 5 Oct 2006 08:08: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 78920 invoked by uid 99); 5 Oct 2006 08:08:49 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Oct 2006 01:08:49 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [195.18.148.14] ([195.18.148.14:34529] helo=bat-mail02.banetele.basefarm.net) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 40/01-20288-D7DB4254 for ; Thu, 05 Oct 2006 01:08:37 -0700 Received: from [85.221.54.38] (port=15311 helo=dev02.tv2katalogen.no) by bat-mail02.banetele.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1GVOGr-0003Lb-7J for java-user@lucene.apache.org; Thu, 05 Oct 2006 10:07:57 +0200 From: Frode Bjerkholt Organization: mTouch AS To: java-user@lucene.apache.org Subject: Different boost values for different terms in a field. Date: Thu, 5 Oct 2006 10:10:43 +0200 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610051010.43200.fb@mtouch.no> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi My intention is to give different terms in a field different boost values. The queries from a use perspective, will be one fulltext input field. The following code illustrates this: Field f1 = new Field("name", "John", Field.Store.NO, Field.Index.TOKENIZED); Field f2 = new Field("name", "Doe", Field.Store.NO, Field.Index.TOKENIZED); f1.setBoost(1.0f); f2.setBoost(2.0f); doc.add(f1); doc.add(f2); In the current version of Lucene, as far as I now, this does not work - Allthough it would have been a very powerful feature. The current solution is to make a firstname field and a lastname field, and then make a complex query like this: Input: Eric Doe (firstname:Eric OR lastname:Eric^2) AND (firstname:Doe OR lastname:Doe^2) The performance of such a query is quite slow, and it becomes even worse when you have more than two fields and/or more words in the input string. My questions: 1. Is there a better/faster solution to accomplish such a query? 2. Would it be possible to implement the described feature in a future version of Lucene? -- Best Regards, Frode --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org