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

Token Filters #12

Open
AngelinDark opened this issue Dec 2, 2014 · 2 comments
Open

Token Filters #12

AngelinDark opened this issue Dec 2, 2014 · 2 comments

Comments

@AngelinDark
Copy link

Hi.
I need to use some token filter for the search function with accents, as described in the link text of the final.
Is it possible?
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-asciifolding-tokenfilter.html

Thank you for the work, has been very helpful to me.

@mmanos
Copy link
Owner

mmanos commented Dec 2, 2014

I've actually not had to work with token filters yet, so I'm not very familiar with them. Is this something you can accomplish with the Advanced Query Callbacks, perhaps?

@AngelinDark
Copy link
Author

I think not, researching a little more on the subject found that this would have to be configured in the settings or a template that would be inherited by all indices.

I think this would have to be specified in the package configuration file and or perhaps when the class is instantiated.

The best option I found was to create a template and make all indexes created inherit it, I used the following command to do this.

curl -XPUT 127.0.0.1:9200/_template/template_default -d '
{
    "template" : "*",
    "settings" : {
        "number_of_replicas":"1",
        "number_of_shards" : 5,
        "analysis" : {
            "analyzer" : {
                "default" : {
                    "tokenizer" : "standard",
                    "filter" : ["standard", "asciifolding", "mynGram"]
                }
            },
            "filter" : {
                "mynGram" : {
                    "type" : "nGram",
                    "min_gram" : 2,
                    "max_gram" : 20
                }
            }
        }
    }
}'

I do not know how much work it would, but it would be interesting to set this up in the future.

Thank you for your attention.

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

No branches or pull requests

2 participants