# Elasticsearch

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

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

**Page:** 1404

---

## [Wrong results appearing in elasticsearch must match query](https://discuss.elastic.co/t/wrong-results-appearing-in-elasticsearch-must-match-query/167275)

<div class="topic-metadata">

**Author:** [@Marium\_Testlio](https://discuss.elastic.co/u/Marium_Testlio)\
**Replies:** 0\
**Last updated:** [February 6, 2019, 11:22am UTC](https://discuss.elastic.co/t/wrong-results-appearing-in-elasticsearch-must-match-query/167275 "2019-02-06T11:22:50Z")

</div>

I have the following Analyzer on the search field: GET \_analyze { "tokenizer": "standard", "filter": \[ "word\_delimiter","lowercase", {"type" : "shingle", "min\_shingle\_size" : 2, …

---

## [Index relationship](https://discuss.elastic.co/t/index-relationship/167267)

<div class="topic-metadata">

**Author:** [@fedwe](https://discuss.elastic.co/u/fedwe)\
**Replies:** 3\
**Last updated:** [February 6, 2019, 11:16am UTC](https://discuss.elastic.co/t/index-relationship/167267 "2019-02-06T11:16:41Z")

</div>

i need help to work around problem. I have 2 files one with a number field and the other with country code and country name. for example i have this number 12398564 and there is the country code 123 of country name x M…

---

## [Verify PKI enabling in elastic nodes](https://discuss.elastic.co/t/verify-pki-enabling-in-elastic-nodes/166744)

<div class="topic-metadata">

**Author:** [@B123](https://discuss.elastic.co/u/B123)\
**Replies:** 21\
**Last updated:** [February 6, 2019, 10:54am UTC](https://discuss.elastic.co/t/verify-pki-enabling-in-elastic-nodes/166744 "2019-02-06T10:54:05Z")

</div>

I have enabled the PKI in elasticsearch.yml as below: xpack.security.authc.realms.pki1.type: pki xpack.security.authc.realms.pki1.order: 1 xpack.security.authc.realms.pki1.certificate\_authorities: \[ path to cacert \] W…

---

## [Filtered Alias not working properly](https://discuss.elastic.co/t/filtered-alias-not-working-properly/167261)

<div class="topic-metadata">

**Author:** [@Praneet\_Khandelwal](https://discuss.elastic.co/u/Praneet_Khandelwal)\
**Replies:** 0\
**Last updated:** [February 6, 2019, 10:31am UTC](https://discuss.elastic.co/t/filtered-alias-not-working-properly/167261 "2019-02-06T10:31:39Z")

</div>

I want to create an alias which points to a certain index pattern but filtered on the basis of a particular field. I ran the following as a curl command. { "actions" : \[ { "add" : { …

---

## [Elasticsearch-php error indexing documents](https://discuss.elastic.co/t/elasticsearch-php-error-indexing-documents/167256)

<div class="topic-metadata">

**Author:** [@xpico](https://discuss.elastic.co/u/xpico)\
**Replies:** 0\
**Last updated:** [February 6, 2019, 9:57am UTC](https://discuss.elastic.co/t/elasticsearch-php-error-indexing-documents/167256 "2019-02-06T09:57:47Z")

</div>

Hi, I have elasticsearch-php code to index documents. Until now that works perfect but now i'm having error when try to index document. This is the error: Fatal error: Uncaught Elasticsearch\\Common\\Exceptions\\BadReque…

---

## [Elasticsearch DSL Scroll error](https://discuss.elastic.co/t/elasticsearch-dsl-scroll-error/167253)

<div class="topic-metadata">

**Author:** [@Shakul\_Mittal](https://discuss.elastic.co/u/Shakul_Mittal)\
**Replies:** 0\
**Last updated:** [February 6, 2019, 9:51am UTC](https://discuss.elastic.co/t/elasticsearch-dsl-scroll-error/167253 "2019-02-06T09:51:39Z")

</div>

I am using this code below and it gives me the following error. from elasticsearch import Elasticsearch, helpers from elasticsearch\_dsl import Search es = Elasticsearch('elasticsearch', port=9200) s = Search(using=es,…

---

## [Prevent auto Index creation without Index Template](https://discuss.elastic.co/t/prevent-auto-index-creation-without-index-template/167126)

<div class="topic-metadata">

**Author:** [@Daniel\_Dalacort](https://discuss.elastic.co/u/Daniel_Dalacort)\
**Replies:** 0\
**Last updated:** [February 5, 2019, 1:20pm UTC](https://discuss.elastic.co/t/prevent-auto-index-creation-without-index-template/167126 "2019-02-05T13:20:02Z")

</div>

Hello, everybody! In short I have an app that generates new index template and send it into elastic on startup. Logs are shipped by Filebeat. In case then I start my app when ES cluster is down I have a job that trying…

---

## [Manage whitelist](https://discuss.elastic.co/t/manage-whitelist/167237)

<div class="topic-metadata">

**Author:** [@DennisSnoek](https://discuss.elastic.co/u/DennisSnoek)\
**Replies:** 2\
**Last updated:** [February 6, 2019, 8:57am UTC](https://discuss.elastic.co/t/manage-whitelist/167237 "2019-02-06T08:57:56Z")

</div>

Dear sir/madam, In October last year I posted this topic already 152175, but there was no reply at all. So, I try again with another title, hopefully there is somebody that can help me with tips on how to manage my whit…

---

## [What is the correct setup needed for remote cluster?](https://discuss.elastic.co/t/what-is-the-correct-setup-needed-for-remote-cluster/167099)

<div class="topic-metadata">

**Author:** [@nikhil.k](https://discuss.elastic.co/u/nikhil.k)\
**Replies:** 11\
**Last updated:** [February 6, 2019, 8:42am UTC](https://discuss.elastic.co/t/what-is-the-correct-setup-needed-for-remote-cluster/167099 "2019-02-06T08:42:25Z")

</div>

Hi Everyone, Elasticsearch version - 6.4.1 Can we have the remote cluster with two nodes which are present in the same cluster (i.e node1 (active master node) and node2 in cluster (cluster name: cluster1))? The reason…

---

## [Document \_type deprecation and upgrade from 6.0 to 6.x](https://discuss.elastic.co/t/document-type-deprecation-and-upgrade-from-6-0-to-6-x/167149)

<div class="topic-metadata">

**Author:** [@74db36a597f21b891b3f](https://discuss.elastic.co/u/74db36a597f21b891b3f)\
**Replies:** 3\
**Last updated:** [February 6, 2019, 8:20am UTC](https://discuss.elastic.co/t/document-type-deprecation-and-upgrade-from-6-0-to-6-x/167149 "2019-02-06T08:20:17Z")

</div>

Hi there. Please give advice for my situation. In my log collection pipeline logstash sort logs by indices using field "type". All ELK clusters has version 6.0. All new indices from main ELK cluster are being reindexed …

---

## [Elasticsearch- Single Index vs Multiple Indexes](https://discuss.elastic.co/t/elasticsearch-single-index-vs-multiple-indexes/164265)

<div class="topic-metadata">

**Author:** [@pranav24](https://discuss.elastic.co/u/pranav24)\
**Replies:** 44\
**Last updated:** [February 6, 2019, 8:15am UTC](https://discuss.elastic.co/t/elasticsearch-single-index-vs-multiple-indexes/164265 "2019-02-06T08:15:57Z")

</div>

Hi I have more than 4000 different fields in one of my index. And that number can grow larger with time. As Elasticsearch give default limit of 1000 field per index. There must be some reason. Now, I am thinking that …

---

## [Get sum of occurrence of an item in an array in an aggregation query](https://discuss.elastic.co/t/get-sum-of-occurrence-of-an-item-in-an-array-in-an-aggregation-query/167239)

<div class="topic-metadata">

**Author:** [@Ijas\_ahamed](https://discuss.elastic.co/u/Ijas_ahamed)\
**Replies:** 0\
**Last updated:** [February 6, 2019, 8:14am UTC](https://discuss.elastic.co/t/get-sum-of-occurrence-of-an-item-in-an-array-in-an-aggregation-query/167239 "2019-02-06T08:14:58Z")

</div>

I have documents of below structure { user\_id: 'user\_id', tags: \['tag\_1', 'tag\_2', 'tag\_3', 'tag\_1'\], time: 123 // timestamp } I used below query to get all users which has a list of tags { "query": { "bool": { …

---

## [Failed to execute bulk item (index) BulkS hardRequest - due to Invalid UTF-8 middle byte exception](https://discuss.elastic.co/t/failed-to-execute-bulk-item-index-bulks-hardrequest-due-to-invalid-utf-8-middle-byte-exception/167238)

<div class="topic-metadata">

**Author:** [@shikhar\_singh](https://discuss.elastic.co/u/shikhar_singh)\
**Replies:** 0\
**Last updated:** [February 6, 2019, 8:04am UTC](https://discuss.elastic.co/t/failed-to-execute-bulk-item-index-bulks-hardrequest-due-to-invalid-utf-8-middle-byte-exception/167238 "2019-02-06T08:04:24Z")

</div>

My ES logs are filled with many such exceptions Caused by: com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 middle byte 0x3c at \[Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInp…

---

## [Getting documents that have a field value within a certain range of that of a particular document, in just one query, given only the document's id?](https://discuss.elastic.co/t/getting-documents-that-have-a-field-value-within-a-certain-range-of-that-of-a-particular-document-in-just-one-query-given-only-the-documents-id/167050)

<div class="topic-metadata">

**Author:** [@Atonal](https://discuss.elastic.co/u/Atonal)\
**Replies:** 2\
**Last updated:** [February 6, 2019, 7:40am UTC](https://discuss.elastic.co/t/getting-documents-that-have-a-field-value-within-a-certain-range-of-that-of-a-particular-document-in-just-one-query-given-only-the-documents-id/167050 "2019-02-06T07:40:17Z")

</div>

The title is pretty self explanatory! I have many documents in an index. Each document has a field X. Given an id i of a document, Is there a way to get the X value of i and return all the documents whose X value is wit…

---

## [Elasticsearch 6.6.0 geo\_shape query on old documents not working after upgrade](https://discuss.elastic.co/t/elasticsearch-6-6-0-geo-shape-query-on-old-documents-not-working-after-upgrade/166962)

<div class="topic-metadata">

**Author:** [@oystein.elvik](https://discuss.elastic.co/u/oystein.elvik)\
**Replies:** 3\
**Last updated:** [February 6, 2019, 7:36am UTC](https://discuss.elastic.co/t/elasticsearch-6-6-0-geo-shape-query-on-old-documents-not-working-after-upgrade/166962 "2019-02-06T07:36:23Z")

</div>

Hi, I just tried to upgrade from elasticsearch 6.2.3 to elasticsearch 6.6.0. After upgrade i find that i get no hits of older documents when using geo\_shape query. I get a match for documents created after upgrade. Th…

---

## [Apply ES Enterprise licence to On Prem Helm K8s ES Cluster](https://discuss.elastic.co/t/apply-es-enterprise-licence-to-on-prem-helm-k8s-es-cluster/167228)

<div class="topic-metadata">

**Author:** [@murtaza1983](https://discuss.elastic.co/u/murtaza1983)\
**Replies:** 1\
**Last updated:** [February 6, 2019, 6:20am UTC](https://discuss.elastic.co/t/apply-es-enterprise-licence-to-on-prem-helm-k8s-es-cluster/167228 "2019-02-06T06:20:19Z")

</div>

How can I apply ES Enterprise Licence to my On Premise ES Cluster deployed on K8s using Helm chart?

---

## [How to create a live search option using elastic search](https://discuss.elastic.co/t/how-to-create-a-live-search-option-using-elastic-search/167220)

<div class="topic-metadata">

**Author:** [@Pathum\_Kalhan](https://discuss.elastic.co/u/Pathum_Kalhan)\
**Replies:** 1\
**Last updated:** [February 6, 2019, 5:48am UTC](https://discuss.elastic.co/t/how-to-create-a-live-search-option-using-elastic-search/167220 "2019-02-06T05:48:33Z")

</div>

I am new to elastic search and playing around with in it. I created an index called live\_search\_index then I add documents contain these title fields. Western province Northern province Colombo district Colombo city Ne…

---

## [Delete multiple docs with matching multiple elements](https://discuss.elastic.co/t/delete-multiple-docs-with-matching-multiple-elements/166343)

<div class="topic-metadata">

**Author:** [@kaushik.vankayala](https://discuss.elastic.co/u/kaushik.vankayala)\
**Replies:** 5\
**Last updated:** [January 31, 2019, 4:07am UTC](https://discuss.elastic.co/t/delete-multiple-docs-with-matching-multiple-elements/166343 "2019-01-31T04:07:52Z")

</div>

Hi There, I have the documents in my index in the following format; { "\_index": "mt\_uat-app", "\_type": "doc", "\_id": "bR2vjmUBJkTWRy0yg7Y1", "\_version": 1, "\_score": 1, "\_source": { "PartnerID": "wireca…

---

## [Sorting root documents based on field in nested documents](https://discuss.elastic.co/t/sorting-root-documents-based-on-field-in-nested-documents/166806)

<div class="topic-metadata">

**Author:** [@Sagar\_Mishra](https://discuss.elastic.co/u/Sagar_Mishra)\
**Replies:** 1\
**Last updated:** [February 5, 2019, 5:06am UTC](https://discuss.elastic.co/t/sorting-root-documents-based-on-field-in-nested-documents/166806 "2019-02-05T05:06:46Z")

</div>

I want to sort root documents according to cost value in nested documents. I tried different approach but failed. Here the output I want to sort on the basis of cost. "hits" : \[ { "\_index" : "providers", "\_ty…

---

## [Loading JSON-LD into ES](https://discuss.elastic.co/t/loading-json-ld-into-es/19970)

<div class="topic-metadata">

**Author:** [@abo](https://discuss.elastic.co/u/abo)\
**Replies:** 21\
**Last updated:** [February 6, 2019, 3:23am UTC](https://discuss.elastic.co/t/loading-json-ld-into-es/19970 "2019-02-06T03:23:59Z")

</div>

Hello, I'm new to Elasticsearch, so forgive me if this is a basic question or if it's in some documentation that I haven't read... I am trying to load a json-ld file into ES. The json-ld file was generated from…

---

## [How to put the result of .py file execution into the Elastic Search](https://discuss.elastic.co/t/how-to-put-the-result-of-py-file-execution-into-the-elastic-search/167204)

<div class="topic-metadata">

**Author:** [@a86236df74eecab0f8a3](https://discuss.elastic.co/u/a86236df74eecab0f8a3)\
**Replies:** 1\
**Last updated:** [February 6, 2019, 3:19am UTC](https://discuss.elastic.co/t/how-to-put-the-result-of-py-file-execution-into-the-elastic-search/167204 "2019-02-06T03:19:40Z")

</div>

Hi I want to put the result of client.py file execution into the Elastic Search using logstash. This is an example of the result value. {u'action': u'select', u'build': 5447, u'http\_method': u'GET', u'name': u'clie…

---

## [\_type deprecated in 6.x?](https://discuss.elastic.co/t/type-deprecated-in-6-x/167200)

<div class="topic-metadata">

**Author:** [@li\_jessen2016](https://discuss.elastic.co/u/li_jessen2016)\
**Replies:** 1\
**Last updated:** [February 6, 2019, 2:03am UTC](https://discuss.elastic.co/t/type-deprecated-in-6-x/167200 "2019-02-06T02:03:14Z")

</div>

From the documents I learn that \_type is deprecated from 6.0.0. But when I use the following syntax: PUT my\_index/1 in elasticsearch 6.5, it returns with the following: { "error": "Incorrect HTTP method for uri \[/my\_…

---

## [How to track down slow queries?](https://discuss.elastic.co/t/how-to-track-down-slow-queries/167040)

<div class="topic-metadata">

**Author:** [@rpm1984](https://discuss.elastic.co/u/rpm1984)\
**Replies:** 1\
**Last updated:** [February 6, 2019, 12:55am UTC](https://discuss.elastic.co/t/how-to-track-down-slow-queries/167040 "2019-02-06T00:55:06Z")

</div>

Hi there, I'm using ElasticCloud to host ES. I'm seeing 'some' slow requests coming from my Azure Web App talking to my ES cluster. Setup: Azure web app: Azure East (Sydney) ES cluster: AWS Sydney, 1 node, 1 primary…

---

## [Get bucket key within scripted\_metric](https://discuss.elastic.co/t/get-bucket-key-within-scripted-metric/167196)

<div class="topic-metadata">

**Author:** [@daddam](https://discuss.elastic.co/u/daddam)\
**Replies:** 0\
**Last updated:** [February 5, 2019, 10:04pm UTC](https://discuss.elastic.co/t/get-bucket-key-within-scripted-metric/167196 "2019-02-05T22:04:12Z")

</div>

Hey guys, is there any way I can grab a bucket's key from within a scripted\_metric? I have an issue where I need to grab some specific data from within a document that is being aggregated. For example, this is an examp…

---

## [It is possible to use Time filter with ElasticSQL on Canvas?](https://discuss.elastic.co/t/it-is-possible-to-use-time-filter-with-elasticsql-on-canvas/166976)

<div class="topic-metadata">

**Author:** [@Miguel\_Plazas](https://discuss.elastic.co/u/Miguel_Plazas)\
**Replies:** 1\
**Last updated:** [February 5, 2019, 8:37pm UTC](https://discuss.elastic.co/t/it-is-possible-to-use-time-filter-with-elasticsql-on-canvas/166976 "2019-02-05T20:37:55Z")

</div>

I would like to filter a essql query the results using only time filter element from canvas, it's possible? This is my ESsql essql query=" SELECT sum(venta) AS sum\_total\_venta FROM \\"demo\_finanzas\_21\\" WHERE divisa…

---

## [Multiple aliases for an index with the same filter](https://discuss.elastic.co/t/multiple-aliases-for-an-index-with-the-same-filter/167024)

<div class="topic-metadata">

**Author:** [@eliw00d](https://discuss.elastic.co/u/eliw00d)\
**Replies:** 7\
**Last updated:** [February 5, 2019, 8:37pm UTC](https://discuss.elastic.co/t/multiple-aliases-for-an-index-with-the-same-filter/167024 "2019-02-05T20:37:47Z")

</div>

Is it not possible to have multiple aliases for a single index where some might have the same filter criteria? I had an alias that needed to be renamed, but I wanted to keep the old one for backwards compatibility. Howev…

---

## [Send IIS logs with Filebeat to ElasticSearch](https://discuss.elastic.co/t/send-iis-logs-with-filebeat-to-elasticsearch/167152)

<div class="topic-metadata">

**Author:** [@Roan](https://discuss.elastic.co/u/Roan)\
**Replies:** 0\
**Last updated:** [February 5, 2019, 3:24pm UTC](https://discuss.elastic.co/t/send-iis-logs-with-filebeat-to-elasticsearch/167152 "2019-02-05T15:24:20Z")

</div>

Hi, I could use some advice. I'm a newbee on filebeat and could use your help. I'm trying to send IIS log files with filebeat to ElasticSearch. But it's not working as how I would like it to do. :thinking: I've a probl…

---

## [How can I select a test document which state has changed from "passed" to "failed"](https://discuss.elastic.co/t/how-can-i-select-a-test-document-which-state-has-changed-from-passed-to-failed/167165)

<div class="topic-metadata">

**Author:** [@andrei1610399](https://discuss.elastic.co/u/andrei1610399)\
**Replies:** 0\
**Last updated:** [February 5, 2019, 5:22pm UTC](https://discuss.elastic.co/t/how-can-i-select-a-test-document-which-state-has-changed-from-passed-to-failed/167165 "2019-02-05T17:22:49Z")

</div>

I have test documents like one below: test\_reslulsts: { "report\_id":"my\_report\_1", "test\_name":"some\_test\_name\_123", "status":"passed" "parent\_details": { "parent\_id":"154865976079", "run\_tag":125 } } I need …

---

## [Documents disappearing?](https://discuss.elastic.co/t/documents-disappearing/167158)

<div class="topic-metadata">

**Author:** [@Delf](https://discuss.elastic.co/u/Delf)\
**Replies:** 1\
**Last updated:** [February 5, 2019, 5:49pm UTC](https://discuss.elastic.co/t/documents-disappearing/167158 "2019-02-05T17:49:08Z")

</div>

Hellow guys ! My post & 1st question here, be kind to me :stuck\_out\_tongue: So here's my problem : we have multiple indices, but the primary and bigger one is starting to lose documents by the seconds I'm talking here. …

---

## [Fast queries in batches](https://discuss.elastic.co/t/fast-queries-in-batches/167160)

<div class="topic-metadata">

**Author:** [@magorbe](https://discuss.elastic.co/u/magorbe)\
**Replies:** 0\
**Last updated:** [February 5, 2019, 4:32pm UTC](https://discuss.elastic.co/t/fast-queries-in-batches/167160 "2019-02-05T16:32:13Z")

</div>

Hi. I'm doing a search on ES and it's: query = { "\_source": false, "query": { "ids": { "values": ids } …

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

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