elasticsearch-5

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

why I can't make search request to my Elastic Enterprise Search app using axios?

馋奶兔 提交于 2021-02-10 21:25:30
问题 so I want to make search request to my elastic enterprise search app using guide from the documentation in here , I don't want to use elastic node JS client, but I want to make http request using axios. here is the code I use const url = "https://XXXXXXX38ce49e5aff1aa238e6f9195.ent-search.asia-southeast1.gcp.elastic-cloud.com/api/as/v1/engines/events/search" const headers = {"Authorization": "Bearer search-qpz4bu5o7ubb8j31r15juyrh"} const jsonData = { query: "hello there" } try { const {data}

why I can't make search request to my Elastic Enterprise Search app using axios?

萝らか妹 提交于 2021-02-10 21:21:40
问题 so I want to make search request to my elastic enterprise search app using guide from the documentation in here , I don't want to use elastic node JS client, but I want to make http request using axios. here is the code I use const url = "https://XXXXXXX38ce49e5aff1aa238e6f9195.ent-search.asia-southeast1.gcp.elastic-cloud.com/api/as/v1/engines/events/search" const headers = {"Authorization": "Bearer search-qpz4bu5o7ubb8j31r15juyrh"} const jsonData = { query: "hello there" } try { const {data}

Using Persistent Host Volume for ElasticSearch with Docker-Compose

99封情书 提交于 2021-02-10 20:12:04
问题 Running Elasticsearch using the below docker-compose.yml is throwing an error Java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes It appears that this is due to trying to mount /usr/share/elasticsearch/data in the Docker container to ./data/elasticsearch/data on the host. Tried setting user: "1000:1000" after identifying the following info, but still getting the same error. the owner/group of /usr/share/elasticsearch/data/nodes to be elasticsearch:elasticsearch the owner

What is the use of maintaining two aliases for a single Elastic Search Index

亡梦爱人 提交于 2021-02-10 14:18:10
问题 I have been exploring Elastic Search lately. I have been going through aliases. I see ES provides an API to create multiple aliases to a single index like below: { "actions" : [{ "add" : { "indices" : ["test1", "test2"], "alias" : "alias1" } }] } Refer: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html#indices-aliases I'm wondering what is the use case of this. Won't the queries on aliases get split if an alias point to multiple indices? I have tried getting

how to write an Elasticsearch query having multiple conditions

不羁岁月 提交于 2021-02-05 09:44:39
问题 Need help constructing an ES query. Here's an example of the raw JSON of the documents: { "user_uuid": 1234, "keywords": "apple", "@timestamp": "2020-01-15", }, { "uuid": 1234, "keywords": "google", "@timestamp": "2020-01-21", }, { "uuid": 9876, "keywords": "youtube", "@timestamp": "2020-01-25", } Here is an example requirement: { "search_groups":[ { "keywords": [ "google", "microsoft", "tesla" ], "time_range": 2020-01-17 - 2020-01-22 }, { "keywords": [ "apple", "youtube", "spotify" ], "time

Multiple Elasticsearch connection in singleton object Getting one specific Singleton elastic search in controller class

谁说胖子不能爱 提交于 2021-02-05 08:16:53
问题 Passing AcqClient and NcClient to the same interface //AcqClient and NcClient are static ReadOnly Variables public static void Connection(){ AcqClient = new ElasticClient(AcqConnection); NcClient= new ElasticClient(NcConnection); Creating Singleton Object services.AddSingleton<IElasticClient>(AcqClient); services.AddSingleton<IElasticClient>(NcClient); } Implementing in Startup.cs service.Connection(configuration) On my controller class when i am doing this i am getting the last one object

Multiple Elasticsearch connection in singleton object Getting one specific Singleton elastic search in controller class

女生的网名这么多〃 提交于 2021-02-05 08:16:45
问题 Passing AcqClient and NcClient to the same interface //AcqClient and NcClient are static ReadOnly Variables public static void Connection(){ AcqClient = new ElasticClient(AcqConnection); NcClient= new ElasticClient(NcConnection); Creating Singleton Object services.AddSingleton<IElasticClient>(AcqClient); services.AddSingleton<IElasticClient>(NcClient); } Implementing in Startup.cs service.Connection(configuration) On my controller class when i am doing this i am getting the last one object

How to use “OR” in Dev Tool Query

血红的双手。 提交于 2021-01-29 12:51:52
问题 Hi Bellow Search provides me Log where it has both "value": "HB" and "value": "1234567" as, I am using Term, however, What I am looking for this if this match ("value": "HB" OR "value": "TR" ) AND "value": "1234567" but not understanding how to do in below, Can anyone please help me GET _search { "query": { "bool": { "must": [ { "match": {"log.file.path":"mylog.log" } } { "term": { "GPS-LOG.COMMAND": { "value": "HB" } } }, { "term": { "GPS-LOG.IMEI": { "value": "1234567" } } } ], "filter": {

Is there is any way to iterate elastic array document like other programming language with script

冷暖自知 提交于 2021-01-27 15:42:35
问题 Mapping { "supply": { "properties": { "rotation_list": { "type": "nested", "properties": { "project_end_date": { "type": "nested", "properties": { "end_date": { "type": "date", "format": "yyyy-MM-ddTHH:mm:ss" } } }, "total_days": { "type": "integer" } } } } }} Data {"rotation_list": [ { "project_end_date": [ { "end_date": "2020-08-07" }, { "end_date": "2020-06-07" } ], "total_days": 23 }, { "project_end_date": [ { "end_date": "2020-08-07" } ], "total_days": 26 }]} query {"query": { "bool": {