Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

search_api + elasticsearch + location_cck spatial indexing working#94

Open
woutersf wants to merge 3 commits intoBrianAltenhofel:7.x-1.xfrom
woutersf:7.x-1.x
Open

search_api + elasticsearch + location_cck spatial indexing working#94
woutersf wants to merge 3 commits intoBrianAltenhofel:7.x-1.xfrom
woutersf:7.x-1.x

Conversation

@woutersf
Copy link

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

  • select all the location fields (street/latlon/...) in the search_api index
  • index this location data spatially
  • search on all location subfields in the index

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 woutersf changed the title geospatial indexing working search_api + elasticsearch + location_cck spatial indexing working Sep 22, 2016
@woutersf
Copy link
Author

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

@woutersf
Copy link
Author

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
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant