As far as I can tell, the Search Display (ds_search) submodule is only compatible with the apachesolr project. It won't work with search_api + search_api_solr. Is this correct?
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 1368984-10-search_api_solr-support.patch | 1.06 KB | marty2081 |
| #7 | 1368984-7-search_api_solr-support.patch | 1.11 KB | marcvangend |
Comments
Comment #1
swentel commentedThat's right - Haven't found time to integrate that. IIRC, search api has search pages through which you can use the 'search result' view mode. So that should work fine. In case you need a couple of specific functionalities that ds search also provides, we'll have to work for a patch on that, although I can't promise a timeframe.
Comment #2
pfrenssenComment #3
mxwitkowski commentedI am very interested in using Search Display, so interested in this functionality as well.
How do you setup the comment from swentel in #1: search api has search pages through which you can use the 'search result' view mode. ? It would be great even if we can use the results page of Display Suite for Solr results via the Search API.
Comment #4
seanbWe are currently building a website for a client using Search API with an Apache Solr backend. We would love to see DS integration for Search API views. The DS fields row plugin is available for Search API views, but DS is not. Since Search API and Display suite are both modules that we want to use for future projects, it would be great to have them work together.
Is there a plan for adding this feature?
Comment #5
pfrenssen@seanB, for feature requests it is often the first person who really needs it who develops it and contributes it. Patches are always welcome!
Comment #6
marcvangendI would love to see this in Display Suite... I would like to help but don't really know where to start. Can someone point me in the right direction?
Comment #7
marcvangendHere is a first humble attempt to get search snippets from Search API Solr into the search_result view mode. This allows you to combine the power of Search API (for indexing and heavy lifting) and Display Suite (for rendering the search results).
To see the effect of this patch, make sure you enable the search snippet field on the "search result" view mode.
The patch works (for me) on a Search API Page (as in http://drupal.org/project/search_api_page) and in a view on a Search API search index. The view was built with the "Rendered entity" row plugin en configured to use the "Search result" view mode.
As far as I'm concerned, this patch isn't ready yet.
First of all, I don't really like the fact that ds_search_snippet() has to call search_api_current_search() to get information. It would be a bit nicer if the snippet was in the entity already.
Second, search_api_current_search() can return multiple current searches, but this patch assumes that there is only one current search. In case of multiple current searches, I don't know how the correct search_id should be determined.
Third, I would like a way to make the search snippet field fall back on the "Summary or trimmed" formatter of the body field in case there is no snippet. Such a situation can occur if you build a (facetted) search view which shows all search results when no search term has been given.
Looking forward to your reactions.
Comment #8
mattp52 commentedHi marcvangend,
I've implemented your patch against a Search API (7.x-1.3) + Solr Search (7.x-1.0-rc2) environment and cannot expose the Solr Excerpt (Snippet) in displays. I might be missing something with the config as I'm fairly unfamiliar with the Display Suite module. First question - do I need to define a Display Suite search to expose the field? The form page for doing that only shows the "Node" search option and doesn't display Solr. This is after applying your patch and clearing all caches. I assume ds_search needs to be configured for Solr in some way as this is where your patch applies but I note that ds_search.admin.inc contains the following code:
But the "search_info()" function doesn't appear to be implemented for the Solr Search module. Could you give a bit more background on the pre-requisites for setting up a Search API + Solr + Display Suite environment with your patched module?
Comment #8.0
mattp52 commentedAdded the Search Display submodule's full name for clarification.
Comment #9
BarisW commentedComment #10
marty2081 commentedThe above patch by BarisW is incorrect, because it will always return the snippet of the first item in the search results. I've hidden it from this thread and created a new patch. The earlier patch by marcvangend did not work in our case, because he was using the revision id instead of the primary entity id, while the search results array is keyed by the primary entity id. My patch uses the primary entity id.
Comment #11
j3ll3nlIt would be nicer to have this implemented into the function that build up the entity. Then we could put the snippet in $field['entity']->snippet so that ds_search is not touched.
Comment #12
askibinski commentedIn any case, patch at #10 works exactly as expected.