From java-user-return-46330-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Wed Jun 02 09:30:50 2010 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 70041 invoked from network); 2 Jun 2010 09:30:50 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Jun 2010 09:30:50 -0000 Received: (qmail 80658 invoked by uid 500); 2 Jun 2010 09:30:48 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 80473 invoked by uid 500); 2 Jun 2010 09:30:47 -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 80465 invoked by uid 99); 2 Jun 2010 09:30:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jun 2010 09:30:47 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [195.253.6.130] (HELO kmx10a.knipp.de) (195.253.6.130) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jun 2010 09:30:37 +0000 Received: from localhost (localhost [127.0.0.1]) by kmx10a.knipp.de (Postfix) with ESMTP id B9A7B6E; Wed, 2 Jun 2010 11:30:17 +0200 (MESZ) X-Knipp-VirusScanned: Yes Received: from kmx10a.knipp.de ([127.0.0.1]) by localhost (kmx10a.knipp.de [127.0.0.1]) (amavisd-new, port 10004) with ESMTP id cXFa865se54u; Wed, 2 Jun 2010 11:30:12 +0200 (MESZ) Received: from hp9000.do.knipp.de (hp9000.do.knipp.de [195.253.2.54]) by kmx10a.knipp.de (Postfix) with ESMTP id E5639E5; Wed, 2 Jun 2010 11:30:11 +0200 (MESZ) Received: from [195.253.2.27] (mclane.do.knipp.de [195.253.2.27]) by hp9000.do.knipp.de (@(#)Sendmail version 8.13.3 - Revision 1.000 - 1st August,2006/8.13.3) with ESMTP id o529UB31024265; Wed, 2 Jun 2010 11:30:11 +0200 (MESZ) Message-ID: <4C0624A3.6060309@knipp.de> Date: Wed, 02 Jun 2010 11:30:11 +0200 From: Klaus Malorny User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.3a5pre) Gecko/20100506 Shredder/3.2a1pre MIME-Version: 1.0 To: java-user@lucene.apache.org CC: Julian Atkinson Subject: Re: spatial searches References: <4BE95917.6040007@knipp.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 22/05/10 08:45, Julian Atkinson wrote: > Hi Klaus, > > I suggest you take a look at the code in TestCartesian.java for > working examples of the search and as a staring point to trace > through. > > in more depth, if you look at DistanceQueryBuilder.java you'll see 2 > filters are being setup. > > The first pass filter is created by CartesianPolyFilterBuilder and > this makes sure you only consider documents near to the area you are > searching by looking in the right tier and pulling out the relevant > grid cells. > > The second filter is dependent on which method you are using Lat/Lng > or Geohash - this is where the more precise filtering is done based on > the calculated distance. > > The use of the second pass filter is optional and driven by a boolean. > > If you want to custom score then there is an example in the > TestCartesian.class with CustomScoreQuery > > Hope this helps, > Julian Hi Julian, sorry not to thank earlier -- unfortunately, I had a family tragedy. I missed that CustomScoreQuery can be used without ValueSourceQuery instances. So I will try to use a term query as a subquery to preselect the documents in the geographic vicinity and to finally calculate the right distances using an own implementation of CustomScoreProvider. Greetings, Klaus --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org