Problem/Motivation

Using certain Search API index processors are not working on proper way. Certain processors are e.g. Stemmer, Stopwords.

Steps to reproduce

1. Create a node with title talking
2. Create new Search API (Elasticsearch) index using content as datasource.
3. Add title field on index fields. /admin/config/search/search-api/index/INDEX_NAME/fields
4. Add Tokenizer and Stemmer processors. Make sure Tokenizer is before Stemmer. /admin/config/search/search-api/index/INDEX_NAME/processors
5. Clear the index and Index the content on /admin/config/search/search-api/index/INDEX_NAME
6. On Elasticsearch the title field is stored as talk not talking.

Proposed resolution

Many possible resolutions:
1. Use native Elasticsearch stemmer filters/analyzers. https://www.drupal.org/project/search_api_elasticsearch_synonym and https://www.drupal.org/project/elasticsearch_connector_autocomp use EventSubscriberInterface to properly utilize analyzers.
2. Document that Search API Stemmer and Stopwords do not work as expected when using Elasticsearch.
3. Disable Stemmer checkbox on Elasticsearch based indexes on /admin/config/search/search-api/index/INDEX_NAME/processors.

Remaining tasks

1. Decide best approach.
2. Implement solution.

User interface changes

-

API changes

-

Data model changes

-

CommentFileSizeAuthor
#3 3180440-3.patch749 bytessokru
#2 3180440-2.patch1.21 KBsokru

Comments

sokru created an issue. See original summary.

sokru’s picture

Status: Active » Needs review
StatusFileSize
new1.21 KB

Chose the easiest solution and used form_alter to add warning texts. This warning applies to all indexes, not only which backend is Elasticsearch.

sokru’s picture

StatusFileSize
new749 bytes

Actually getDiscouragedProcessors() seems to be the proper way to implement this. search_api_solr> and https://github.com/pySilver/elasticsearch_connector use same function.

yonailo’s picture

Would not it be more useful to try to make work the processors proposed by Search API ? Is that a very difficult thing to achieve ?

  • sokru committed 3e255d66 on 8.x-7.x
    Issue #3180440 by sokru: Search API process index not using native...
sokru’s picture

Status: Needs review » Fixed

Committed the getDiscouragedProcessors approach, if anyone wants to create feature using native Elasticsearch filters please create a separate issue(s) and I might be able to review them.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.