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 9F6823760 for ; Wed, 4 May 2011 12:35:43 +0000 (UTC) Received: (qmail 45090 invoked by uid 500); 4 May 2011 12:35:41 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 45043 invoked by uid 500); 4 May 2011 12:35:41 -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 45035 invoked by uid 99); 4 May 2011 12:35:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2011 12:35:41 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of erickerickson@gmail.com designates 209.85.216.169 as permitted sender) Received: from [209.85.216.169] (HELO mail-qy0-f169.google.com) (209.85.216.169) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2011 12:35:36 +0000 Received: by qyk2 with SMTP id 2so3152740qyk.14 for ; Wed, 04 May 2011 05:35:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=EEVvm9SQyDzt2pRHTMeqewIaKTPTZ9o3PuZzYsia8A0=; b=KTHFzwHYhhhIfOQIGqTxgLsr57Q4Fe59C0oyw0Z/Q6upsMrOxBx1KQrJs7/G/sZrth gjxCq4j5+suTpHgsNz35yOqW6NK7JT8Z6YR7Dpgd32ObkRRAyQrPU6voFB+Xy/pDKuaQ /JrIpbVT7Pfn1RRlVzMhUc4nriZGffKMqGoEA= 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=bx1qeDYoYEpSuHy5QuzsX83+So0o254kJBkZqMvwb+k6YSBgI5O+Sv30OlzejgX5tq 4kgSdfyWwHudR+j5xkZX5IT3yUNZOAFt1JCqY3S81l2a1ceM/QDLVCavHaG8AJ0POFuJ kpwteezIeGC+0pP1rKrEbvJmATqo7NJBn/59M= MIME-Version: 1.0 Received: by 10.229.78.155 with SMTP id l27mr722958qck.47.1304512515341; Wed, 04 May 2011 05:35:15 -0700 (PDT) Received: by 10.229.245.81 with HTTP; Wed, 4 May 2011 05:35:14 -0700 (PDT) In-Reply-To: References: Date: Wed, 4 May 2011 08:35:14 -0400 Message-ID: Subject: Re: Higher scoring if term is at the beginning of a field/document From: Erick Erickson To: java-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 want? Are you just experimenting? 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. Best Erick 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 searc= h 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 behavi= or? > >> -----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/docum= ent >> >> 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 hav= e 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 > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org