From java-user-return-33437-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Wed Apr 02 18:12:38 2008 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 71097 invoked from network); 2 Apr 2008 18:12:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Apr 2008 18:12:37 -0000 Received: (qmail 16606 invoked by uid 500); 2 Apr 2008 18:12:31 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 16577 invoked by uid 500); 2 Apr 2008 18:12:31 -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 16566 invoked by uid 99); 2 Apr 2008 18:12:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 11:12:31 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of erickerickson@gmail.com designates 209.85.128.189 as permitted sender) Received: from [209.85.128.189] (HELO fk-out-0910.google.com) (209.85.128.189) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 18:11:50 +0000 Received: by fk-out-0910.google.com with SMTP id 19so3686199fkr.5 for ; Wed, 02 Apr 2008 11:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=ctm/a3IiRxeQnei2NHenPy+2DrocXT/OOtittF1/rnw=; b=GudkSnAPttieKIvLg/5FZUa6ywossUDvcmsi+NuTY/Eczj7bBPNq6jRZiwEXP5M2lBTsD3SkvBOpCdoqJyqN4K99tW3BtmHY1tSm6jdnR5UVYKXVQCrg9kIZok0AztfHv+7x3YVvNyW0VyWTxivVFvYoMYAEeZGxaV0kjeCDXWM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=I4CGXCr6UA46ytgWp0INPGhRxEdkIDh4oXcNQSam7Ib8p+AeEYcG7z2ldBcXrcuTSPU1wL2WCeVbngYoFogmj1hwvmR9p4AMSfQ90gQN/+J4u9/dQ9xNt+/ThxqA3hkAY26U3M7euNqGaNOCB/LMmXHllLM2FLyXGmbxSyRhdcc= Received: by 10.82.161.19 with SMTP id j19mr24467422bue.12.1207159920389; Wed, 02 Apr 2008 11:12:00 -0700 (PDT) Received: by 10.82.191.6 with HTTP; Wed, 2 Apr 2008 11:12:00 -0700 (PDT) Message-ID: <359a92830804021112g5e263d58icc63b460d279d06a@mail.gmail.com> Date: Wed, 2 Apr 2008 14:12:00 -0400 From: "Erick Erickson" To: java-user@lucene.apache.org Subject: Re: Sorting VS Scoring In-Reply-To: <000601c894da$dce7f6b0$96b7e410$@com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1949_29448813.1207159920374" References: <000601c894da$dce7f6b0$96b7e410$@com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_1949_29448813.1207159920374 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline The problem here is that you'll have to keep deleting and adding your documents in order to update the counter field for all of these solutions, and I doubt that's what you really want to do. There is much discussion of updating a document that's already in the index, but I don't think it's there yet. I know this has been discussed in the mailing list, so you might want to search the searchable archive on this... Best Erick On Wed, Apr 2, 2008 at 12:01 PM, John Xiao wrote: > I'm trying to figure out what the best practice is in term of using > sorting > or customized scoring. > > For example, if I have want to index some static pages and rank them by > how > many times a page is viewed. I can get the page view counters and store > them in the index document as a field COUNTER. I want to be able to sort > query result in the order of most viewed pages. I see three ways to do > it: > > 1. Search result sorting > > Search.search(query, sort); > > 2. Use the counter itself as the score > > FieldScoreQuery("COUNTER", FieldScoreQuery.Type.INT); > > 3. Customize scoring > > Set boost on COUNTER field during index time > > > > I haven't got the last one working yet. Somehow, when I query, boost > value > on the COUNTER field is ignored. > > > > Any inputs? > > > > Thanks, > > John X. > > ------=_Part_1949_29448813.1207159920374--