Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 53DA33680 for ; Wed, 4 May 2011 12:06:37 +0000 (UTC) Received: (qmail 82794 invoked by uid 500); 4 May 2011 12:06:35 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 82750 invoked by uid 500); 4 May 2011 12:06:35 -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 82742 invoked by uid 99); 4 May 2011 12:06:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2011 12:06:35 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [212.243.6.182] (HELO mail.mysigninternational.com) (212.243.6.182) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2011 12:06:28 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.mysigninternational.com (Postfix) with ESMTP id 46F54C2184 for ; Wed, 4 May 2011 14:06:08 +0200 (CEST) Received: from mail.mysigninternational.com ([127.0.0.1]) by localhost (mysign-postfix1.INTERNET [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0ADP-12d6BtE for ; Wed, 4 May 2011 14:06:08 +0200 (CEST) Received: from Exchange2007.mysigndomain.corp (unknown [192.168.13.8]) by mail.mysigninternational.com (Postfix) with ESMTP id F3313C2117 for ; Wed, 4 May 2011 14:06:07 +0200 (CEST) Received: from Exchange2007.mysigndomain.corp ([fe80::b93b:88fd:f694:bc31]) by Exchange2007.mysigndomain.corp ([fe80::b93b:88fd:f694:bc31%10]) with mapi; Wed, 4 May 2011 14:06:07 +0200 From: Clemens Wyss To: "java-user@lucene.apache.org" Date: Wed, 4 May 2011 14:06:06 +0200 Subject: AW: Higher scoring if term is at the beginning of a field/document Thread-Topic: Higher scoring if term is at the beginning of a field/document Thread-Index: AcwKUW2XLP5pQp9+S3aeSX8y2lqMMwAAWMXA Message-ID: References: In-Reply-To: Accept-Language: de-DE, de-CH Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, de-CH Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org I try to be more specific: Given the three documents below. When I search for "moon", I'd like to get the follwoing order of my search = result: moon The moon is bright This is a moon i.e. the "leftmost hit" of my search term should be rated highest/best... How should I analyze/search my documents to get this search/rating behavior= ? > -----Urspr=FCngliche Nachricht----- > Von: Erick Erickson [mailto:erickerickson@gmail.com] > Gesendet: Mittwoch, 4. Mai 2011 13:50 > An: java-user@lucene.apache.org > Betreff: Re: Higher scoring if term is at the beginning of a field/docume= nt >=20 > What is the problem you're trying to solve? I'm wondering if this is an X= Y > problem. See: > http://people.apache.org/~hossman/#xyproblem >=20 > Best > Erick >=20 > On Wed, May 4, 2011 at 3:16 AM, Clemens Wyss > wrote: > > Given the I have 3 documents with exactly one field and the fields have= the > following contents: > > This is a moon > > The moon is bright > > moon > > > > If I analyze these documents they all hit on "moon". But how do I need = to > analyze/search my index in order to have the following "sort order": > > moon > > The moon is bright > > This is a moon > > > > i.e. the earlier the term appears the higher the score. > > > > Thx > > Clemens > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > > For additional commands, e-mail: java-user-help@lucene.apache.org > > > > >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org