# Elasticsearch

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

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

**Page:** 1690

---

## [Getting value out of Script Fields](https://discuss.elastic.co/t/getting-value-out-of-script-fields/131807)

<div class="topic-metadata">

**Author:** [@Airn5475](https://discuss.elastic.co/u/Airn5475)\
**Replies:** 0\
**Last updated:** [May 14, 2018, 7:05pm UTC](https://discuss.elastic.co/t/getting-value-out-of-script-fields/131807 "2018-05-14T19:05:56Z")

</div>

I am trying to extract a script field from my response using Elasticsearch Nest. Here's the working script\_fields from my query: "script\_fields": { "distance\_in\_miles": { "script": { "source": "doc\['l…

---

## [Our production elasticSearch index gets dropped every week by mistake](https://discuss.elastic.co/t/our-production-elasticsearch-index-gets-dropped-every-week-by-mistake/131798)

<div class="topic-metadata">

**Author:** [@avboivin](https://discuss.elastic.co/u/avboivin)\
**Replies:** 0\
**Last updated:** [May 14, 2018, 5:50pm UTC](https://discuss.elastic.co/t/our-production-elasticsearch-index-gets-dropped-every-week-by-mistake/131798 "2018-05-14T17:50:11Z")

</div>

For the past 2 mondays, I come in the office and our main elasticsearch index has been dropped and recreated during the weekend. We "sync" our ES instance from SqlServer using code which has been written 2-3 years ago a…

---

## [Painless DistanceInMiles](https://discuss.elastic.co/t/painless-distanceinmiles/131795)

<div class="topic-metadata">

**Author:** [@Airn5475](https://discuss.elastic.co/u/Airn5475)\
**Replies:** 0\
**Last updated:** [May 14, 2018, 5:38pm UTC](https://discuss.elastic.co/t/painless-distanceinmiles/131795 "2018-05-14T17:38:23Z")

</div>

I am trying to return the distance an entity is away from from a given point. I'm using Elasticesearch v6.2.3. I saw that the DistanceInMiles function has been deprecated and that I should switch to using ArcDistance, P…

---

## [Elasticsearch Increased Latency - 1 of 2 Nodes Until Reboot](https://discuss.elastic.co/t/elasticsearch-increased-latency-1-of-2-nodes-until-reboot/131792)

<div class="topic-metadata">

**Author:** [@jwg2s](https://discuss.elastic.co/u/jwg2s)\
**Replies:** 0\
**Last updated:** [May 14, 2018, 5:12pm UTC](https://discuss.elastic.co/t/elasticsearch-increased-latency-1-of-2-nodes-until-reboot/131792 "2018-05-14T17:12:03Z")

</div>

Hey guys, We're currently using Elastic Cloud, and we've noticed a pattern that occurs with our production cluster that involves us having to reboot about once a week. We store contact information in our cluster, so we…

---

## [When server A is turned off, then servers B and C are not available. This is normal?](https://discuss.elastic.co/t/when-server-a-is-turned-off-then-servers-b-and-c-are-not-available-this-is-normal/131709)

<div class="topic-metadata">

**Author:** [@clgs](https://discuss.elastic.co/u/clgs)\
**Replies:** 11\
**Last updated:** [May 14, 2018, 4:37pm UTC](https://discuss.elastic.co/t/when-server-a-is-turned-off-then-servers-b-and-c-are-not-available-this-is-normal/131709 "2018-05-14T16:37:45Z")

</div>

Hi. We have three servers (A, B and C). Server A must be made a master. Servers B and C with slaves. Server A: node.master: true node.data: true node.ingest: false discovery.zen.ping.unicast.hosts: \["A", "B", "C"…

---

## [Operators not detected in analysis](https://discuss.elastic.co/t/operators-not-detected-in-analysis/131743)

<div class="topic-metadata">

**Author:** [@ivanqwam](https://discuss.elastic.co/u/ivanqwam)\
**Replies:** 4\
**Last updated:** [May 14, 2018, 4:11pm UTC](https://discuss.elastic.co/t/operators-not-detected-in-analysis/131743 "2018-05-14T16:11:45Z")

</div>

When running this query, as a query\_string : voyagé AND en AND Italie finds nothing, despite several documents containing "Nous avons voyagé en Italie". (forget the discussion about writing queries, this what our use…

---

## [Is this a correct query? i need to confirm, can i use multiple must in a single query](https://discuss.elastic.co/t/is-this-a-correct-query-i-need-to-confirm-can-i-use-multiple-must-in-a-single-query/131524)

<div class="topic-metadata">

**Author:** [@addanuj](https://discuss.elastic.co/u/addanuj)\
**Replies:** 2\
**Last updated:** [May 14, 2018, 3:46pm UTC](https://discuss.elastic.co/t/is-this-a-correct-query-i-need-to-confirm-can-i-use-multiple-must-in-a-single-query/131524 "2018-05-14T15:46:39Z")

</div>

I am getting "multiple must" syntex error in DevTools in below query, i want to use multiple must statement GET logstash-security-\*/\_search { "query": { "bool": { "must": { "bool" : { "should": \[ { "match": { "tit…

---

## [Fresh install, OutOfMemory error blues](https://discuss.elastic.co/t/fresh-install-outofmemory-error-blues/131776)

<div class="topic-metadata">

**Author:** [@DylanBaxter](https://discuss.elastic.co/u/DylanBaxter)\
**Replies:** 1\
**Last updated:** [May 14, 2018, 3:42pm UTC](https://discuss.elastic.co/t/fresh-install-outofmemory-error-blues/131776 "2018-05-14T15:42:19Z")

</div>

Fresh install on a VM (CentOS) with 11Gb of RAM, and it doesn't matter what I set Xms/Xmx to I get OutOfMemory. Can someone tell from this log what I am missing? \[2018-05-14T08:15:51,069\]\[INFO \]\[o.e.n.Node …

---

## [Avoid eventual consistency in time series event](https://discuss.elastic.co/t/avoid-eventual-consistency-in-time-series-event/131775)

<div class="topic-metadata">

**Author:** [@LucaMazzanti](https://discuss.elastic.co/u/LucaMazzanti)\
**Replies:** 0\
**Last updated:** [May 14, 2018, 3:22pm UTC](https://discuss.elastic.co/t/avoid-eventual-consistency-in-time-series-event/131775 "2018-05-14T15:22:55Z")

</div>

Hi, i'm logging time series events, and some clients read from this index sequentially, they take the top X items filtered by a fixed teanant query, and the next time they poll, the continue filtering by an orderer id \> …

---

## [How to restore AWS Elasticsearch cluster snapshot from S3 to on-premise server](https://discuss.elastic.co/t/how-to-restore-aws-elasticsearch-cluster-snapshot-from-s3-to-on-premise-server/131774)

<div class="topic-metadata">

**Author:** [@Sreenath11](https://discuss.elastic.co/u/Sreenath11)\
**Replies:** 0\
**Last updated:** [May 14, 2018, 3:22pm UTC](https://discuss.elastic.co/t/how-to-restore-aws-elasticsearch-cluster-snapshot-from-s3-to-on-premise-server/131774 "2018-05-14T15:22:44Z")

</div>

I already took the snapshot of AWS elastic search cluster and stored in S3 by following this: We had an elastic search cluster of 6 nodes on on-premise servers. How to restore AWS Elasticsearch cluster snapshot from …

---

## [Can't get document by id](https://discuss.elastic.co/t/cant-get-document-by-id/131759)

<div class="topic-metadata">

**Author:** [@fabiocatalao](https://discuss.elastic.co/u/fabiocatalao)\
**Replies:** 2\
**Last updated:** [May 14, 2018, 3:12pm UTC](https://discuss.elastic.co/t/cant-get-document-by-id/131759 "2018-05-14T15:12:08Z")

</div>

Hi, I'm being unable to get documents that I index using Java API from the index by id. I'm using the following code to prepare the index: IndexRequest indexRequest = new IndexRequest(myindex, mytype, myid) …

---

## [Setup security for a cluster created with docker-compose](https://discuss.elastic.co/t/setup-security-for-a-cluster-created-with-docker-compose/131171)

<div class="topic-metadata">

**Author:** [@dao](https://discuss.elastic.co/u/dao)\
**Replies:** 4\
**Last updated:** [May 14, 2018, 2:51pm UTC](https://discuss.elastic.co/t/setup-security-for-a-cluster-created-with-docker-compose/131171 "2018-05-14T14:51:37Z")

</div>

Hello, Is there a documentation for that? This documentation explains how to setup security and this documentation explains the deployment with docker images. Is there a in-between documentation? regards

---

## [Filter based on scripted field in an aggregation](https://discuss.elastic.co/t/filter-based-on-scripted-field-in-an-aggregation/128976)

<div class="topic-metadata">

**Author:** [@nishantkumar](https://discuss.elastic.co/u/nishantkumar)\
**Replies:** 6\
**Last updated:** [May 14, 2018, 2:45pm UTC](https://discuss.elastic.co/t/filter-based-on-scripted-field-in-an-aggregation/128976 "2018-05-14T14:45:06Z")

</div>

Here is my source: { "size": 0, "query": { "bool": { "must": \[ { "range": { "datetime": { "gte": "2017-04-01T00:00:00.000Z", "lte": "2018-03-31T23…

---

## [Newbie performance troubleshooting, high load spikes on ES nodes](https://discuss.elastic.co/t/newbie-performance-troubleshooting-high-load-spikes-on-es-nodes/131220)

<div class="topic-metadata">

**Author:** [@rrue](https://discuss.elastic.co/u/rrue)\
**Replies:** 4\
**Last updated:** [May 14, 2018, 2:23pm UTC](https://discuss.elastic.co/t/newbie-performance-troubleshooting-high-load-spikes-on-es-nodes/131220 "2018-05-14T14:23:39Z")

</div>

Hi All, I'm running a 3-node RELK cluster that's mostly storing application logs coming in via a syslog listener (logstash shipper). We have ~1800 indices ranging from thousands of docs/events and trivial size to some (…

---

## [Querying for remote indexes via cross cluster search](https://discuss.elastic.co/t/querying-for-remote-indexes-via-cross-cluster-search/131754)

<div class="topic-metadata">

**Author:** [@bbailey](https://discuss.elastic.co/u/bbailey)\
**Replies:** 0\
**Last updated:** [May 14, 2018, 2:05pm UTC](https://discuss.elastic.co/t/querying-for-remote-indexes-via-cross-cluster-search/131754 "2018-05-14T14:05:17Z")

</div>

Sorry of this is a dumb question but my expectation is that despite switching from tribe nodes to cross cluster search nodes I should be able to query all the names of my remote indices using a browser. It seems that is…

---

## [Deep Aggregation Support](https://discuss.elastic.co/t/deep-aggregation-support/131720)

<div class="topic-metadata">

**Author:** [@Robert\_George](https://discuss.elastic.co/u/Robert_George)\
**Replies:** 10\
**Last updated:** [May 14, 2018, 1:43pm UTC](https://discuss.elastic.co/t/deep-aggregation-support/131720 "2018-05-14T13:43:27Z")

</div>

Hi. I do have a question. Does elasticsearch support deep aggregations? (nested aggregation in nested aggregation). To make agg of a nested object inside a nested object. Specifically to count docs. If so, please give…

---

## [Best way to configure load balancer before elastic search cluster](https://discuss.elastic.co/t/best-way-to-configure-load-balancer-before-elastic-search-cluster/131695)

<div class="topic-metadata">

**Author:** [@shobhana](https://discuss.elastic.co/u/shobhana)\
**Replies:** 1\
**Last updated:** [May 14, 2018, 1:20pm UTC](https://discuss.elastic.co/t/best-way-to-configure-load-balancer-before-elastic-search-cluster/131695 "2018-05-14T13:20:25Z")

</div>

Currently we have a 3 node cluster running 6.2 version in GCP with no dedicated master nodes. All are identical in terms of configuration (4 vCPU, 15 GB RAM nodes - 7GB set as xmx for ES) and settings. We use org.elastic…

---

## [Simulating exact Kibana dev tool query in nodejs](https://discuss.elastic.co/t/simulating-exact-kibana-dev-tool-query-in-nodejs/131609)

<div class="topic-metadata">

**Author:** [@mghildiy](https://discuss.elastic.co/u/mghildiy)\
**Replies:** 1\
**Last updated:** [May 14, 2018, 1:02pm UTC](https://discuss.elastic.co/t/simulating-exact-kibana-dev-tool-query-in-nodejs/131609 "2018-05-14T13:02:10Z")

</div>

Hi, I have queries working in Kibana dev tool. Like this one: GET /myindex/books/\_search { "size":2, "from":0, "query": { "match\_all":{} } } I want to simulate exact same queries in javascript. Meaning user w…

---

## [Insert data from json files](https://discuss.elastic.co/t/insert-data-from-json-files/131730)

<div class="topic-metadata">

**Author:** [@M.alsioufi](https://discuss.elastic.co/u/M.alsioufi)\
**Replies:** 0\
**Last updated:** [May 14, 2018, 11:47am UTC](https://discuss.elastic.co/t/insert-data-from-json-files/131730 "2018-05-14T11:47:07Z")

</div>

I have a python script that creates a JSON file every now and then (no specific schedule) I want to store this JSON file in elasticsearch when it is created. What is the best tool in elastic-stack to handle this? Is it c…

---

## [Elasticsearch PHP](https://discuss.elastic.co/t/elasticsearch-php/131723)

<div class="topic-metadata">

**Author:** [@Ole](https://discuss.elastic.co/u/Ole)\
**Replies:** 1\
**Last updated:** [May 14, 2018, 11:33am UTC](https://discuss.elastic.co/t/elasticsearch-php/131723 "2018-05-14T11:33:54Z")

</div>

I do not know if this is the right place to post this or if I've explained the problem well enough. If there is a problem with how I explained it or if there is a more appropiate place to post this I would be glad to kno…

---

## [Tokenize a query string](https://discuss.elastic.co/t/tokenize-a-query-string/131710)

<div class="topic-metadata">

**Author:** [@astropanic](https://discuss.elastic.co/u/astropanic)\
**Replies:** 2\
**Last updated:** [May 14, 2018, 11:29am UTC](https://discuss.elastic.co/t/tokenize-a-query-string/131710 "2018-05-14T11:29:43Z")

</div>

How I can tokenize a query string? for example ".../?x=1&y=foo&z=bar" I want be able to search for all documents where y equals foo

---

## [Sequential data processing](https://discuss.elastic.co/t/sequential-data-processing/131520)

<div class="topic-metadata">

**Author:** [@nabha](https://discuss.elastic.co/u/nabha)\
**Replies:** 5\
**Last updated:** [May 14, 2018, 10:18am UTC](https://discuss.elastic.co/t/sequential-data-processing/131520 "2018-05-14T10:18:04Z")

</div>

Does Elasticsearch process data sequentially? I want to use elasticsearch with filebeat as no need to filter any kind of data. But will it process sequentially or non-sequentially. I just want to process data sequenti…

---

## [Is there a difference between query\_string, wildcard and match?](https://discuss.elastic.co/t/is-there-a-difference-between-query-string-wildcard-and-match/131681)

<div class="topic-metadata">

**Author:** [@randomuser](https://discuss.elastic.co/u/randomuser)\
**Replies:** 4\
**Last updated:** [May 14, 2018, 9:45am UTC](https://discuss.elastic.co/t/is-there-a-difference-between-query-string-wildcard-and-match/131681 "2018-05-14T09:45:18Z")

</div>

Hello guys, I've created a few variations of a query and tried out different searching approaches, I seem to be getting the same results, so it got me wondering are there any differences (e.g. performance wise) between …

---

## [Elastic search clustering error](https://discuss.elastic.co/t/elastic-search-clustering-error/131689)

<div class="topic-metadata">

**Author:** [@suresh.svkp](https://discuss.elastic.co/u/suresh.svkp)\
**Replies:** 3\
**Last updated:** [May 14, 2018, 9:38am UTC](https://discuss.elastic.co/t/elastic-search-clustering-error/131689 "2018-05-14T09:38:14Z")

</div>

cluster.name: Elk-cluster node.name: node-2 node.master: true node.data: true path.data: /var/lib/elasticsearch path.logs: /var/log/elasticsearch network.host: 10.85.17.xxx http.port: 9200 discovery.zen.ping.unic…

---

## [Force merge elasticsearch](https://discuss.elastic.co/t/force-merge-elasticsearch/131701)

<div class="topic-metadata">

**Author:** [@Hanen](https://discuss.elastic.co/u/Hanen)\
**Replies:** 4\
**Last updated:** [May 14, 2018, 9:32am UTC](https://discuss.elastic.co/t/force-merge-elasticsearch/131701 "2018-05-14T09:32:22Z")

</div>

Hi everyone, I have a cluster with 6 nodes elasticsearch( 1 master node and 5 data nodes) and I have a very important number of documents. I would like to reduce this number using Force Merge. please how can I do it…

---

## [Timelion: Error: in cell #1: Elasticsearch index not found: metricbeat-\*](https://discuss.elastic.co/t/timelion-error-in-cell-1-elasticsearch-index-not-found-metricbeat/131678)

<div class="topic-metadata">

**Author:** [@asalma](https://discuss.elastic.co/u/asalma)\
**Replies:** 4\
**Last updated:** [May 14, 2018, 9:19am UTC](https://discuss.elastic.co/t/timelion-error-in-cell-1-elasticsearch-index-not-found-metricbeat/131678 "2018-05-14T09:19:13Z")

</div>

Hi, I wanted to use Timelion but I have this error : Timelion: Error: in cell #1: Elasticsearch index not found: metricbeat-\* How could I resolve it ?

---

## [How to print a Field value in a Watch](https://discuss.elastic.co/t/how-to-print-a-field-value-in-a-watch/131669)

<div class="topic-metadata">

**Author:** [@addanuj](https://discuss.elastic.co/u/addanuj)\
**Replies:** 3\
**Last updated:** [May 14, 2018, 9:02am UTC](https://discuss.elastic.co/t/how-to-print-a-field-value-in-a-watch/131669 "2018-05-14T09:02:11Z")

</div>

==================Index output==================================== { "took": 590, "timed\_out": false, "\_shards": { "total": 10, "successful": 9, "skipped": 0, "failed": 0 }, "hits": { "total…

---

## [Elasticsearch really needs a "update if document exists" ability](https://discuss.elastic.co/t/elasticsearch-really-needs-a-update-if-document-exists-ability/130493)

<div class="topic-metadata">

**Author:** [@Jason\_Baumgartner](https://discuss.elastic.co/u/Jason_Baumgartner)\
**Replies:** 1\
**Last updated:** [May 14, 2018, 8:59am UTC](https://discuss.elastic.co/t/elasticsearch-really-needs-a-update-if-document-exists-ability/130493 "2018-05-14T08:59:25Z")

</div>

Prior to 6.x, I believe something like this would work: {"update":{"\_type":"submission","\_index":"rs\_2018-05","\_id":511393606}} {"script":{"source":"ctx.\_source.num\_comments += params.count","lang":"painless","params":…

---

## [Sort aggregation on word frequency count instead of doc\_count](https://discuss.elastic.co/t/sort-aggregation-on-word-frequency-count-instead-of-doc-count/131300)

<div class="topic-metadata">

**Author:** [@randomuser](https://discuss.elastic.co/u/randomuser)\
**Replies:** 8\
**Last updated:** [May 14, 2018, 8:48am UTC](https://discuss.elastic.co/t/sort-aggregation-on-word-frequency-count-instead-of-doc-count/131300 "2018-05-14T08:48:26Z")

</div>

Hello, Is there a way to sort aggregation buckets based on word count instead of the default doc\_count? For example, a color field might contain: "red blue green table" "red red red red table" "blue yellow table" "…

---

## [Ingest-geoip plugin installs in incorrect location](https://discuss.elastic.co/t/ingest-geoip-plugin-installs-in-incorrect-location/129788)

<div class="topic-metadata">

**Author:** [@ORich](https://discuss.elastic.co/u/ORich)\
**Replies:** 2\
**Last updated:** [May 14, 2018, 8:16am UTC](https://discuss.elastic.co/t/ingest-geoip-plugin-installs-in-incorrect-location/129788 "2018-05-14T08:16:09Z")

</div>

It would seem that, when I install the ingest-geoip plugin, it installs the files in /etc/elasticsearch/ingest-geoip, since the process runas as root. However, since ES-HOME for the instance is set as /etc/elasticsearch…

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

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