Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 59491 invoked from network); 27 Nov 2007 01:18:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Nov 2007 01:18:16 -0000 Received: (qmail 89543 invoked by uid 500); 27 Nov 2007 01:17:57 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 89519 invoked by uid 500); 27 Nov 2007 01:17:57 -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 89508 invoked by uid 99); 27 Nov 2007 01:17:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Nov 2007 17:17:57 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.69.42.181] (HELO radix.cryptio.net) (208.69.42.181) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Nov 2007 01:17:38 +0000 Received: by radix.cryptio.net (Postfix, from userid 1007) id 206BB71C23E; Mon, 26 Nov 2007 17:17:40 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by radix.cryptio.net (Postfix) with ESMTP id 1C5D171C11E for ; Mon, 26 Nov 2007 17:17:40 -0800 (PST) Date: Mon, 26 Nov 2007 17:17:40 -0800 (PST) From: Chris Hostetter To: Lucene Users Subject: Re: Score: Randomize form In-Reply-To: <359a92830711261621w1a2e5746w6a5a01a6a357cb70@mail.gmail.com> Message-ID: References: <718789d20711261531l608b7b31sd0ab11fad6918470@mail.gmail.com> <359a92830711261621w1a2e5746w6a5a01a6a357cb70@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org : I think you have a couple of problems here. First, you'll have to : normalize the scores to get *any* of them to be the same. Since : the scores are a float, very few of them will be exactly the same. it's not as rare as it seems, with lengthNorm byte encoding and low tf values it can happen quite a bit -- with a custom Siilarity you can *make* it happen a lot. : > I show the results of searches as two criterios of sorting ("priority" : > and : > to after "score") of each document. : > I need present the result with same score of ramdomize form. based on the example you gave, it sounds like you don't really want to sort on score at all ... you just want a randomized sort after sorting on the priority field. Solr has a "RandomSortField" which contains a "RandomSort" class that don't think has any deep Solr dependencies ... it works by using the "field name" arg as a seed for randomizing the order of results, so you can iterate/paginate over a consistent "random" ordering as long as you keep resuing hte same name ... pick a differnet name everytime (use a counter, or a random number) and you'll get a different order. you could use that as a secondary sort after your priority field (or a tertiary sort after score) -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org