Skip to content

Ported over the maybe_change_filter_position() in Synonyms from the 10up ElasticPress codebase#230

Open
petenelson wants to merge 1 commit intoAutomattic:developfrom
petenelson:fix/synonym-filter-order
Open

Ported over the maybe_change_filter_position() in Synonyms from the 10up ElasticPress codebase#230
petenelson wants to merge 1 commit intoAutomattic:developfrom
petenelson:fix/synonym-filter-order

Conversation

@petenelson
Copy link
Copy Markdown

Description

The ep_synonyms_filter in the index settings is being added first before the lowercase filter, causing case-sensitive matching to applied to synonyms. Using the _settings endpoint on the ES index is showing this:

"default": {
	"filter": [
		"ep_synonyms_filter",
		"lowercase",
		"stop",
		"ewp_snowball"
	],

when it should be showing this

"default": {
	"filter": [
		"lowercase",
		"ep_synonyms_filter",
		"stop",
		"ewp_snowball"
	],

This has been fixed in the 10up ElasticPress codebase. https://github.com/10up/ElasticPress/blob/develop/includes/classes/Feature/Search/Synonyms.php#L895

Checklist

Please make sure the items below have been covered before requesting a review:

  • This change works and has been tested locally (or has an appropriate fallback).
  • This change works and has been tested on a Go sandbox.
  • This change has relevant unit tests (if applicable).
  • This change has relevant documentation additions / updates (if applicable).
  • This change has the fix PRed upstream (if applicable). If not applicable, it has the relevant "// VIP: reason for the discrepancy with upstream" comment in places where the code is discrepant.

Steps to Test

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant