Skip to content

Create default_search analyzer while setting up synonyms #2877

Closed
@felipeelia

Description

Is your enhancement related to a problem? Please describe.

Currently, ElasticPress has only a default analyzer used on both index and search time. That is usually not a problem but when we add the Synonym's token filter here we end up having word_delimiter_graph and synonym_graph being applied at the same time.

As that is not fully supported, we eventually get a [illegal_argument_exception] startOffset must be non-negative, and endOffset must be >= startOffset, and offsets must not go backwards startOffset=??,endOffset=??,lastStartOffset=?? for field '??' error like seen in #2838.

Describe the solution you'd like

As we don't index everything after saving synonyms, we could apply the synonym_graph only during search time. Having word_delimiter_graph applied only during index time should not be a problem as well.

To have that happen, we need to create a default_search analyzer during the synonyms setup instead of simply adding synonym_graph to the default one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions