ruby - How do I search words seperated by _ and . in ElasticSearch? -


i new elasticsearch , happy speed @ moment. still have 1 requirement haven't been able achieve.

elasticsearch seems split following text when doing indexing:

"bmw.co.uk" "apple_macbook_pro" 

i searching in ruby using elasticsearch gem:

result = client.search index: 'elasticsearch_dev',                   body: {                       query: {                           "bool" => {                             "must" => {"match" => {"search_text" => {"query" => "bmw", "operator" => "and"}}},                             "must_not" => {"match" => {"search_text" => {"query" => "", "operator" => "or"}}}                           }                       },                   } 

what i'm trying achieve:

when search 'bmw' or 'bmw.co', want records bmw.co.uk match.

when search 'acboo' or 'apple', want records apple_macbook_pro match.

how go achieving this?

addtional info

i have looked @ site, along lines of looking do, not quite:

http://www.fullscale.co/blog/2013/03/04/preserving_specific_characters_during_tokenizing_in_elasticsearch.html.

if have url:

uk-on-sale.com 

i want tokenized as:

[uk, on, sale, com, uk-on, on-sale, uk-on-sale.com, on-sale.com, sale.com, .com] 

have tried "match_phrase" query ?


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -