From java-user-return-49619-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Wed May 4 12:53:40 2011 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 C092F3F82 for ; Wed, 4 May 2011 12:53:40 +0000 (UTC) Received: (qmail 71052 invoked by uid 500); 4 May 2011 12:53:38 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 71010 invoked by uid 500); 4 May 2011 12:53:38 -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 71002 invoked by uid 99); 4 May 2011 12:53:38 -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:53:38 +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:53:31 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.mysigninternational.com (Postfix) with ESMTP id 49F06C2184 for ; Wed, 4 May 2011 14:53:11 +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 T6ToYb-a9O38 for ; Wed, 4 May 2011 14:53:11 +0200 (CEST) Received: from Exchange2007.mysigndomain.corp (unknown [192.168.13.8]) by mail.mysigninternational.com (Postfix) with ESMTP id 1CEFEC2117 for ; Wed, 4 May 2011 14:53:11 +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:53:11 +0200 From: Clemens Wyss To: "java-user@lucene.apache.org" Date: Wed, 4 May 2011 14:53:09 +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: AcwKV8nb+KivSmquSHm1VKGwAkahQQAAMk8Q 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 Ok, I got you ;) Besides my "real index" (which is being analyzed through a ShingleAnalyzerW= rapper) I implicitly/transparently build up a "search term index" which I p= opulate with the terms (being shingles) of my "real index". The "search ter= m index" is being used to provide search term suggestions when the user typ= es in a search term. E.g. if a user types: "moo" then I'd expect the following order of search term suggestions: "moon" "The moon..." "This is a moon" ... Thx Clemens > -----Urspr=FCngliche Nachricht----- > Von: Erick Erickson [mailto:erickerickson@gmail.com] > Gesendet: Mittwoch, 4. Mai 2011 14:35 > An: java-user@lucene.apache.org > Betreff: Re: Higher scoring if term is at the beginning of a field/docume= nt >=20 > I didn't ask a clear question. *Why* do you want to do this? > What is the use-case you're trying to solve? Is relevance not what you wa= nt? > Are you just experimenting? >=20 > The statement of *what* you want to do is clear, but I don't know an easy= to > do that. Perhaps there's a better approach to solving the underlying need= . >=20 > Best > Erick >=20 > On Wed, May 4, 2011 at 8:06 AM, Clemens Wyss > wrote: > > 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 sea= rch > 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/document > >> > >> What is the problem you're trying to solve? I'm wondering if this is > >> an XY problem. See: > >> http://people.apache.org/~hossman/#xyproblem > >> > >> Best > >> Erick > >> > >> 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 > >> > > >> > > >> > >> --------------------------------------------------------------------- > >> 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 > > > > >=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