Remove 'decedent' from README.
88
README.md
|
|
@ -294,29 +294,39 @@ You can enable Extended Dismax search on this module's configuration page at
|
||||||
`admin/config/islandora/advanced_search`. This will affect all Advanced Search
|
`admin/config/islandora/advanced_search`. This will affect all Advanced Search
|
||||||
and Search blocks provided by this module.
|
and Search blocks provided by this module.
|
||||||
|
|
||||||
|
## Configure Search Fields for Collection Search
|
||||||
|
|
||||||
## Configure Collection Search
|
|
||||||
|
|
||||||
See "Requirements" for a discussion of the use of `field_member_of`.
|
See "Requirements" for a discussion of the use of `field_member_of`.
|
||||||
|
|
||||||
To support collection based searches you need to index the `field_member_of` for
|
In this section we set up fields in our Solr index (using Search API)
|
||||||
every node as well define a new Search API field that captures the full
|
that index a node's parent ("Member of") and all its parents' parents,
|
||||||
hierarchy of `field_member_of` for each repository item.
|
recursively ("Descendant of"), the latter achieved by using Search API's
|
||||||
|
"Index hierarchy" processor.
|
||||||
|
|
||||||
Add a new `Content` Search API field `field_decedent_of` to the index at
|
First ensure that your hierarchy field (assumed for convenience to be `field_member_of`)
|
||||||
`admin/config/search/search-api/index/[your default index]/fields`.
|
is indexed at `admin/config/search/search-api/index/[your default index]/fields`.
|
||||||
|
We will assume that the Search API field's name is "Member of". The field type
|
||||||
|
should be "Integer".
|
||||||
|
|
||||||

|
Next, create a second Search API field, based on the same Drupal field. We'll
|
||||||
|
call this one "Descendant of". It is also an Integer.
|
||||||
|
|
||||||
Then under `admin/config/search/search-api/index/[your default index]/processors`
|
|
||||||
enable `Index hierarchy` and setup the new field to index the hierarchy.
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|
Then, under the Processors tab (`admin/config/search/search-api/index/[your default index]/processors`)
|
||||||
|
enable the checkbox for `Index hierarchy` and at the bottom of the page, setup the processor
|
||||||
|
to index hierarchy for "Descendant of" (but not "Member of").
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
This "Descendant of" field now contains a list of all its ancestors, so can
|
||||||
|
be used as a contextual filter on views, thereby allowing the view to display all
|
||||||
|
descendants of a given node.
|
||||||
|
|
||||||
The field can now be used limit a search to all the decedents of a given object.
|
|
||||||
See the section below, "Collection search", to finish configuring your site
|
See the section below, "Collection search", to finish configuring your site
|
||||||
for collection and sub-collection search.
|
for collection and sub-collection search.
|
||||||
|
|
||||||
|
|
@ -324,16 +334,16 @@ for collection and sub-collection search.
|
||||||
|
|
||||||
## Configure Views
|
## Configure Views
|
||||||
|
|
||||||
Create a Search API view that uses your index.
|
Detailed instruction on the configuration of views is outside of the scope of this document.
|
||||||
|
Please read the [Drupal Documentation](https://www.drupal.org/docs/8/core/modules/views), as
|
||||||
The configuration of views is outside of the scope of this document, please read
|
|
||||||
the [Drupal Documentation](https://www.drupal.org/docs/8/core/modules/views), as
|
|
||||||
well as the
|
well as the
|
||||||
[Search API Documentation](https://www.drupal.org/docs/contributed-modules/search-api).
|
[Search API Documentation](https://www.drupal.org/docs/contributed-modules/search-api).
|
||||||
|
|
||||||
However, do NOT add the "Fulltext search" filter, despite that it is the "usual" way of
|
To use the Advanced Search module, you will need to create at least one view that
|
||||||
setting up a Search view. All fulltext searching (and fielded searching) will
|
is based on Search API and uses Solr. However, do NOT add the "Fulltext search"
|
||||||
be handled by blocks provided by this module.
|
filter, despite that being the "usual" way of setting up a Search view. All
|
||||||
|
fulltext searching (and fielded searching) will be handled by blocks provided
|
||||||
|
by this module.
|
||||||
|
|
||||||
### Exposed Form
|
### Exposed Form
|
||||||
|
|
||||||
|
|
@ -348,7 +358,7 @@ The Advanced Search Block requires that if present the Exposed forms
|
||||||
`Input Required` will prevent any search from occurring unless the user puts an
|
`Input Required` will prevent any search from occurring unless the user puts an
|
||||||
additional query in the Exposed form as well.
|
additional query in the Exposed form as well.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Collection Search
|
### Collection Search
|
||||||
|
|
||||||
|
|
@ -357,24 +367,27 @@ This module's "Advanced Search" block can be set up on a
|
||||||
that can contain other entities). This block allows the user
|
that can contain other entities). This block allows the user
|
||||||
to select whether they want the search to include sub-collections.
|
to select whether they want the search to include sub-collections.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The following instructions describe how to set up this feature.
|
The following instructions describe how to set up this feature.
|
||||||
|
|
||||||

|
First, in your Search API view, set up **two** contextual filters:
|
||||||
|
|
||||||
Here a relationship is setup with `Member Of` field and we have **two**
|
1. "Member of" (Direct descendants only)
|
||||||
contextual filters:
|
2. "Descendant of" (All descendants)
|
||||||
|
|
||||||
1. `field_member_of` (Direct decedents of the Entity)
|
|
||||||
2. `field_decedent_of` (All decedents of the Entity)
|
|
||||||
|
|
||||||
Both of these filters are configured the exact same way.
|

|
||||||
|
|
||||||

|
Both of these filters are configured the exact same way. The only configuration
|
||||||
|
to set is "When the filter value is NOT available" then "Provide default value".
|
||||||
|
Under Type, select "Content ID from URL".
|
||||||
|
|
||||||
These filters are toggled by the Advanced Search block to allow the search to
|

|
||||||
include all decedents or just direct decedents (*documented below*).
|
|
||||||
|
These two contextual filters are used by the Advanced Search block to
|
||||||
|
expose the toggle to search direct descendants or all descendants
|
||||||
|
(documented under "Advanced Search Block", below).
|
||||||
|
|
||||||
### Paging
|
### Paging
|
||||||
|
|
||||||
|
|
@ -481,12 +494,13 @@ the models you want to display the search on, e.g:
|
||||||
|
|
||||||
### Advanced Search Block
|
### Advanced Search Block
|
||||||
|
|
||||||
For any valid search field, you can drag / drop and reorder the fields to
|
For any valid Search API field, you can drag / drop and reorder the fields to
|
||||||
display in the advanced search form on. The configuration resides on the block
|
display in the advanced search form on. The configuration resides on the block
|
||||||
so this can differ across views / displays if need be. Additionally if the View
|
so this can differ across views / displays if need be.
|
||||||
the block was derived from has multiple contextual filters you can choose which
|
|
||||||
one corresponds to direct children, this will enable the recursive search
|
If the view this block is attached to has *two* exposed filters, then you can
|
||||||
checkbox.
|
choose which one corresponds to direct descendants. This will enable the
|
||||||
|
"Include Sub-Collections" search checkbox on the Advanced Search block.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 327 KiB |
BIN
docs/basic-exposed-form.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 188 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
BIN
docs/field_descendant_of.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 54 KiB |