Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 7409 invoked from network); 28 Jun 2009 17:44:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Jun 2009 17:44:31 -0000 Received: (qmail 23275 invoked by uid 500); 28 Jun 2009 17:44:40 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 23193 invoked by uid 500); 28 Jun 2009 17:44:40 -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 23183 invoked by uid 99); 28 Jun 2009 17:44:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Jun 2009 17:44:40 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [85.25.71.29] (HELO mail.troja.net) (85.25.71.29) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Jun 2009 17:44:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.troja.net (Postfix) with ESMTP id 1D99E45EA2A; Sun, 28 Jun 2009 19:44:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.troja.net Received: from mail.troja.net ([127.0.0.1]) by localhost (megaira.troja.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vAD16r2YbIWU; Sun, 28 Jun 2009 19:43:54 +0200 (CEST) Received: from VEGA (port-83-236-62-13.dynamic.qsc.de [83.236.62.13]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.troja.net (Postfix) with ESMTPSA id B328D45E97F; Sun, 28 Jun 2009 19:43:54 +0200 (CEST) From: "Uwe Schindler" To: Cc: "'mitu2009'" References: <24243647.post@talk.nabble.com> Subject: RE: Correctly indexing latitude and longitude values in Lucene Date: Sun, 28 Jun 2009 19:43:54 +0200 Message-ID: <9C22432F1401479C935C1EA928DCCD66@VEGA> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <24243647.post@talk.nabble.com> Thread-Index: Acn4F3ZVNLxh/PJBRxu/JSB36HOCNAAAHLFQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Virus-Checked: Checked by ClamAV on apache.org I already responded to your eMail and answered all your questions! ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: uwe@thetaphi.de > -----Original Message----- > From: mitu2009 [mailto:musicfreaque@gmail.com] > Sent: Sunday, June 28, 2009 7:39 PM > To: java-user@lucene.apache.org > Subject: Correctly indexing latitude and longitude values in Lucene > > > Hi, > > Am working on a "US based nearest city search within a given radius" > functionality using Lucene API. > Am indexing city's lat and long values in Lucene as follows: > > doc.Add(new Field("latitude", paddedLatitude, Field.Store.YES, > Field.Index.UN_TOKENIZED)); > > doc.Add(new Field("longitude", paddedLongitude, Field.Store.YES, > Field.Index.UN_TOKENIZED)); > > Since Lucene only understands strings and not numbers, am padding lat and > long values. > > For example, if original lat and long are 41.811846 and -87.820628 > respectively, after padding,values look like: > > paddedLatitude -->"0041.811846" and paddedLongitude-->"-087.820628" > > Am doing the same padding while building the nearest city query(using > Lucene's ConstantScoreRangeQuery class). > > Given the fact that lat and long values could be decimal/negative numbers, > is this the right approach to index them so that I would get correct > nearest > cities in the search results when lucene would perform a number > Range/comparison operation on these values? > > Thanks. > > -- > View this message in context: http://www.nabble.com/Correctly-indexing- > latitude-and-longitude-values-in-Lucene-tp24243647p24243647.html > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org