Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 731DF200CB8 for ; Sat, 1 Jul 2017 23:10:32 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 720B3160BEA; Sat, 1 Jul 2017 21:10:32 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B888B160BDF for ; Sat, 1 Jul 2017 23:10:31 +0200 (CEST) Received: (qmail 27797 invoked by uid 500); 1 Jul 2017 21:10:30 -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 27785 invoked by uid 99); 1 Jul 2017 21:10:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Jul 2017 21:10:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id C566DC0118 for ; Sat, 1 Jul 2017 21:10:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.314 X-Spam-Level: ** X-Spam-Status: No, score=2.314 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=mikemccandless-com.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id nMEaA_gvQVkg for ; Sat, 1 Jul 2017 21:10:28 +0000 (UTC) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com [209.85.223.181]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 7FA165F368 for ; Sat, 1 Jul 2017 21:10:28 +0000 (UTC) Received: by mail-io0-f181.google.com with SMTP id r36so39225570ioi.1 for ; Sat, 01 Jul 2017 14:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mikemccandless-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=9fCNYD/sJw1Bn0JM5FW5gAAhkeeK4WRzfmCItf0WaDM=; b=STgYlCefHlbisCvd9m4wDjRIq63Fq2d3VIN6BMdNMQRGqrGOGo14wkd5lVIbBOsCLh l4yuUb8Oh+rtYACY0U6HMnOtakTLj87Ekc16b5ncSHpzYkvAdV4eNf9HgVVo3TmDheXb SfkP0q4gyqZlErEMMu8oziL7cf83eLkzQ3V4av3AxEUcOe92wdDFQPbQJ3WQKyyoQEo4 gNPxAOUfRGEZigH0Yp91LGYJZG05PcpLAog17Wc4TBOqDAL0QduVMXJtzPl+PbST7jhh lilIJeWSlACVHS6WcuNdCNIC9pP/UgS8vvUJ/o2cd3iWHtS1+hqqOdyYU9rmXSK6vqFJ EwIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=9fCNYD/sJw1Bn0JM5FW5gAAhkeeK4WRzfmCItf0WaDM=; b=XVfm5TOU5HaKWobrITYBNoyemy7XbDK/az2RgPrEBNi1o+1hqd1UVvYEgB+LmlYIWr lmiip+Xx6n0NrWQj63u0adPCKq4ZokDwRiNnrghDiKH8zqJRe7DCfH6bCAHMT2hST/Mv /XiNHTpZm0Bdh4/JFxCAC5zBT9253u2TUiPNOXQ6IqNTAzTG9kVajwJ6Ea2KwRg8Ouhc gYpIENiO9aOVq2b3PXzLuWZ9NFm3OqEasBehOC3vICk2b7qg5LfBAhBBSNVwJO4bnaKX sSp8dZeFuTL8IwSbW5BfMZFynsJepKPT17Ha6J8fmbCfPkgWHS1yLh9yD3blum+F0KOF LOcw== X-Gm-Message-State: AKS2vOwarhowCt3ZS1ATx35Dpt3Qu+xKT8B0NLl8iKe+fuBM+nKB5PU0 /gUKP9Cda+kU/JzPYuSAY6cMVqpOkte1 X-Received: by 10.107.168.221 with SMTP id e90mr30184953ioj.68.1498943422201; Sat, 01 Jul 2017 14:10:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.41.84 with HTTP; Sat, 1 Jul 2017 14:09:41 -0700 (PDT) In-Reply-To: <1498758117577-4343502.post@n3.nabble.com> References: <1498752375203-4343468.post@n3.nabble.com> <1498758117577-4343502.post@n3.nabble.com> From: Michael McCandless Date: Sat, 1 Jul 2017 17:09:41 -0400 Message-ID: Subject: Re: Lucene GeoNear Search and Sort Performance To: Lucene Users , sc Content-Type: multipart/alternative; boundary="001a11425a62381d01055347f65b" archived-at: Sat, 01 Jul 2017 21:10:32 -0000 --001a11425a62381d01055347f65b Content-Type: text/plain; charset="UTF-8" You can use LatLonPoint.newDistanceQuery to get the results within the specified distance, and then use LatLonDocValuesField.newDistanceSort to sort by distance, and use the IndexSearcher.search method that takes Sort. Then the results should be all points within the radius, sorted by distance. That should (maybe) be faster than computing haversin yourself on all hits. Extending LatLonPoint.nearest to take a distance instead of top N should be possible ... maybe open an issue? Mike McCandless http://blog.mikemccandless.com On Thu, Jun 29, 2017 at 1:41 PM, sc wrote: > Thank you so much. With LatLonPoint.nearest(..), I am getting results in > 6ms, > with accurate results, when I compared MongoDB.geoNear(). > > I also tried with LatLonPoint.newDistanceQuery, and I got results in 6ms > but the results are NOT the nearest points. > > Few more questions: > > Is there an API that use with LatLonPoint.nearest where I can specify the > radius. > > Or how can I sort results from LatLonPoint.newDistanceQuery? > > Thanks again. > > > > > > -- > View this message in context: http://lucene.472066.n3.nabble > .com/Lucene-GeoNear-Search-and-Sort-Performance-tp4343468p4343502.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 > > --001a11425a62381d01055347f65b--