elasticsearch-api

Why elastic search bulk insert uses \n delimiter, instead of using an array of json objects?

旧巷老猫 提交于 2019-12-25 09:08:06
问题 Here is a sample of bulk insertion provided by elastic search docs at: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html POST _bulk { "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } } { "field1" : "value1" } { "delete" : { "_index" : "test", "_type" : "type1", "_id" : "2" } } { "create" : { "_index" : "test", "_type" : "type1", "_id" : "3" } } { "field1" : "value3" } { "update" : {"_id" : "1", "_type" : "type1", "_index" : "test"} } { "doc" : {

Elasticsearch - search across multiple indices with conditional decay function

我与影子孤独终老i 提交于 2019-12-12 06:04:53
问题 I'm trying to search across multiple indices with one query, but only apply the gaussian decay function to a field that exists on one of the indices. I'm running this through elasticsearch-api gem, and that portion works just fine. Here's the query I'm running in marvel. GET episodes,shows,keywords/_search?explain { "query": { "function_score": { "query": { "multi_match": { "query": "AWESOME SAUCE", "type": "most_fields", "fields": [ "title", "summary", "show_title"] } }, "functions": [ {

How to get nested types in Elasticsearch

狂风中的少年 提交于 2019-12-11 12:15:04
问题 I have the following document: { "_index" : "testdb", "_type" : "artWork", "_id" : "0", "_version" : 4, "found" : true, "_source":{"uuid":0, "StatusHistoryList":[ { "ArtWorkDate":"2015-08-28T15:52:03.030+05:00", "ArtworkStatus":"ACTIVE" }, { "ArtWorkDate":"2015-08-28T15:52:03.030+05:00", "ArtworkStatus":"INACTIVE" } ] } and here is the mapping of the document: { "testdb" : { "mappings" : { "artWork" : { "properties" : { "StatusHistoryList" : { "type" : "nested", "properties" : { "ArtWorkDate"

Elasticsearch Ordering terms aggregation buckets after field in top hits sub aggregation

夙愿已清 提交于 2019-12-11 09:55:11
问题 I would like to order the buckets from a terms aggregation based on a property possessed by the first element in a top hits aggregation. My best effort query looks like this (with syntax errors): { "aggregations": { "toBeOrdered": { "terms": { "field": "parent_uuid", "size": 1000000, "order": { "topAnswer._source.id": "asc" } }, "aggregations": { "topAnswer": { "top_hits": { "size": 1 } } } } } } Does anyone know how to accomplish this? Example: { "a":1, "b":2, "id":4 } { "a":1, "b":3, "id":1

Using Elasticsearch Rest High Client problem in AEM

旧巷老猫 提交于 2019-12-05 01:43:01
问题 I am trying to use Java High Level Rest Client in Adobe Experience Manager to finish project of comparison between Lucene, Solr and Elasticsearch search engines . I am having some problems with elasticsearh implementation . Here is the code: Dependency in the parent pom.xml (the same is defined in core pom.xml) <!-- Elasticseach dependencies --> <dependency> <groupId>org.elasticsearch.client</groupId> <artifactId>elasticsearch-rest-high-level-client</artifactId> <version>7.4.0</version> <