elasticsearch-7

Elasticsearch put role API

折月煮酒 提交于 2020-08-17 11:56:11
问题 I started using the create role API and it works as expected : https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html I got the list of default roles in elasticsearch, /_security/role but I don't know to create the following roles and not able to find the proper docs for it. I want to segregate the user based on the following needs, Role which has the privilege to perform only READ / WRITE in all the indices in Elastic Search (This role should not have

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

Create Index Request Mapping is failing in elastic search

百般思念 提交于 2020-06-27 06:11:10
问题 I am trying to create the Join data type in the elastic search index, It is working from the kibana console / via rest but when I try to create the mapping for the index programmatically it fails with the below error, java.util.concurrent.ExecutionException: RemoteTransportException[[3cfb4e163654][172.17.0.2:9300][indices:admin/create]]; nested: MapperParsingException[Failed to parse mapping [properties]: Root mapping definition has unsupported parameters: [my_join_field : {type=join,

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

Fuzziness functionality not working for single word in my searchasyoutype datatype field query elasticsearch nest?

百般思念 提交于 2020-01-06 05:29:08
问题 I am using nest api and searchasyoutype datatype but the fuziness(Fuzziness.Auto) is not working Following is my code: var searchResponse=_con.client.Search<object>(x=>x.Index("_all").Query(q=>q.MultiMatch(m=>m.Query(searchterm) .Fuzziness(Fuzziness.Auto) .Fields(f => f.Field("name").Field("name._2gram").Field("name._3gram")) .Type(TextQueryType.BoolPrefix) ))); Following result is when searchterm is correctly spelled with searchterm= washing https://localhost:44311/api/search/suggest/

Elasticsearch search suggestion on array field with partial edge ngram completion

爱⌒轻易说出口 提交于 2019-12-13 03:45:58
问题 I am trying to build a suggester based on arrays of strings in my documents, it is similar to this one but with several differences : the completion suggester from Elasticsearch is not exactly doing what I want (in terms of filtering and prefix matching), as I need an edge ngram that would work on any word of the sentence, accent-insensitive. Let me clarify with an example. Assume I have the following indexed documents. I want to suggest "tags" based on a query q (I don't care about the