README.txt 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. The Search ID of the „Facets blocks“
  49. display can easily be recognized by the "-facet_block" suffix.
  50. If you want to use only the normal facets and not display anything at all in
  51. the Views block, just activate the display's „Hide block“ option.
  52. Note: If you want to display the block not only on a few pages, you should in
  53. any case take care that it isn't displayed on the search page, since that might
  54. confuse users.
  55. FAQ: Why „*Indexed* Node“?
  56. --------------------------
  57. The group name used for the search result itself (in fields, filters, etc.) is
  58. prefixed with „Indexed“ in order to be distinguishable from fields on referenced
  59. nodes (or other entities). The data displayed normally still comes from the
  60. entity, not from the search index.