Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 33620 invoked from network); 18 May 2010 16:19:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 May 2010 16:19:03 -0000 Received: (qmail 79824 invoked by uid 500); 18 May 2010 16:19:01 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 79741 invoked by uid 500); 18 May 2010 16:19:01 -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 79733 invoked by uid 99); 18 May 2010 16:19:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 May 2010 16:19:01 +0000 X-ASF-Spam-Status: No, hits=-1.6 required=10.0 tests=AWL,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of roman.baeriswyl@comparis.ch designates 77.109.144.6 as permitted sender) Received: from [77.109.144.6] (HELO mimas.comparis.ch) (77.109.144.6) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 May 2010 16:18:57 +0000 Received: from mimas.comparis.ch ([192.168.1.161]) by mimas.comparis.ch ([192.168.1.161]) with mapi; Tue, 18 May 2010 18:18:36 +0200 From: comparis.ch - Roman Baeriswyl To: "'java-user@lucene.apache.org'" Date: Tue, 18 May 2010 18:18:34 +0200 Subject: Sorting and Empty (non-existing) Fields Thread-Topic: Sorting and Empty (non-existing) Fields Thread-Index: Acr2pcOxHWIi81RbRSqU31cfhThxew== Message-ID: Accept-Language: de-DE, de-CH Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, de-CH Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Hi All I've got a problem I'm trying to solve the whole day: Let's say I have an index with two fields, the first one is always filled a= nd the second one only sometimes. Now I want to search something on the first field and want the results sort= ed by relevance, then by the first field, then by the second field. My problem now is that, if I have a lot of Entries with the same value in t= he first field and no value in the second field, these entries with no valu= e on the 2nd field are coming first. Is there any way to increase the score on those documents which have a valu= e on the second field? Or is there any way to skip those Documents which do= n't have the second field? I don't want to use a Filter, it should all be d= one with the Queries Objects if possible. I tried a lot of things with WildcardQuery or TermRangeQuery (with null val= ues or empty strings) in Luke and directly in IndexSearcher, but I always g= et either no results or all results, even those which have no value in the = second field. I found a lot of information where "-field2:[* TO *]" or similar stuff shou= ld work but it doesn't. Can anyone give me some hints? Thanks Roman Holen Sie die besten Elektronik-Aktionen direkt auf Ihr Facebook-Profil: ht= tp://www.facebook.com/pages/Preissturz/218831069608 Die besten Elektronik-Aktionen auf Twitter: http://twitter.com/preissturz1 --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org