README.txt 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. Solr search
  2. -----------
  3. This module provides an implementation of the Search API which uses an Apache
  4. Solr search server for indexing and searching. Before enabling or using this
  5. module, you'll have to follow the instructions given in INSTALL.txt first.
  6. Supported optional features
  7. ---------------------------
  8. All Search API datatypes are supported by using appropriate Solr datatypes for
  9. indexing them. By default, "String"/"URI" and "Integer"/"Duration" are defined
  10. equivalently. However, through manual configuration of the used schema.xml this
  11. can be changed arbitrarily. Using your own Solr extensions is thereby also
  12. possible.
  13. The "direct" parse mode for queries will result in the keys being directly used
  14. as the query to Solr. For details about Lucene's query syntax, see [1]. There
  15. are also some Solr additions to this, listed at [2]. Note however that, by
  16. default, this module uses the dismax query handler, so searches like
  17. "field:value" won't work with the "direct" mode.
  18. [1] http://lucene.apache.org/java/2_9_1/queryparsersyntax.html
  19. [2] http://wiki.apache.org/solr/SolrQuerySyntax
  20. Regarding third-party features, the following are supported:
  21. - search_api_autocomplete
  22. Introduced by module: search_api_autocomplete
  23. Lets you add autocompletion capabilities to search forms on the site. (See
  24. also "Hidden variables" below for Solr-specific customization.)
  25. - search_api_facets
  26. Introduced by module: search_api_facetapi
  27. Allows you to create facetted searches for dynamically filtering search
  28. results.
  29. - search_api_facets_operator_or
  30. Introduced by module: search_api_facetapi
  31. Allows the creation of OR facets.
  32. - search_api_mlt
  33. Introduced by module: search_api_views
  34. Lets you display items that are similar to a given one. Use, e.g., to create
  35. a "More like this" block for node pages.
  36. - search_api_multi
  37. Introduced by module: search_api_multi
  38. Allows you to search multiple indexes at once, as long as they are on the same
  39. server. You can use this to let users simultaneously search all content on the
  40. site – nodes, comments, user profiles, etc.
  41. - search_api_spellcheck
  42. Introduced by module: search_api_spellcheck
  43. Gives the option to display automatic spellchecking for searches.
  44. If you feel some service option is missing, or have other ideas for improving
  45. this implementation, please file a feature request in the project's issue queue,
  46. at [3].
  47. [3] http://drupal.org/project/issues/search_api_solr
  48. Specifics
  49. ---------
  50. Please consider that, since Solr handles tokenizing, stemming and other
  51. preprocessing tasks, activating any preprocessors in a search index' settings is
  52. usually not needed or even cumbersome. If you are adding an index to a Solr
  53. server you should therefore then disable all processors which handle such
  54. classic preprocessing tasks.
  55. Also, due to the way Solr works, using a single field for fulltext searching
  56. will result in the smallest index size and best search performance, as well as
  57. possibly having other advantages, too. Therefore, if you don't need to search
  58. different sets of fields in different searches on an index, it is adviced that
  59. you collect all fields that should be searchable into a single field using the
  60. “Aggregated fields” data alteration.
  61. Hidden variables
  62. ----------------
  63. - search_api_solr_autocomplete_max_occurrences (default: 0.9)
  64. By default, keywords that occur in more than 90% of results are ignored for
  65. autocomplete suggestions. This setting lets you modify that behaviour by
  66. providing your own ratio. Use 1 or greater to use all suggestions.
  67. Customizing your Solr server
  68. ----------------------------
  69. The schema.xml and solrconfig.xml files contain extensive comments on how to
  70. add additional features or modify behaviour, e.g., for adding a language-
  71. specific stemmer or a stopword list.
  72. If you are interested in further customizing your Solr server to your needs,
  73. see the Solr wiki at [4] for documentation. When editing the schema.xml and
  74. solrconfig.xml files, please only edit the copies in the Solr configuration
  75. directory, not directly the ones provided with this module.
  76. [4] http://wiki.apache.org/solr/
  77. You'll have to restart your Solr server after making such changes, for them to
  78. take effect.
  79. Developers
  80. ----------
  81. The SearchApiSolrService class has a few custom extensions, documented with its
  82. code. Methods of note are deleteItems(), which treats the first argument
  83. differently in certain cases, and the methods at the end of service.inc.