VeggieMeat / search_api_elasticsearch

Clone of project at drupal.org/project/search_api_elasticsearch for better CI options than what D.O offers
16 stars 8 forks source link

search_api + elasticsearch + location_cck spatial indexing working #94

Open woutersf opened 7 years ago

woutersf commented 7 years ago

Related drupal.org issue: https://www.drupal.org/node/2804437

My Drupal 7 use case (and what problem does this fix): I have a content-type (e.g. Organisation) with a location Field (e.g.field_organisation_location - location_cck).

I want the organisations sorted by distance and filtered on a 5 km range close to a location (in my case this is a custom elastic query).

This pull request allows the cck_location field to be indexed and filtered/sorted spatially. The patch allows to

Custom queries already work with sorting/filtering by location/distance (which is nice). I know this code is not perfect, but the latlong from location_cck is indexed in elasticsearch.

By the way: I am looking for advice on how to use these location data for filtering and sorting in views.

woutersf commented 7 years ago

I also don't understand why the Travis CI gives all these errors. Help is more than welcome.

woutersf commented 7 years ago

When the search_api_location FILTER (distance + radius) is enabled this will now also be passed on to the elastica query (see last commit) . Also when the lat lon is used as SORT they will be sorted from near to far.

//todo add view handler that allows "far to near/near to far" selection in views widget.

woutersf commented 7 years ago

@VeggieMeat can you please advise me on how to make the continuous build succeed? How do I impact this?