[hibernate-dev] [HSEARCH] Geo queries in ElasticSearch

Emmanuel Bernard emmanuel at hibernate.org
Wed Jul 3 08:36:19 EDT 2013


It seems to me that for each geo facet, you need to execute a query
which is fast. So in my example, the query will be executed 4 times. One
for the regular query and 3 times with different radius retrieving the
count. In other words, you don't really need to compute the distance for
each point.

Wouldn't that work?

Emmanuel

On Wed 2013-07-03 14:21, Nicolas Helleringer wrote:
> The difficulty in this is that unlike other facets counts those are to
> be dynamically computed.
> 
> The current facet systems (either native Lucene or Hibernate ones) are
> using the Lucen Token reverse
> indexes performance to compute the facets on queries results that can
> be very large.
> 
> This cannot be done here as the distance to the search center is dynamic.
> If you have a query with 10k result and you display only the first ten
> results as first page and to strengthen
> the search you want geo facets then you have to compute distance on
> all the 10k results to produce that.
> On the performance PoV this will fail.
> 
> Niko
> 
> 
> 2013/7/3 Emmanuel Bernard <emmanuel at hibernate.org>:
> > I'm more interested in something like
> >
> > Within 10 kms (23)
> > Between 10 and 50 kms (45)
> > Above 50 kms (75)
> >
> >
> > On Wed 2013-07-03 11:24, Nicolas Helleringer wrote:
> >> Was is demonstrated here has nothing of a facet : these are only aggregates.
> >>
> >> <quote>
> >> GeoDistanceFacet results:
> >> -------------------------------------------------------------
> >> Distance from origin: 0.0
> >> Distance to requested: 1000.0
> >> Number of results: 29
> >> Minimum distance: 0.0
> >> Maximum distance: 899.5358131385483
> >> Sum of distances: 17320.209230844222
> >> Mean distance: 597.2485941670421
> >> </quote>
> >>
> >> I see nothing we cannot do.
> >>
> >> Niko
> >>
> >> 2013/7/3 Emmanuel Bernard <emmanuel at hibernate.org>:
> >> > This morning I was reading http://hashmade.fr/elastic-search-geo-distance-search-with-sorted-and-faceted-results-using-java-native-api/
> >> > And the code https://github.com/jsebrien/elastic-search-tests
> >> >
> >> > I have to say that we compare quite well in number of lines of code and readability. Considering that ElasticSearch is considered the easy tool / API in the search space, I did not expect that.
> >> >
> >> > We could do better on the facet side, I particular to retrieve the facet data.
> >> >
> >> > By the way, they offer a way to facet by spatial distance, Hardy, Nicolas, how hard would it be to do the same?
> >> >
> >> > Emmanuel
> >> > _______________________________________________
> >> > hibernate-dev mailing list
> >> > hibernate-dev at lists.jboss.org
> >> > https://lists.jboss.org/mailman/listinfo/hibernate-dev


More information about the hibernate-dev mailing list