elasticsearch-5

UncategorizedExecutionException[Failed execution]; nested: IOException[Connection is closed] - ElasticSearch

人走茶凉 提交于 2020-07-22 05:13:29
问题 I am running the reindex using the Java client from 5.5 to 7.8 ReindexRequestBuilder reIndexRequest = new ReindexRequestBuilder(client, ReindexAction.INSTANCE); // Basic configuration reIndexRequest.source(indexObject.getSourceIndex()); reIndexRequest.destination(indexObject.getDestinationIndex()); if (reIndex.getMaxretry() != 0) { reIndexRequest.setMaxRetries(reIndex.getMaxretry()); } // OpType if (!CommonUtils.isEmpty(reIndex.getOptype())) { reIndexRequest.request().setDestOpType(reIndex

Aggregation in elasticsearch across indices is not working

陌路散爱 提交于 2020-07-09 12:37:05
问题 I was using elasticsearch 5.5 where I have one index and 3 types like below, Index Name : Main Types : TypeA, TypeB, TypeC In 5.5, I was running aggregation like this, AggregationBuilder ag = AggregationBuilders.terms("aggregatekey").field("field1").order(Terms.Order.aggregation("datafield", false)).size(100); SearchResponse response = eswrapper.prepareSearch("Main").addAggregation(ag).setSize(0) .execute().actionGet(); so It searches across the single index where 3 types were there. Then I

Reindex API vs using logstash for reindexing from elastic search 5.5 (remote) to elastic search 7.7 (local)

冷暖自知 提交于 2020-06-29 06:43:31
问题 I am looking for migrating the data from elastic search version 5.5 to 7.7, I found the following two ways, 1) Re_Index API using Java API : https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-high-document-reindex.html#java-rest-high-document-reindex which looks easy (as it involves java code) and able to see all the possible cases for moving all the documents from version 5.5 to 7.7 2) Re_Index API using Curl : https://www.elastic.co/guide/en/elasticsearch

NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{…}{127.0.0.1}{127.0.0.1:9300}]]

只谈情不闲聊 提交于 2020-06-25 09:18:11
问题 I know that question has already been treated but with all my attemps, no way to fix my issue. I just installed elasticsearch and boot it. Here the log of elastic : [2017-05-17T00:05:27,290][INFO ][o.e.n.Node ] [] initializing ... [2017-05-17T00:05:27,394][INFO ][o.e.e.NodeEnvironment ] [xhkU1rX] using [1] data paths, mounts [[Data (D:)]], net usable_space [25gb], net total_space [138.4gb], spins? [unknown], types [NTFS] [2017-05-17T00:05:27,395][INFO ][o.e.e.NodeEnvironment ] [xhkU1rX] heap

Query across multiple index in the Elasticsearch version 7.7

折月煮酒 提交于 2020-06-17 09:34:23
问题 In elastic search version 7.7, multiple _types in the index is removed, Now If we want to query across multiple index, we are doing in the following way. /index1,index2/_search?q=type:tweet In 7.7, what is the best way to query from multiple indexes using Transport Java API? Edited : 1) Say I have two indexes, " user " and " tweet " I want to search both the index - user and tweet like below If I want to query the " user " index on the field as {"username" = " Opster "} and in " tweet " index

ElasticSearch Aggregation + Sorting in on NonNumric Field 5.3

别说谁变了你拦得住时间么 提交于 2020-05-14 03:44:19
问题 I wanted to aggregate the data on a different field and also wanted to get the aggregated data on sorted fashion based on the name. My data is : { "_index": "testing-aggregation", "_type": "employee", "_id": "emp001_local000000000000001", "_score": 10.0, "_source": { "name": [ "Person 01" ], "groupbyid": [ "group0001" ], "ranking": [ "2.0" ] } }, { "_index": "testing-aggregation", "_type": "employee", "_id": "emp002_local000000000000001", "_score": 85146.375, "_source": { "name": [ "Person 02

How to give different weights to exact, phonetic and fuzzy queries?

主宰稳场 提交于 2020-04-17 22:37:10
问题 Note: I checked out this answer, but could not solve the problem. So currently I am using the following query: { "_source": [ "title", "bench", "id_", "court", "date" ], "size": 15, "from": 0, "query": { "bool": { "must": { "multi_match": { "query": "knife", "fields": [ "title", "body" ], "operator": "and" } }, "should": { "multi_match": { "query": "knife", "fields": [ "title", "body" ], "fuzziness" : 1, "operator": "and" } } } }, "highlight": { "pre_tags": [ "<tag1>" ], "post_tags": [ "<

Elasticsearch : constant_score query vs bool.filter query

∥☆過路亽.° 提交于 2020-04-10 08:40:34
问题 I am trying to achieve an exact match result using Elasticsearch (so I don't care about scoring here) I see that there are 2 ways to do this : { "query" : { "constant_score" : { "filter" : { "term" : { "exact_match_field" : "hello world !" } } } } } or { "query": { "bool": { "filter": { "term": { "exact_match_field": "hello world !" } } } } } Both work and gives me the result I want. Whats the difference between them ? Are there performance benefits of using one vs the other ? (I am using

Elasticsearch : constant_score query vs bool.filter query

你。 提交于 2020-04-10 08:40:11
问题 I am trying to achieve an exact match result using Elasticsearch (so I don't care about scoring here) I see that there are 2 ways to do this : { "query" : { "constant_score" : { "filter" : { "term" : { "exact_match_field" : "hello world !" } } } } } or { "query": { "bool": { "filter": { "term": { "exact_match_field": "hello world !" } } } } } Both work and gives me the result I want. Whats the difference between them ? Are there performance benefits of using one vs the other ? (I am using

Elasticsearch autocomplete suggester

谁说我不能喝 提交于 2020-04-07 07:08:54
问题 I want to implement autocomplete feature in ES I have followed this tutorial from ES documentations my Indexing is: { "properties" : { "suggest" : { "type" : "completion" }, "titleKeyword" : { "type": "keyword" } } } } I am putting text value in titleKeyword field then I queried like follows { "suggest" : { "my-suggestion" : { "text" : "iphone", "term" : { "field" : "titleKeyword" } } } } The result is: ... "suggest": { "my-suggestion": [ { "text": "iphone", "offset": 0, "length": 6, "options