# Elasticsearch

**URL:** https://discuss.elastic.co/c/elastic-stack/elasticsearch/6.md?page=1643

[Latest](https://discuss.elastic.co/latest.md) · [Categories](https://discuss.elastic.co/categories.md) · [Tags](https://discuss.elastic.co/tags.md)

**Page:** 1644

---

## [Conditional query (If matches in field than do this...)](https://discuss.elastic.co/t/conditional-query-if-matches-in-field-than-do-this/136978)

<div class="topic-metadata">

**Author:** [@creaticious](https://discuss.elastic.co/u/creaticious)\
**Replies:** 1\
**Last updated:** [June 22, 2018, 10:24am UTC](https://discuss.elastic.co/t/conditional-query-if-matches-in-field-than-do-this/136978 "2018-06-22T10:24:28Z")

</div>

Hey guys, i've some problems to build a special conditional query. Pretend i have documents a,b,c etc. with a "country"-field and a "description"-field. My query should look in both fields...BUT if the user searches for…

---

## [Mappings for Nested Objects](https://discuss.elastic.co/t/mappings-for-nested-objects/135878)

<div class="topic-metadata">

**Author:** [@drendell](https://discuss.elastic.co/u/drendell)\
**Replies:** 1\
**Last updated:** [June 22, 2018, 9:44am UTC](https://discuss.elastic.co/t/mappings-for-nested-objects/135878 "2018-06-22T09:44:23Z")

</div>

Hi all, I'm having trouble building out a suitable mapping structure that will appropriately accommodate nested objects. ES and Kibana are both the latest versions. Here's a truncated example (I've trimmed the two nes…

---

## [Cluster.routing.allocation.same\_shard.host doesnt seem to work properly](https://discuss.elastic.co/t/cluster-routing-allocation-same-shard-host-doesnt-seem-to-work-properly/136625)

<div class="topic-metadata">

**Author:** [@tuudik](https://discuss.elastic.co/u/tuudik)\
**Replies:** 11\
**Last updated:** [June 22, 2018, 9:21am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-same-shard-host-doesnt-seem-to-work-properly/136625 "2018-06-22T09:21:06Z")

</div>

Elasticsearch version (bin/elasticsearch --version): 6.3.0 Plugins installed: \[ingest-geoip\] JVM version (java -version): openjdk version "1.8.0\_171" OS version (uname -a if on a Unix-like system): Linux elk-ela-1f 4.…

---

## [Counting buckets with a particular value](https://discuss.elastic.co/t/counting-buckets-with-a-particular-value/136671)

<div class="topic-metadata">

**Author:** [@m\_arku\_s](https://discuss.elastic.co/u/m_arku_s)\
**Replies:** 3\
**Last updated:** [June 22, 2018, 8:45am UTC](https://discuss.elastic.co/t/counting-buckets-with-a-particular-value/136671 "2018-06-22T08:45:20Z")

</div>

Using Elasticsearch 6.2.x, I am failing to write a particular query. My data contains information about when an actor commenced one of several consecutive phases: curl -XPUT http://localhost:9200/phases curl -XPUT http…

---

## [Cluster Achitecture](https://discuss.elastic.co/t/cluster-achitecture/136976)

<div class="topic-metadata">

**Author:** [@ysl](https://discuss.elastic.co/u/ysl)\
**Replies:** 1\
**Last updated:** [June 22, 2018, 8:03am UTC](https://discuss.elastic.co/t/cluster-achitecture/136976 "2018-06-22T08:03:35Z")

</div>

Hello, I would like to setup my Elasticsearch cluster with the hardware specification and condition as below: Hardware for each node 16 Gb ram 8 virtual cores conditions Starts with 10Tb disk space in total Data s…

---

## [Can anybody help me with a difficult query?](https://discuss.elastic.co/t/can-anybody-help-me-with-a-difficult-query/136889)

<div class="topic-metadata">

**Author:** [@magorbe](https://discuss.elastic.co/u/magorbe)\
**Replies:** 2\
**Last updated:** [June 22, 2018, 7:51am UTC](https://discuss.elastic.co/t/can-anybody-help-me-with-a-difficult-query/136889 "2018-06-22T07:51:02Z")

</div>

Hello !! I have this mapping : "c\_index": { "aliases": {}, "mappings": { "an": { "properties": { "id": { "type": "string" }, …

---

## [Possible to query if two texts match via the \_analyze APIs?](https://discuss.elastic.co/t/possible-to-query-if-two-texts-match-via-the-analyze-apis/136954)

<div class="topic-metadata">

**Author:** [@NewHere](https://discuss.elastic.co/u/NewHere)\
**Replies:** 1\
**Last updated:** [June 22, 2018, 7:23am UTC](https://discuss.elastic.co/t/possible-to-query-if-two-texts-match-via-the-analyze-apis/136954 "2018-06-22T07:23:41Z")

</div>

Hi I have some custom analysers in my index, I want to test if two input texts are considered a match using one or some or any of these analysers via the \_analyze APIs. e.g. doing a POST to host/\_analyze with {"analyzer…

---

## [Shard Relocation Speed](https://discuss.elastic.co/t/shard-relocation-speed/135999)

<div class="topic-metadata">

**Author:** [@Jonathan\_Mendenhall](https://discuss.elastic.co/u/Jonathan_Mendenhall)\
**Replies:** 7\
**Last updated:** [June 22, 2018, 7:10am UTC](https://discuss.elastic.co/t/shard-relocation-speed/135999 "2018-06-22T07:10:54Z")

</div>

I'm trying to get a good grasp on how long I can expect for a replica shard to take to transfer between nodes. Running ES 6.2 on Windows, I ran a few tests. First I used the "/\_cluster/reroute" API to get a good baseli…

---

## [Trying to trigger alert when field exceed limit](https://discuss.elastic.co/t/trying-to-trigger-alert-when-field-exceed-limit/136781)

<div class="topic-metadata">

**Author:** [@wailoont](https://discuss.elastic.co/u/wailoont)\
**Replies:** 4\
**Last updated:** [June 22, 2018, 6:20am UTC](https://discuss.elastic.co/t/trying-to-trigger-alert-when-field-exceed-limit/136781 "2018-06-22T06:20:07Z")

</div>

Hello, I am trying to create an advanced watcher using json. Below is my json. { "trigger": { "schedule": { "interval": "1m" } }, "input": { "search": { "request": { "body": { …

---

## [Import data from elasticsearch](https://discuss.elastic.co/t/import-data-from-elasticsearch/136821)

<div class="topic-metadata">

**Author:** [@komal\_mittal](https://discuss.elastic.co/u/komal_mittal)\
**Replies:** 4\
**Last updated:** [June 22, 2018, 6:15am UTC](https://discuss.elastic.co/t/import-data-from-elasticsearch/136821 "2018-06-22T06:15:52Z")

</div>

how can I import data from elasticsearch in python code which is used for k-means clustering?

---

## [Red status caused by stuck initializing\_shards](https://discuss.elastic.co/t/red-status-caused-by-stuck-initializing-shards/135177)

<div class="topic-metadata">

**Author:** [@elk2](https://discuss.elastic.co/u/elk2)\
**Replies:** 11\
**Last updated:** [June 21, 2018, 2:20pm UTC](https://discuss.elastic.co/t/red-status-caused-by-stuck-initializing-shards/135177 "2018-06-21T14:20:25Z")

</div>

I have a single index in initializing shards stuck with red status cluster. I tried to reassign index to another node without success because it is not an unassigned shard. I have only primary shards and this is the sta…

---

## [Is it possible to use variables in indexed documents in elasticsearch?](https://discuss.elastic.co/t/is-it-possible-to-use-variables-in-indexed-documents-in-elasticsearch/135736)

<div class="topic-metadata">

**Author:** [@rs123](https://discuss.elastic.co/u/rs123)\
**Replies:** 8\
**Last updated:** [June 22, 2018, 5:38am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-variables-in-indexed-documents-in-elasticsearch/135736 "2018-06-22T05:38:26Z")

</div>

Is it possible to use variables in indexed documents in elasticsearch? POST somki/\_doc/ { "suggest": { "input": \["my name is x"\] } } } I want to have x as variable so that when someone search so…

---

## [Snapshot index based on query](https://discuss.elastic.co/t/snapshot-index-based-on-query/136858)

<div class="topic-metadata">

**Author:** [@bipinbs](https://discuss.elastic.co/u/bipinbs)\
**Replies:** 2\
**Last updated:** [June 22, 2018, 5:24am UTC](https://discuss.elastic.co/t/snapshot-index-based-on-query/136858 "2018-06-22T05:24:22Z")

</div>

Hi, Currently, we have deployed elasticsearch in our kubernetes cluster where we have daily indices configured. Currently for multiple tenants we store logs in same index based on routing key. We have daily curator job …

---

## [Docs count : 10000 but index\_total and index\_time\_in\_millis : 0](https://discuss.elastic.co/t/docs-count-10000-but-index-total-and-index-time-in-millis-0/136948)

<div class="topic-metadata">

**Author:** [@gergaith](https://discuss.elastic.co/u/gergaith)\
**Replies:** 0\
**Last updated:** [June 21, 2018, 10:16pm UTC](https://discuss.elastic.co/t/docs-count-10000-but-index-total-and-index-time-in-millis-0/136948 "2018-06-21T22:16:41Z")

</div>

hello, i'm new to ES, i'm trying to monitor the performance of indexing documents into ES, so documents are written ( count : 100000 ) in the ES cluster ( through logstash) but no document is indexed ( index\_total and i…

---

## [Filebeat indicies missing in Kibana](https://discuss.elastic.co/t/filebeat-indicies-missing-in-kibana/136940)

<div class="topic-metadata">

**Author:** [@alexserd](https://discuss.elastic.co/u/alexserd)\
**Replies:** 0\
**Last updated:** [June 21, 2018, 9:29pm UTC](https://discuss.elastic.co/t/filebeat-indicies-missing-in-kibana/136940 "2018-06-21T21:29:12Z")

</div>

I've deleted all data from elasticsearch which included indicies invoke-webrequest -method delete http://localhost:9200/\* After the deletion the server was rebooted I'm able to see filebeat-6.2.4 under http://localhos…

---

## [How to retrieve document in standard json format to store it into string?](https://discuss.elastic.co/t/how-to-retrieve-document-in-standard-json-format-to-store-it-into-string/136937)

<div class="topic-metadata">

**Author:** [@Suryatejreddy](https://discuss.elastic.co/u/Suryatejreddy)\
**Replies:** 0\
**Last updated:** [June 21, 2018, 9:19pm UTC](https://discuss.elastic.co/t/how-to-retrieve-document-in-standard-json-format-to-store-it-into-string/136937 "2018-06-21T21:19:20Z")

</div>

When I do Get operation on Index, I get results in the form of { "took": 3, "timed\_out": false, "\_shards": { "total": 5, "successful": 3, "skipped": 0, "failed": 0 }, "hits": { "total": 67, "max\_score": 1, "…

---

## [Price Range Mapping](https://discuss.elastic.co/t/price-range-mapping/136638)

<div class="topic-metadata">

**Author:** [@triadev](https://discuss.elastic.co/u/triadev)\
**Replies:** 1\
**Last updated:** [June 21, 2018, 8:21pm UTC](https://discuss.elastic.co/t/price-range-mapping/136638 "2018-06-21T20:21:43Z")

</div>

Good morning! Currently, we are saving documents in a single index with a nested field. This nested field represents prices and looks like the following: 'prices' =\> \[ 'type' =\> 'nested', 'properties' =\> \[ …

---

## [(Spark) Write data with new timestamp and then delete all with old timestamp](https://discuss.elastic.co/t/spark-write-data-with-new-timestamp-and-then-delete-all-with-old-timestamp/135865)

<div class="topic-metadata">

**Author:** [@c4c8f8b3048c927d1e54](https://discuss.elastic.co/u/c4c8f8b3048c927d1e54)\
**Replies:** 1\
**Last updated:** [June 21, 2018, 5:33pm UTC](https://discuss.elastic.co/t/spark-write-data-with-new-timestamp-and-then-delete-all-with-old-timestamp/135865 "2018-06-21T17:33:54Z")

</div>

Hello, everybody! I have some test RDD with case class Product (tokens : String, count : Long, timestamp : Long,id :Int) in Spark-Scala. timestamp - System.currentTimeMillis() I wrote it to elasticsearch, but later i'…

---

## [org.elasticsearch.hadoop.rest.EsHadoopNoNodesLeftException: Connection error (check network and/or proxy settings)- all nodes](https://discuss.elastic.co/t/org-elasticsearch-hadoop-rest-eshadoopnonodesleftexception-connection-error-check-network-and-or-proxy-settings-all-nodes/135571)

<div class="topic-metadata">

**Author:** [@Carlos\_Palomares](https://discuss.elastic.co/u/Carlos_Palomares)\
**Replies:** 1\
**Last updated:** [June 21, 2018, 5:28pm UTC](https://discuss.elastic.co/t/org-elasticsearch-hadoop-rest-eshadoopnonodesleftexception-connection-error-check-network-and-or-proxy-settings-all-nodes/135571 "2018-06-21T17:28:36Z")

</div>

We have a problem with the library elastic for hadoop in sparkSQL with scala, Everything is working perfectly when we save a RDD in a specific index into of the cluster: 3 nodes with 16GB of ran everyone configuration…

---

## [Can I run elasticsearch-sql-cli in batch mode?](https://discuss.elastic.co/t/can-i-run-elasticsearch-sql-cli-in-batch-mode/136734)

<div class="topic-metadata">

**Author:** [@gthang](https://discuss.elastic.co/u/gthang)\
**Replies:** 3\
**Last updated:** [June 21, 2018, 5:26pm UTC](https://discuss.elastic.co/t/can-i-run-elasticsearch-sql-cli-in-batch-mode/136734 "2018-06-21T17:26:59Z")

</div>

Hello All, Is there anyway I can run the sql-cli in batch mode with a sql statement that I can redirect into it(I can't, I tried). I guess I can use the python elasticsearch\_dsl module to run the output and generate js…

---

## [Creating Arrays of Nested Objects using the Spark Connector](https://discuss.elastic.co/t/creating-arrays-of-nested-objects-using-the-spark-connector/135412)

<div class="topic-metadata">

**Author:** [@mike\_metistream](https://discuss.elastic.co/u/mike_metistream)\
**Replies:** 2\
**Last updated:** [June 21, 2018, 5:19pm UTC](https://discuss.elastic.co/t/creating-arrays-of-nested-objects-using-the-spark-connector/135412 "2018-06-21T17:19:33Z")

</div>

I have a Spark DataFrame of the schema: |-- ROW\_ID: string (nullable = true) |-- SUBJECT\_ID: string (nullable = true) |-- HADM\_ID: string (nullable = true) |-- CHARTDATE: string (nullable = true) |-- CHARTTIME: str…

---

## [Forcemerge failed ( java.lang.ArrayIndexOutOfBoundsException )](https://discuss.elastic.co/t/forcemerge-failed-java-lang-arrayindexoutofboundsexception/136317)

<div class="topic-metadata">

**Author:** [@pfseth](https://discuss.elastic.co/u/pfseth)\
**Replies:** 12\
**Last updated:** [June 21, 2018, 4:21pm UTC](https://discuss.elastic.co/t/forcemerge-failed-java-lang-arrayindexoutofboundsexception/136317 "2018-06-21T16:21:28Z")

</div>

Hi, I run curator ( forcemerge ) on previous day's indices to reduce the segment sizes, however of late i have observed the merge operation failing and in turn brings down the cluster. Appreciate any feedback ( Image a…

---

## [Use case - Get last document over multi document types at time X for all business IDs](https://discuss.elastic.co/t/use-case-get-last-document-over-multi-document-types-at-time-x-for-all-business-ids/132356)

<div class="topic-metadata">

**Author:** [@sublime](https://discuss.elastic.co/u/sublime)\
**Replies:** 2\
**Last updated:** [May 24, 2018, 4:14pm UTC](https://discuss.elastic.co/t/use-case-get-last-document-over-multi-document-types-at-time-x-for-all-business-ids/132356 "2018-05-24T16:14:11Z")

</div>

Hi, I am strongly investigating the potential of ES for a use case we have but I am not really sure if I cannot make it do what I want it to do or if it is actually not designed for this. Any advice appreciadted Say I …

---

## [It is possible to set phrase queries on certain multi term synonyms?](https://discuss.elastic.co/t/it-is-possible-to-set-phrase-queries-on-certain-multi-term-synonyms/134255)

<div class="topic-metadata">

**Author:** [@imranazad](https://discuss.elastic.co/u/imranazad)\
**Replies:** 2\
**Last updated:** [June 21, 2018, 3:59pm UTC](https://discuss.elastic.co/t/it-is-possible-to-set-phrase-queries-on-certain-multi-term-synonyms/134255 "2018-06-21T15:59:30Z")

</div>

Hi, I have the following synonyms mapping on the query side: ckd, chronic kidney disease On the index side I have the following: chronic kidney disease =\> ckd, chronic kidney disease If someones searches for 'ckd'…

---

## [JavaEsSparkSQL incompatible with DataSet\<Row\>](https://discuss.elastic.co/t/javaessparksql-incompatible-with-dataset-row/135811)

<div class="topic-metadata">

**Author:** [@amogkam](https://discuss.elastic.co/u/amogkam)\
**Replies:** 1\
**Last updated:** [June 21, 2018, 3:31pm UTC](https://discuss.elastic.co/t/javaessparksql-incompatible-with-dataset-row/135811 "2018-06-21T15:31:38Z")

</div>

In Spark version 2.1, DataFrames are represented as DataSet in the Java API. However, the ES Spark SQL API still requires a type DataFrame in the saveToEs method. Is there any work around for this, or is there another me…

---

## [Spark save to elasticsearch failed due to Connection error](https://discuss.elastic.co/t/spark-save-to-elasticsearch-failed-due-to-connection-error/135153)

<div class="topic-metadata">

**Author:** [@aouakki](https://discuss.elastic.co/u/aouakki)\
**Replies:** 1\
**Last updated:** [June 21, 2018, 3:26pm UTC](https://discuss.elastic.co/t/spark-save-to-elasticsearch-failed-due-to-connection-error/135153 "2018-06-21T15:26:51Z")

</div>

I'm trying to index data in elasticsearch about 77M documents with 150 fields . We dont have much computing/memory resource so our cluster is 3 nodes ( 48GB RAM /24 CPU and 6TB of storage ) I'm sending data from anothe…

---

## [Multiple Field as mapping iD](https://discuss.elastic.co/t/multiple-field-as-mapping-id/135103)

<div class="topic-metadata">

**Author:** [@padhu1989](https://discuss.elastic.co/u/padhu1989)\
**Replies:** 1\
**Last updated:** [June 21, 2018, 3:20pm UTC](https://discuss.elastic.co/t/multiple-field-as-mapping-id/135103 "2018-06-21T15:20:42Z")

</div>

I am pretty new to elastic search. I am using elasticsearch-hadoop 6.2.4 version and I am reading the files from HDFS, converting to bean object and writing to elastic search. I am using Spark Structured streaming. …

---

## [Recovering from numerous dangling indices warnings](https://discuss.elastic.co/t/recovering-from-numerous-dangling-indices-warnings/136905)

<div class="topic-metadata">

**Author:** [@jonassteinberg1](https://discuss.elastic.co/u/jonassteinberg1)\
**Replies:** 0\
**Last updated:** [June 21, 2018, 3:01pm UTC](https://discuss.elastic.co/t/recovering-from-numerous-dangling-indices-warnings/136905 "2018-06-21T15:01:28Z")

</div>

We rolled in an additional master yesterday and precipitated a brief period of no masters. Now of course there are thousands of dangling index warnings in our logs. Is there a best approach to dealing with this? The d…

---

## [Aggregations search results are always lowercase](https://discuss.elastic.co/t/aggregations-search-results-are-always-lowercase/136868)

<div class="topic-metadata">

**Author:** [@Martin\_M](https://discuss.elastic.co/u/Martin_M)\
**Replies:** 1\
**Last updated:** [June 21, 2018, 2:38pm UTC](https://discuss.elastic.co/t/aggregations-search-results-are-always-lowercase/136868 "2018-06-21T14:38:07Z")

</div>

Hi, I have an issue regarding the aggregations search. I've already tried several analyzer and settings in my template/mapping, but the values I get are always in lowercase. How should a template and a search look like…

---

## [High CPU Utilized by JAVA in single node ELK #31089](https://discuss.elastic.co/t/high-cpu-utilized-by-java-in-single-node-elk-31089/134563)

<div class="topic-metadata">

**Author:** [@Prabhu2430](https://discuss.elastic.co/u/Prabhu2430)\
**Replies:** 11\
**Last updated:** [June 21, 2018, 2:36pm UTC](https://discuss.elastic.co/t/high-cpu-utilized-by-java-in-single-node-elk-31089/134563 "2018-06-21T14:36:59Z")

</div>

We are experiencing high CPU utilization when starting the elasticsearch & logstash services simultaneously. The JAVA process is occupying more than 300% CPU. The elasticsearch holds some multiple JAVA threads and make…

[Previous page](https://discuss.elastic.co/c/elastic-stack/elasticsearch/6.md?page=1642)

[Next page](https://discuss.elastic.co/c/elastic-stack/elasticsearch/6.md?page=1644)
