elasticsearch-query

How could I have MySQL IN clause within my elasticsearch query?

ぃ、小莉子 提交于 2019-12-02 10:25:27
I'm trying perform an elasticsearch query as a GET request in order pull data from the index which I created. The data which is in the index is, a table from MySQL DB, configured though logstash . Here is my request without the IN clause: http://localhost:9200/response_summary/_search?q=api:"location"+AND+transactionoperationstatus:"charged"+AND+operatorid='DIALOG'+AND+userid: test+AND+time:"2015-05-27 " In the above, I should be able to append AND responseCode IN (401,403) . I tried giving it a search on the web, but couldn't find any solutions. Any help could be appreaciated. Simply append

How to handle wildcards in elastic search structured queries

我是研究僧i 提交于 2019-12-02 09:02:09
My use case requires to query for our elastic search domain with trailing wildcards. I wanted to get your opinion on the best practices of handling such wildcards in the queries. Do you think adding the following clauses is a good practice for the queries: "query" : { "query_string" : { "query" : "attribute:postfix*", "analyze_wildcard" : true, "allow_leading_wildcard" : false, "use_dis_max" : false } } I've disallowed leading wildcards since it is a heavy operation. However I wanted to how good is analyzing wildcard for every query request in the long run. My understanding is, analyze

Edge NGram with phrase matching

☆樱花仙子☆ 提交于 2019-11-30 02:25:14
I need to autocomplete phrases . For example, when I search "dementia in alz" , I want to get "dementia in alzheimer's" . For this, I configured Edge NGram tokenizer . I tried both edge_ngram_analyzer and standard as the analyzer in the query body. Nevertheless, I can't get results when I'm trying to match a phrase. What am I doing wrong? My query: { "query":{ "multi_match":{ "query":"dementia in alz", "type":"phrase", "analyzer":"edge_ngram_analyzer", "fields":["_all"] } } } My mappings: ... "type" : { "_all" : { "analyzer" : "edge_ngram_analyzer", "search_analyzer" : "standard" },

Edge NGram with phrase matching

倾然丶 夕夏残阳落幕 提交于 2019-11-28 21:40:01
问题 I need to autocomplete phrases. For example, when I search "dementia in alz" , I want to get "dementia in alzheimer's" . For this, I configured Edge NGram tokenizer. I tried both edge_ngram_analyzer and standard as the analyzer in the query body. Nevertheless, I can't get results when I'm trying to match a phrase. What am I doing wrong? My query: { "query":{ "multi_match":{ "query":"dementia in alz", "type":"phrase", "analyzer":"edge_ngram_analyzer", "fields":["_all"] } } } My mappings: ...