elasticsearch-6

Elastic Search Query for Distinct Nested Values

好久不见. 提交于 2021-02-11 14:32:34
问题 I am using the High Level REST Client for Elastic Search 6.2.2. Suppose that I have two documents in index "DOCUMENTS" with type "DOCUMENTS" that are { "_id": 1, "Name": "John", "FunFacts": { "FavColor": "Green", "Age": 32 } }, { "_id": 2, "Name": "Amy", "FunFacts": { "FavFood": "Pizza", "Age": 33 } } I want to find out all of the distinct fun facts and their distinct values, ultimately returning an end result of { "FavColor": ["Green"], "Age": [32, 33], "FavFood": ["Pizza"] } It is ok for

Set default value to elasticsearch index.max_inner_result_window parameter

喜你入骨 提交于 2021-01-29 18:11:40
问题 I'm actually using elasticsearch 6.7 and I get an error while searching in ES : Top hits result window is too large, the top hits aggregator [instances]'s from + size must be less than or equal to: [100] but was [2147483647]. This limit can be set by changing the [index.max_inner_result_window] index level setting. I know how to change this parameter, this is not the issue. I actually use this to change the parameter on existing indexes: PUT _all/_settings { "index.max_inner_result_window":

ElasticSearch group by documents field and count occurences

可紊 提交于 2020-01-25 06:53:27
问题 My ElasticSearch 6.5.2 index look likes: { "_index" : "searches", "_type" : "searches", "_id" : "cCYuHW4BvwH6Y3jL87ul", "_score" : 1.0, "_source" : { "querySearched" : "telecom", } }, { "_index" : "searches", "_type" : "searches", "_id" : "cSYuHW4BvwH6Y3jL_Lvt", "_score" : 1.0, "_source" : { "querySearched" : "telecom", } }, { "_index" : "searches", "_type" : "searches", "_id" : "eCb6O24BvwH6Y3jLP7tM", "_score" : 1.0, "_source" : { "querySearched" : "industry", } And I would like a query that

Elasticsearch: Change root url from / to /elastic

我的未来我决定 提交于 2020-01-23 12:07:09
问题 I am setting up an elasticsearch cluster and I want to set the domain url to <domain_name>/elastic Currently, when I go to <domain_name>/elastic , elasticsearch thinks /elastic as the name of the index. I haven't found any documentation on how to set the root url context for elatsicsearch. Any help would be much appreciated. 回答1: For those who are searching through internet how to do the similar thing in Kubernetes when using ingress with path other then / it can be done using annotation

doc with multi-field of boolean type fails during creation

别说谁变了你拦得住时间么 提交于 2020-01-22 02:26:08
问题 In v5.5, we had the following mapping which was working fine PUT multiple_datatypes { "mappings": { "_doc": { "properties": { "user_data": { "type": "text", "fields": { "numeric": { "type": "double", "ignore_malformed": true }, "date": { "type": "date", "ignore_malformed": true } "logical": { "type": "boolean", } } } } } } In 6.2, the same mapping fails with the error HTTP/1.1 400 Bad Request]\n{\"error\":{\"root_cause\":[{\"type\":\"mapper_parsing_exception\",\"reason\":\"failed to parse

fuzziness in bool query with multimatch elasticsearch

冷暖自知 提交于 2019-12-30 13:31:05
问题 i am using elasticsearch version 6.3.0. I want to use fuzziness along with multimatch. but there is no option for that. Can anybody provide me a solution ? Thanks in advance Query : { "query": { "bool": { "must": [ {"function_score": { "query": { "multi_match": { "query": "local", "fields": [ "user.name^3", "main_product" ], "type": "phrase" } } }} ], "filter": { "geo_distance": { "distance": "1000km", "user.geolocation": { "lat": 25.55, "lon": -84.44 } } } } } } 回答1: Looking at your existing

Elasticsearch “match_phrase” query and “fuzzy” query - can both be used in conjunction

↘锁芯ラ 提交于 2019-12-25 00:05:46
问题 I need a query using match_phrase along with fuzzy matching. However I'm not able to find any documentation to construct such a query. Also, when I try combining the queries(one within another), it throws errors. Is it possible to construct such a query? 回答1: You would need to make use of Span Queries. The below query would perform phrase match+fuzzy query for champions league say for e.g. on a sample field name which is of type text If you'd want multiple fields, then add another must clause