Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 81111 invoked from network); 25 Sep 2006 17:19:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Sep 2006 17:19:57 -0000 Received: (qmail 49182 invoked by uid 500); 25 Sep 2006 17:19:50 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 49151 invoked by uid 500); 25 Sep 2006 17:19:49 -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 49140 invoked by uid 99); 25 Sep 2006 17:19:49 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Sep 2006 10:19:49 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=pablolynch@yahoo.com; spf=permerror Authentication-Results: idunn.apache.osuosl.org header.from=pablolynch@yahoo.com; domainkeys=good X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS Received-SPF: error (idunn.apache.osuosl.org: domain yahoo.com from 68.142.201.236 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from [68.142.201.236] ([68.142.201.236:33006] helo=web30413.mail.mud.yahoo.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 09/FC-13750-EAF08154 for ; Mon, 25 Sep 2006 10:19:45 -0700 Received: (qmail 74114 invoked by uid 60001); 25 Sep 2006 17:19:13 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=QC4iCZfGPbvvU7KM+nTJnx5ZgtHm/pqAxB0nZuyheu4P2qNm2znwZRKPcEzEJ4ATg0aHCFo2pyA88C5MvNNEmSLW3p9u1qQ+ojG8217MhGdSwsrHF2jefwfeJJbrckx2l8iRbv86EfoG2EOB2Ruax/40IxQSSDS5amsceenj9eg= ; Message-ID: <20060925171913.74112.qmail@web30413.mail.mud.yahoo.com> Received: from [83.245.56.18] by web30413.mail.mud.yahoo.com via HTTP; Mon, 25 Sep 2006 10:19:13 PDT Date: Mon, 25 Sep 2006 10:19:13 -0700 (PDT) From: Paul Lynch Subject: Advice on Custom Sorting To: java-user@lucene.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi All, I have an index containing documents which all have a field called SubId which holds the ID of the Subscriber that submitted the data. This field is STORED and UN_TOKENIZED When I am querying the index, the user can cloose a number of different ways to sort the Hits. The problem is that I have a list of SubIds that should appear at the top of the results list regardless of how the index is sorted. In other words, lets suppose the Hits should be sorted by DateAdded, I require the Hits to be sorted by DateAdded for the SubIds in my list and then by DateAdded for the SubIds not in my list. >From reading previous discussions on the mailing list, I believe I could achieve what I need by writing custom filters i.e. Run the query first with a custom filter for the SubIds in my list and then a second time with a custom filter for the SubIds not in my list and then "merge" the results. I suppose my question is simple: Is there a better way to achieve this? Couple of bits of info which I would influence best design: - Index contains roughly 5M documents - There can be up to 10K different unique SubIds - My "Preferred SubId List" could contain any combination of the 10K SubIds including all or none of them - My "Preferred SubId List" gets updated about 10 times and hour so I could cache the custom filters Thanks in advance, Paul --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org