1

The apache solr autocomplete module don't work for me.
I try to achive a relative complex autocomplete,
my target is to achive this on the autocomplete:

Search for "searchword":
-Facet for type/bundle
-Facets based on the results
Show all results for "searchword"

As example:
Search for "test":
Download (176)
Systems (100)
News (20)
Services (5)
Systems
System 1
System n
Services
Service 1
Service n
Show all results for "test"

Any suggestions how I could get this?

Edit: I use apache solr search for this so no search api hook here
(miss some functions in the search api based)

2 Answers 2

1

You can try to write your own query according to results you want to get. below link may help you in this.

https://www.drupal.org/node/2203775

3
  • already thought about a own module, but no search api in this system (see edit).
    – Nugorra
    May 28, 2015 at 9:27
  • well, you can write your own custom module. That module will alter the query which is working for default autocomplete feature. To add more filter you can use the below code:try { $solr = apachesolr_get_solr(); $params = array( 'rows' => $count_limit, 'sort' => 'created desc', 'qt' => 'standard', 'wt' => 'standard', ); } catch (Exception $e) { watchdog('module name', 'apachesolr: ' . nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); return NULL; } May 28, 2015 at 10:32
  • Also you can use:$response = $solr->search($query, $params); //dpm($response); to perform the search.Also there is a function that can be used is :$query->add_filter(); May 28, 2015 at 10:36
0

Found the Module Search Autocomplete will work on this base. So I just need to add a top Layer for the facet and group the results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.