README.txt 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. Search API Views integration
  2. ----------------------------
  3. This module integrates the Search API with the popular Views module [1],
  4. allowing users to create views with filters, arguments, sorts and fields based
  5. on any search index.
  6. [1] http://drupal.org/project/views
  7. "More like this" feature
  8. ------------------------
  9. This module defines the "More like this" feature (feature key: "search_api_mlt")
  10. that search service classes can implement. With a server supporting this, you
  11. can use the „More like this“ contextual filter to display a list of items
  12. related to a given item (usually, nodes similar to the node currently viewed).
  13. For developers:
  14. A service class that wants to support this feature has to check for a
  15. "search_api_mlt" option in the search() method. When present, it will be an
  16. array containing two keys:
  17. - id: The entity ID of the item to which related items should be searched.
  18. - fields: An array of indexed fields to use for testing the similarity of items.
  19. When these are present, the normal keywords should be ignored and the related
  20. items be returned as results instead. Sorting, filtering and range restriction
  21. should all work normally.
  22. "Facets block" display
  23. ----------------------
  24. Most features should be clear to users of Views. However, the module also
  25. provides a new display type, "Facets block", that might need some explanation.
  26. This display type is only available, if the „Search facets“ module is also
  27. enabled.
  28. The basic use of the block is to provide a list of links to the most popular
  29. filter terms (i.e., the ones with the most results) for a certain category. For
  30. example, you could provide a block listing the most popular authors, or taxonomy
  31. terms, linking to searches for those, to provide some kind of landing page.
  32. Please note that, due to limitations in Views, this display mode is shown for
  33. views of all base tables, even though it only works for views based on Search
  34. API indexes. For views of other base tables, this will just print an error
  35. message.
  36. The display will also always ignore the view's "Style" setting, selected fields
  37. and sorts, etc.
  38. To use the display, specify the base path of the search you want to link to
  39. (this enables you to also link to searches that aren't based on Views) and the
  40. facet field to use (any indexed field can be used here, there needn't be a facet
  41. defined for it). You'll then have the block available in the blocks
  42. administration and can enable and move it at leisure.
  43. Note, however, that the facet in question has to be enabled for the search page
  44. linked to for the filter to have an effect.
  45. Since the block will trigger a search on pages where it is set to appear, you
  46. can also enable additional „normal“ facet blocks for that search, via the
  47. „Facets“ tab for the index. They will automatically also point to the same
  48. search that you specified for the display.
  49. If you want to use only the normal facets and not display anything at all in
  50. the Views block, just activate the display's „Hide block“ option.
  51. Note: If you want to display the block not only on a few pages, you should in
  52. any case take care that it isn't displayed on the search page, since that might
  53. confuse users.
  54. Access features
  55. ---------------
  56. Search views created with this module contain two query settings (located in
  57. the "Advanced" fieldset) which let you control the access checks executed for
  58. search results displayed in the view.
  59. - Bypass access checks
  60. This option allows you to deactivate access filters that would otherwise be
  61. added to the search, if the index supports this. This is, for instance, the case
  62. for indexes on the "Node" item type, when the "Node access" data alteration is
  63. activated.
  64. Use this either to slightly speed up searches where additional checks are
  65. unnecessary (e.g., because you already filter on "Node: Published") and there is
  66. no other node access mechanism on your site) or to show certain data that users
  67. normally wouldn't have access to (e.g., a list of all matching node titles,
  68. published or not).
  69. - Additional access checks on result entities
  70. When this option is activated, all result entities will be passed to an
  71. additional access check, even if search-time access checks are available for
  72. this index. The advantage is that access rules are guaranteed to be enforced –
  73. stale data in the index, which might make other access checks incorrect, won't
  74. influence this access check. You can also use it for item types for which no
  75. other access mechanisms are available.
  76. However, note that results filtered out this way will mess up paging, result
  77. counts and possibly other things too (like facet counts), as the result row is
  78. only hidden from display after the search has been executed. Where possible,
  79. you should therefore only use this in combination with appropriate filter
  80. settings ensuring that only when the index isn't up-to-date items will be
  81. filtered out this way.
  82. This option is only available for indexes on entity types.
  83. Other features
  84. --------------
  85. - Change parse mode
  86. You can determine how search keys entered by the user will be parsed by going to
  87. "Advanced" > "Query settings" within your View's settings. "Direct" can be
  88. useful, e.g., when you want to give users the full power of Solr. In other
  89. cases, "Multiple terms" is usually what you want / what users expect.
  90. Caution: For letting users use fulltext searches, always use the "Search:
  91. Fulltext search" filter or contextual filter – using a normal filter on a
  92. fulltext field won't parse the search keys, which means multiple words will only
  93. be found when they appear as that exact phrase.
  94. FAQ: Why „*Indexed* Node“?
  95. --------------------------
  96. The group name used for the search result itself (in fields, filters, etc.) is
  97. prefixed with „Indexed“ in order to be distinguishable from fields on referenced
  98. nodes (or other entities). The data displayed normally still comes from the
  99. entity, not from the search index.