Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search_analyzer definitions in index settings to allow for dynamic updates to query-time analyzers #28877

Closed
osman opened this issue Mar 1, 2018 · 5 comments
Labels
>enhancement :Search Relevance/Analysis How text is split into tokens Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch

Comments

@osman
Copy link

osman commented Mar 1, 2018

something like this:

PUT /test_index
{
    "settings": {
        "index" : {
            "analysis" : {
                "filter" : {
                    "synonym" : {
                        "type" : "synonym", 
                       "synonyms" : [
                            "i-pod, i pod => ipod",
                            "universe, cosmos"
                        ]
                    }
                },
                "search_analyzer" : {
                    "synonym" : {
                        "tokenizer" : "whitespace",
                        "filter" : ["synonym"] 
                    }
                }
            }
        }
    }
}

This denotes the analyzer as one that is only used at search time, and is thus safe to update dynamically. My use-case is dynamically updating synonyms without having the open/close the index. But I imagine there are other useful properties to being able to dynamically update analyzers used only at query time.

@osman osman changed the title Support search_analyzer definitions in index settings search_analyzer definitions in index settings Mar 1, 2018
@osman osman changed the title search_analyzer definitions in index settings search_analyzer definitions in index settings to allow for dynamic updates to query-time analyzers Mar 1, 2018
@rjernst
Copy link
Member

rjernst commented Mar 1, 2018

The search_analyzer setting used within mappings is just the name of an analyzer. Can you elaborate on the problem with using the existing analyzer specification within analysis?

@rjernst rjernst added the :Search Relevance/Analysis How text is split into tokens label Mar 1, 2018
@rjernst
Copy link
Member

rjernst commented Mar 1, 2018

/cc @elastic/es-search-aggs

@colings86
Copy link
Contributor

@osman being able to update search analyzers (specifically being able to update the synonyms in a synonym token filter only used at search time) is something we are actively thinking about. However it is not so straight-forward since a token filter can be used by any analyzer and any analyzer can be used as either an "analyzer" or "search_analyzer" in the mappings. This means that determining if a synonym list can be updated would currently require going through all the analysis settings and mappings which is not a great solution. We have spoken about denoting token filter definitions as "search only" but there is more thinking to be done around how this actually plays out when validating analyzer settings and mappings and when trying to update the synonym list

@rjernst rjernst added the Team:Search Meta label for search team label May 4, 2020
@elasticsearchmachine
Copy link
Collaborator

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

@mayya-sharipova
Copy link
Contributor

Closing this issue as implemented.

Synonym filters can be updateable with property: "updateable": true and file based synonyms can be reloaded.

Alternatively Synonyms Management API can be used to manage synonyms in an internal system index.

@javanna javanna added Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch and removed Team:Search Meta label for search team labels Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search Relevance/Analysis How text is split into tokens Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

6 participants