It seems to me that some users (for example, me) would be likely to create views that work well, then decide to add search api at a later date.
As I understand it, this means completely recreating views that might have had multiple relationships and many fields as new views with the search index as the starting point of the new views.
I think that it would be more intuitive to allow users to add a relationship to an existing view that would then allow the use of the search api index as a contextual filter without further changes to the existing view.
Is there a technical reason why this wouldn't be feasible?
Thanks. I believe the maintainer is on vacation, so please just answer when you get back or if anyone else has a thought about this, please jump in.
Comments
Comment #1
nick_vhCan you explain a bit more what you expect from Search API here? You'd want to have a search field that searches the index of the entity types, indexed by Search API, that you are searching in and then some processing so it shows the entities the way you expect them?
Interesting use case but I'm not sure if it's super easy to achieve that technically. Also, there are many options in Search API and some backends like solr do not always expect the return to be entities so that becomes hard in those situations.
In any case, I'm bumping this up to D8 and perhaps you can add some screenshots to make us understand better what you expect.
Comment #2
drunken monkeyYes, very much so. Of course, being able to just add Search API search to a view as an afterthought would be a great feature. It would also help with some/most of the problems of the Search API Views integration, which largely consists of missing functionality/options when using a search index as the basis for a view.
However, it's not really possible/feasible to do this technically, because internally, the data for "normal" database views (like normal views on "Content") and Search API views come from two different sources. It is therefore not possible to simply add a new filter to the views query for a search, like you would do when filtering normally.
The only way that I could think of is to internally run a search query in the filter and then use the resulting node NIDs (or, in general, entity IDs) to filter the views result manually. (This is actually the first approach I tried for this feature, way back in 2008: #254565-4: Integrate with Views front-end.) However, while this basically works (although it doesn't allow, e.g., for sorting by relevance), it performs very poorly and thus becomes quickly impractical for larger sites.
So, to summarize: If you want to have it, you are free to program such a filter (or pay someone to do it for you). It might even be popular if you publish it in a new module. But I'm pretty sure that, unless someone comes up with a cleaner, better peforming solution, nothing of the like will be integrated into the Search API itself.