Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 93126 invoked from network); 16 Jun 2004 16:09:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 16 Jun 2004 16:09:49 -0000 Received: (qmail 96907 invoked by uid 500); 16 Jun 2004 16:09:45 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 96845 invoked by uid 500); 16 Jun 2004 16:09:45 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 96788 invoked by uid 99); 16 Jun 2004 16:09:44 -0000 Received: from [160.62.1.169] (HELO fw-mail12.novartis.com) (160.62.1.169) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 16 Jun 2004 09:09:44 -0700 Received: from mtap2.is.chbs ([192.37.33.19]) by fw-mail12.novartis.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i5GG9FVR14926002 for ; Wed, 16 Jun 2004 18:09:15 +0200 Received: from phchbs-s3025.EU.novartis.net (phchbs-s3025.eu.novartis.net [192.37.31.249]) by mtap2.is.chbs (Switch-3.1.4/Switch-3.1.0) with ESMTP id i5GG9FwX7471274 for ; Wed, 16 Jun 2004 18:09:15 +0200 Subject: Re: RuntimeException: cannot determine sort type! To: "Lucene Users List" Message-ID: From: iouli.golovatyi@group.novartis.com Date: Wed, 16 Jun 2004 18:09:13 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Erik, thank You very much, I tried it and it looked like it really fixed the problem. > formated_query=query.toString(); > if (sort_byscore)hits = ms.search(query); > else hits = ms.search(query,new > Sort("modified",true)); > // here the "cannot determine.." exception generated!!! How about using: ms.search(query, new Sort(new SortField("modified", SortField.STRING, true))); Does that fix it? If "modified" is only there for sorting and not for querying, perhaps index it as a Integer.toString or Float.toString instead - this will give you better resource usage and performance most likely - and change the type to SortField.INT or SortField.FLOAT appropriately. The sorting infrastructure can detect a type, but it may have issues doing so if the strings look like a number in the first document but later appear like a String. DateField.timeToString makes them String, so forcing it to sort on String type should work. This field is used mostly for sorting, but I'm going to use it for query as well just get the end user possibility to see the incoming data in real time, i.e. modified[timefrom TO timeto] I used this format because I sow it doc doing like this. Should I really change to numbers? Regards, J. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org