Problem/Motivation
Currently it's not possible to use a Search API index as source. This seems to be because the Views integration from the Entity module on which Search API bases needs some special handling.
It would be nice to be able to use Seach API Indexes because that way we can e.g. use Solr Indexes which support Spatial operations.
Proposed resolution
Attached patch introduces a way of how to determine if a field is integrated into views by the entity module and handles it accordingly.
Remaining tasks
Reviews needed.
User interface changes
None.
API changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| views_geojson-integrate-with-search_api.patch | 3.5 KB | das-peter |
Comments
Comment #1
polOh I like it !
Unfortunately I won't be able to test it.
Where can I find documentation on this integration please ?
Comment #2
das-peter commentedUnfortunately I've no clue if there's a documentation about this. I developed it freestyle - analysing how the stuff in the Entity module works. Maybe we should ask fago what he thinks ;)
Comment #3
polFrom what I understand of the patch is that it adds two protected variables.
Is it enough to work with search_api ?
Comment #4
das-peter commentedHere's the POC I'm working on:
Importing the Geonames Data into Drupal to be able to fetch metadata (e.g. closest town) for given coordinates without calling an external service.
What I've so far:
Use the Data Entity module to define entities / and entity relations - patch. I use Feeds to import the data.
And this works only with the patch attached here.
The patch basically changes the way how the entity / field information are aquired. The Search API / Entity module Views integration uses its own way - I'm not sure if there's a "proper" way but that's what we deal with atm.
Besides accessing those meta data the usage is transparent. Field rendering and so on work as usual.
Comment #5
dasjoafaik, views geojson should work fine if you just link it to the separately indexed latitude longitude fields
Comment #6
das-peter commentedWell I get notices, notices kill ajax.
So I had to fix it anyway - why not straight away integrate it? Or am I missing something?
Comment #7
polThanks das-peter ;)
Comment #9
das-peter commentedwow that was fast :) Thanks!