README.txt 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Search API autocomplete
  2. -----------------------
  3. Adds autocomplete capabilities for Search API searches.
  4. Information for users
  5. ---------------------
  6. - Necessary server feature
  7. The server on which the search will be executed has to support the
  8. "search_api_autocomplete" feature in order for autocompletion to work. Searches
  9. on other servers won't be affected by this module.
  10. Currently, only the Solr service class [1] is known to support this feature.
  11. [1] http://drupal.org/project/search_api_solr
  12. - Necessary setup
  13. After having installed and enabled the module, you have to do some
  14. administrative steps to activate the autocomplete functionality. Autocompletion
  15. can be enabled and configured for each search separately.
  16. To activate autocompletion for an index's searches, go to the index's
  17. „Autocomplete“ tab. There, you see all available searches for the index and can
  18. enable (and afterwards configure) autocompletion for each of them. All fulltext
  19. key fields on the searches should then become autocompletion fields.
  20. - Supported searches
  21. Currently, only search forms built by search pages or search views are
  22. supported directly. However, other modules can easily also use this
  23. functionality. See the "Information for developers" for details.
  24. - Caution! -
  25. If your view uses contextual filters, those can generally not be inferred in
  26. the autocompletion function which might lead to problems of different kinds,
  27. including display of confidential information (if such information would be
  28. available without contextual filters), wrong suggestions or complete absence
  29. of suggestions.
  30. Therefore, you should create another display without contextual filters, if
  31. necessary, and make sure that this doesn't lead to any leaks.
  32. If you want to fix this in a custom way for your site, take a look at
  33. example_search_api_query_alter() for suggestions.
  34. Information for developers
  35. --------------------------
  36. - Supporting autocompletion with a service class
  37. To support autocompletion with a service class, the class has to support the
  38. "search_api_autocomplete" feature. This will necessitate the service class to
  39. have a getAutocompleteSuggestions() method as detailed in the interface in
  40. search_api_autocomplete.interface.php.
  41. - Supporting autocompletion on a search form
  42. If you have a search form not generated by the Search views or Search pages
  43. modules, you can use hook_search_api_autocomplete_types() to tell this module
  44. about it. For details, see the hook documentation in the
  45. search_api_autocomplete.api.php file, or look at the existing implementations
  46. in search_api_autocomplete.search_api_page.inc and
  47. search_api_autocomplete.search_api_views.inc.