You are here

README.txt in Search API Grouping 7.2

Same filename and directory in other branches
  1. 8 README.txt
== BACKGROUND ==

This module has following version specific dependencies:
- Search API version >= 7.x-1.6  
- Search API Solr >=7.x-1.0

This module creates a meta index for entities so that proper searching and
sorting multi-valued fields becomes possible. Solr does not allow sorting on
multi-value fields, further it can't handle the relations between two properties
of the same multi-value field.
As such this module does the necessary de-normalization by computing the
cartesian product of entity values for each possible combination of the selected
multi-valued fields. For instance let us say you have the following node content
type:

nid: 1
type: product
multifield1:
    item1,
    item2
multivaluemultifield2:
    featureX1 featureX2,
    featureY1 featureY2
singlefielda:
    widget

This module de-normalizes this node into the following search entries if you
choose to de-normalize on both multivalue fields:
  nid: 1
  type: product
  multifield1: item1
  multivaluemultifield2-value1: featureX1
  multivaluemultifield2-value2: featureX2
  singlefielda: widget

  nid: 1
  type: product
  multifield1: item1
  multivaluemultifield2-value1: featureY1
  multivaluemultifield2-value2: featureY2
  singlefielda: widget

  nid: 1
  type: product
  multifield1: item2
  multivaluemultifield2-value1: featureX1
  multivaluemultifield2-value2: featureX2
  singlefielda: widget

  nid: 1
  type: product
  multifield1: item2
  multivaluemultifield2-value1: featureY1
  multivaluemultifield2-value2: featureY2
  singlefielda: widget

Due to this denormalization we will now be able to sort on the previously multi-
valued columns. Further the connection between the both values of the
multivaluemultifield2 is maintained, enabling us to filter properly by those
values.

This module also provides the possibility to group the results returned from
solr on configured fields. To do so enabled the processor "Grouping" and
configured the fields to group on.

Related Links:
Solr sorting on multi-value field: https://issues.apache.org/jira/browse/SOLR-2339

"Grouping" feature
------------------------
This module defines the "Grouping" feature (feature key: "search_api_grouping")
that search service classes can implement. With a server supporting this, you
can use the „Grouping“ processor to group the search result based on fields.

For developers:
A service class that wants to support this feature has to check for a
"search_api_grouping" option in the search() method. When present, it will be an
array containing following keys:
- use_grouping:  If set to TRUE the grouping is used.
- fields: An array of fields to use for grouping.
- group_sort: An associative array of fields that define how to sort documents
              within a group. Direction can be "asc" or "desc".
              group_sort = array(
                field_foo => direction,
                field_bar => direction,
              )
- truncate: If true, facet counts are based on the most relevant result of each
            group matching the query.

The options are based on the Solr FieldCollapsing:
http://wiki.apache.org/solr/FieldCollapsing

== CONFIGURATION ==

After enabling the module visit 'admin/config/search/search_api' and add a new
index. This module creates an index type for each entity type covered by search
API. These are identified by the prefix 'Denormalized' so to use this index for
nodes create a new index of item type 'Denormalized Node'.
The fields to use de-normalization and / or grouping can be configured in the
"Workflow" tab of the index.

== KNOWN ISSUES ==

Creating or Enabling / Disabling an index leads to a full rebuild of the
denormalized item ids. This can take quite some time.

File

README.txt
View source
  1. == BACKGROUND ==
  2. This module has following version specific dependencies:
  3. - Search API version >= 7.x-1.6
  4. - Search API Solr >=7.x-1.0
  5. This module creates a meta index for entities so that proper searching and
  6. sorting multi-valued fields becomes possible. Solr does not allow sorting on
  7. multi-value fields, further it can't handle the relations between two properties
  8. of the same multi-value field.
  9. As such this module does the necessary de-normalization by computing the
  10. cartesian product of entity values for each possible combination of the selected
  11. multi-valued fields. For instance let us say you have the following node content
  12. type:
  13. nid: 1
  14. type: product
  15. multifield1:
  16. item1,
  17. item2
  18. multivaluemultifield2:
  19. featureX1 featureX2,
  20. featureY1 featureY2
  21. singlefielda:
  22. widget
  23. This module de-normalizes this node into the following search entries if you
  24. choose to de-normalize on both multivalue fields:
  25. nid: 1
  26. type: product
  27. multifield1: item1
  28. multivaluemultifield2-value1: featureX1
  29. multivaluemultifield2-value2: featureX2
  30. singlefielda: widget
  31. nid: 1
  32. type: product
  33. multifield1: item1
  34. multivaluemultifield2-value1: featureY1
  35. multivaluemultifield2-value2: featureY2
  36. singlefielda: widget
  37. nid: 1
  38. type: product
  39. multifield1: item2
  40. multivaluemultifield2-value1: featureX1
  41. multivaluemultifield2-value2: featureX2
  42. singlefielda: widget
  43. nid: 1
  44. type: product
  45. multifield1: item2
  46. multivaluemultifield2-value1: featureY1
  47. multivaluemultifield2-value2: featureY2
  48. singlefielda: widget
  49. Due to this denormalization we will now be able to sort on the previously multi-
  50. valued columns. Further the connection between the both values of the
  51. multivaluemultifield2 is maintained, enabling us to filter properly by those
  52. values.
  53. This module also provides the possibility to group the results returned from
  54. solr on configured fields. To do so enabled the processor "Grouping" and
  55. configured the fields to group on.
  56. Related Links:
  57. Solr sorting on multi-value field: https://issues.apache.org/jira/browse/SOLR-2339
  58. "Grouping" feature
  59. ------------------------
  60. This module defines the "Grouping" feature (feature key: "search_api_grouping")
  61. that search service classes can implement. With a server supporting this, you
  62. can use the „Grouping“ processor to group the search result based on fields.
  63. For developers:
  64. A service class that wants to support this feature has to check for a
  65. "search_api_grouping" option in the search() method. When present, it will be an
  66. array containing following keys:
  67. - use_grouping: If set to TRUE the grouping is used.
  68. - fields: An array of fields to use for grouping.
  69. - group_sort: An associative array of fields that define how to sort documents
  70. within a group. Direction can be "asc" or "desc".
  71. group_sort = array(
  72. field_foo => direction,
  73. field_bar => direction,
  74. )
  75. - truncate: If true, facet counts are based on the most relevant result of each
  76. group matching the query.
  77. The options are based on the Solr FieldCollapsing:
  78. http://wiki.apache.org/solr/FieldCollapsing
  79. == CONFIGURATION ==
  80. After enabling the module visit 'admin/config/search/search_api' and add a new
  81. index. This module creates an index type for each entity type covered by search
  82. API. These are identified by the prefix 'Denormalized' so to use this index for
  83. nodes create a new index of item type 'Denormalized Node'.
  84. The fields to use de-normalization and / or grouping can be configured in the
  85. "Workflow" tab of the index.
  86. == KNOWN ISSUES ==
  87. Creating or Enabling / Disabling an index leads to a full rebuild of the
  88. denormalized item ids. This can take quite some time.