Skip to main content

Fulltext search

Submitted by rnsrk on

Prerequisites

Configuration

Add a view mode

Navigate to Manage Structure Display modes View modes and click + Add view mode. Choose Wisski Entity and enter a name for your fulltext-search-view-mode ... is your fulltext search rendered html output with a administrative name like  Fulltext view mode. .

Configure view mode for your WissKI entity

Go to Manage Structure WissKI Entities and Bundles. Choose your wisski-entity ... is an informational object about which information is to be stored or processed. The object can be material or immaterial, concrete or abstract, it is the type of objects or the classification of a group of things, i. e. Bobby (Gorilla gorilla) or Plesiosaurus dolichodeirus could both be individuals of the WissKI entity Specimen. , unfold the operations menu by clicking on the caret and select Manage display. Unfold Custom display settings at the buttom and check fulltext-search-view-mode ... is your fulltext search rendered html output with a administrative name like  Fulltext view mode. . Click Save.

Your fulltext-search-view-mode ... is your fulltext search rendered html output with a administrative name like  Fulltext view mode. will immediately appear as a tab on the top. Click on it. We will configure this view mode as a preview for the search results. Drag and drop the fields you want to display to the Field section, if you want to hide fields, drag and drop them to the Disabled section. You may want to change formatters, i. e. the image style to Wisski Preview Image Style. Click Save, when you are finished.

Example Screencast

Add fields to be indexed

Navigate to Manage Configuration Search API (Search and Metadata section), in the row of your solr-index ... where you configure the datasources, fields and processors of the things, you want to be searchable, has an administrative name like Specimen. , unfold the Operations menu by clicking on the caret and select Fields. Click + Add fields. Click Add just to the right of Rendered HTML output. Leave the User roles to Anonymous user, but as View mode for Wisski Entity, select your fulltext-search-view-mode ... is your fulltext search rendered html output with a administrative name like  Fulltext view mode. . Click Save.

Back at the Add fields to index pop up, click again Add just to the right of Rendered HTML output, but now select Default as View mode for Wisski Entity and click Save. Click Done at the Add fields to index pop up.

Alter the name of your default-rendered-html-output ... is the pre-rendered output of searchable fields, according to a the default view mode, should have a meaningful administrative name like Default rendered HTML output and a meaningful machine name like default_rendered_item. and fulltext-rendered-html-output ... is the pre-rendered output of searchable fields, according to a the fulltext view mode, should have a meaningful administrative name like Fulltext rendered HTML output and a meaningful machine name like fulltext_rendered_item. to something useful. Change the Type of both to Fulltext "ngram" and click Save changes.

Go to the View tab an click Index now.

Example Screencast

Create view for fulltext search

Go to Manage Structure Views and click + Add view. Choose a name for your view-for-fulltext-search ... is the view configuration for your Solr fulltext search, i. e. with a administrative name like Specimen fulltext. , under View settings select your solr-index ... where you configure the datasources, fields and processors of the things, you want to be searchable, has an administrative name like Specimen. next to Show:, check Create a page in section Page settings. You may want to alter the Page title and Path of the page. At Page display settings, change the Display format to Grid. Click Save and edit.

Configure view for fulltext search

On the configuration page of the view delete unnecessary fields by selecting Search: default-rendered-html-output ... is the pre-rendered output of searchable fields, according to a the default view mode, should have a meaningful administrative name like Default rendered HTML output and a meaningful machine name like default_rendered_item. (indexed field) in the Fields section and click Remove on the Configure field pop up.

Now add desired fields by clicking Add to the right of the Fields section. Check fulltext-rendered-html-output ... is the pre-rendered output of searchable fields, according to a the fulltext view mode, should have a meaningful administrative name like Fulltext rendered HTML output and a meaningful machine name like fulltext_rendered_item. and click Add and configure fields. On the Configure field pop up, check Use highlighted field data and click Apply.

Add the fulltext search field by clicking Add at the right of the Filter criteria section. Check Fulltext search (not default-rendered-html-output ... is the pre-rendered output of searchable fields, according to a the default view mode, should have a meaningful administrative name like Default rendered HTML output and a meaningful machine name like default_rendered_item. or fulltext-rendered-html-output ... is the pre-rendered output of searchable fields, according to a the fulltext view mode, should have a meaningful administrative name like Fulltext rendered HTML output and a meaningful machine name like fulltext_rendered_item. ) and click Add and configure filter criteria.

On the configuration filter criterion pop up, check this triggers an initial search and ensures that the full text view mode is displayed immediately). As Searched fields, choose your default-rendered-html-output ... is the pre-rendered output of searchable fields, according to a the default view mode, should have a meaningful administrative name like Default rendered HTML output and a meaningful machine name like default_rendered_item. . Hit Apply.

Now tweak your search performance: unfold the Advanced section with a click and click Settings next to Query settings. Check Skip item access checks and Bypass access checks and click Apply.

Disable Caching by clicking on Tag based, choose None on the Page: Caching pop up and hit Apply (this display).

Back at the configuration page of the view click Save.

Restart Indexing

At Manage Configuration Search API (Search and metadata section) click on your solr-index ... where you configure the datasources, fields and processors of the things, you want to be searchable, has an administrative name like Specimen. and reindex your WissKI entities with Index now.

Check results

In default state, you should see all your entities only with the fields you defined in your fulltext-search-view-mode ... is your fulltext search rendered html output with a administrative name like  Fulltext view mode. . You can enter a search term at the fulltext search field in the Preview section and hit Apply. You should see only the entities according to your search with fields defined at fulltext-search-view-mode ... is your fulltext search rendered html output with a administrative name like  Fulltext view mode. .

Example Screencast

Need help?

Write an email or join chat.wiss-ki.eu!