Dynamic Analyzer in Search

(Rubén Recacha) #1


I have a custom analyzer ( custom_asciifolding is "mapping" type => ["á=>a", "é=>e" ... etc] ):

... "analyzer": {
"standard_custom": {
"type": "custom",
"char_filter": ["custom_asciifolding"],
"filter": ["lowercase"],
"tokenizer": "standard"
} ...

I have a contact register indexed with name property (value: Rubén Recacha)

When I put analyzer parameter in query string, does not work correctly:

"query": {
"query_string": {
"query": "ruben",
"analyzer": "standard_custom"

==> 0 results

"query": {
"query_string": {
"query": "rubén",
"analyzer": "standard_custom"

==> 1 results

It is a bug?

How I could to do a query changing the analyzer dynamically?

Thank you very much,

Best Regards,
Rubén Recacha.

(David Pilato) #2

I did answer there already: https://github.com/elastic/elasticsearch/issues/15818

(Rubén Recacha) #3

Hi @dadoonet, I use query without "*" (wildcard char) in this post.

Thanks for your help, but I want select analyzer dynamically in that search and with "analyzer" parameter it not works.

(David Pilato) #4

Ha sorry. I missed that.

Just a comment, be very careful with the client you are using. It needs to send UTF-8 requests. If your character é is not encoded in UTF-8, that won't work.

Some clients (in browser) typically sends something else than UTF-8 (depending on your setup).

It sometimes better to test it from the command line (using curl for example).

(system) #5