Skip to content

Fix caching for PreConfiguredTokenFilter (#50912)#51091

Merged
matriv merged 1 commit intoelastic:7.xfrom
matriv:backport-fix-50734
Jan 16, 2020
Merged

Fix caching for PreConfiguredTokenFilter (#50912)#51091
matriv merged 1 commit intoelastic:7.xfrom
matriv:backport-fix-50734

Conversation

@matriv
Copy link
Copy Markdown
Contributor

@matriv matriv commented Jan 16, 2020

The PreConfiguredTokenFilter#singletonWithVersion uses the version
internaly for the token filter factories but it registers only one
instance in the cahce and not one instance per version. This can lead
to exceptions like the one described in #50734 since the singleton is
created and cached using the version created of the first index
that is processed.

Remove the singletonWithVersion() methods and use the
elasticsearchVersion() methods instead.

Fixes: #50734
(cherry picked from commit 24e1858)

@matriv matriv added >bug :Search Relevance/Analysis How text is split into tokens backport labels Jan 16, 2020
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search (:Search/Analysis)

The PreConfiguredTokenFilter#singletonWithVersion uses the version
internaly for the token filter factories but it registers only one
instance in the cahce and not one instance per version. This can lead
to exceptions like the one described in elastic#50734 since the singleton is
created and cached using the version created of the first index
that is processed.

Remove the singletonWithVersion() methods and use the
elasticsearchVersion() methods instead.

Fixes: elastic#50734
(cherry picked from commit 24e1858)
@matriv matriv force-pushed the backport-fix-50734 branch from 5b1711a to e9f9ee7 Compare January 16, 2020 11:43
@matriv matriv added the v7.7.0 label Jan 16, 2020
@matriv matriv merged commit fda25ed into elastic:7.x Jan 16, 2020
@matriv matriv deleted the backport-fix-50734 branch January 16, 2020 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants