You are here

README.txt in Search API Spellcheck 7

Same filename and directory in other branches
  1. 8 README.txt
Search API Spellcheck
---------------------

This module extends Search API [1] to allow search services which can generate
spelling suggestions to do so and provide a common way for them to be
altered and themed. 

[1] http://drupal.org/project/search_api

Content:
 - Glossary
 - Information for users
 - Information for search service developers


Glossary
--------

Terms as used in this module.

- Search service:
  A search engine integrated with Search API such as Solr [1] or Xapian [2].
  [1] http://drupal.org/project/search_api_solr
  [2] http://drupal.org/project/xapian
- Suggestion class:
  A pair or words, the first being the original and the second a suggested
  alternative.
- Suggestion link class:
  An extension to a Suggestion class which also provides a HTML link and URL
  which can be used by a themer to create links to search results for a
  suggestion.
- Views:
  Views [1] is a Drupal module for displaying lists. Within the context of this
  module it will be referring to Search API Views. 

[1] http://drupal.org/project/views


Information for users
---------------------

Search API will support a growing number of search services and not all will
support spelling suggestions or may not have integrated with this module yet.

If your search service has got integration then you can add a Spellcheck field
to your Views header or footer. Which will then display spelling suggestions
if they have been returned by the service.


Information for search service developers
-----------------------------------------

There are two steps to integrate a search service with Search API Spellcheck.

 | 1
 | Update your servuice class' supportsFeature() method to return TRUE to
 | 'search_api_spellcheck'. Once this is set the new Views spellcheck field will
 | be available on any indexes for your service.

 | 2
 | In your service class' search() method, check whether the
 | 'search_api_spellcheck' key is set in $options, and contains TRUE. If it
 | does, include another key 'search_api_spellcheck' with a value of type
 | SearchApiSpellcheckInterface in the results returned from this method.
 |
 | Your class implenting SearchApiSpellcheckInterface must simply implement
 | suggestionString($string) and return an improved string or FALSE.
 |
 | Your class can have whatever constructor is most suitable for dealing with 
 | your spelling suggestions for example an array property or details to access
 | another web service.

File

README.txt
View source
  1. Search API Spellcheck
  2. ---------------------
  3. This module extends Search API [1] to allow search services which can generate
  4. spelling suggestions to do so and provide a common way for them to be
  5. altered and themed.
  6. [1] http://drupal.org/project/search_api
  7. Content:
  8. - Glossary
  9. - Information for users
  10. - Information for search service developers
  11. Glossary
  12. --------
  13. Terms as used in this module.
  14. - Search service:
  15. A search engine integrated with Search API such as Solr [1] or Xapian [2].
  16. [1] http://drupal.org/project/search_api_solr
  17. [2] http://drupal.org/project/xapian
  18. - Suggestion class:
  19. A pair or words, the first being the original and the second a suggested
  20. alternative.
  21. - Suggestion link class:
  22. An extension to a Suggestion class which also provides a HTML link and URL
  23. which can be used by a themer to create links to search results for a
  24. suggestion.
  25. - Views:
  26. Views [1] is a Drupal module for displaying lists. Within the context of this
  27. module it will be referring to Search API Views.
  28. [1] http://drupal.org/project/views
  29. Information for users
  30. ---------------------
  31. Search API will support a growing number of search services and not all will
  32. support spelling suggestions or may not have integrated with this module yet.
  33. If your search service has got integration then you can add a Spellcheck field
  34. to your Views header or footer. Which will then display spelling suggestions
  35. if they have been returned by the service.
  36. Information for search service developers
  37. -----------------------------------------
  38. There are two steps to integrate a search service with Search API Spellcheck.
  39. | 1
  40. | Update your servuice class' supportsFeature() method to return TRUE to
  41. | 'search_api_spellcheck'. Once this is set the new Views spellcheck field will
  42. | be available on any indexes for your service.
  43. | 2
  44. | In your service class' search() method, check whether the
  45. | 'search_api_spellcheck' key is set in $options, and contains TRUE. If it
  46. | does, include another key 'search_api_spellcheck' with a value of type
  47. | SearchApiSpellcheckInterface in the results returned from this method.
  48. |
  49. | Your class implenting SearchApiSpellcheckInterface must simply implement
  50. | suggestionString($string) and return an improved string or FALSE.
  51. |
  52. | Your class can have whatever constructor is most suitable for dealing with
  53. | your spelling suggestions for example an array property or details to access
  54. | another web service.