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.

Comments

pol’s picture

Oh I like it !

Unfortunately I won't be able to test it.

Where can I find documentation on this integration please ?

das-peter’s picture

Unfortunately 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 ;)

pol’s picture

From what I understand of the patch is that it adds two protected variables.

Is it enough to work with search_api ?

das-peter’s picture

Here'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:

  • Using the Data module to define the local data storage.
    Use the Data Entity module to define entities / and entity relations - patch. I use Feeds to import the data.
  • Use Search API Location (Search API / Search API solr). Works seamlessly because we deal with entites.
  • Use Views and Views GeoJSON to query the Search API index and output the content as GeoJSON.
    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.

dasjo’s picture

afaik, views geojson should work fine if you just link it to the separately indexed latitude longitude fields

das-peter’s picture

Well I get notices, notices kill ajax.
So I had to fix it anyway - why not straight away integrate it? Or am I missing something?

pol’s picture

Status: Needs review » Fixed

Thanks das-peter ;)

  • Pol committed b690ac5 on 7.x-1.x authored by das-peter
    Issue #2364593 by das-peter: Added Support for Search API Indexes /...
das-peter’s picture

wow that was fast :) Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.