# Elastic Query DSL Help

**URL:** <https://discuss.elastic.co/t/elastic-query-dsl-help/158425>\
**Category:** Elasticsearch\
**Created:** [November 27, 2018, 10:02pm UTC](https://discuss.elastic.co/t/elastic-query-dsl-help/158425 "2018-11-27T22:02:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dallas\_Toth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dallas_toth/32/22630_2.png) [@Dallas\_Toth](https://discuss.elastic.co/u/Dallas_Toth)\
**Post date:** [November 27, 2018, 10:02pm UTC](https://discuss.elastic.co/t/elastic-query-dsl-help/158425/1 "2018-11-27T22:02:39Z")

</div>

I am having issues with this query.  
The idea is that I want to find all docs that have _vaccin_ OR drva\* OR _wellness_ in any of the fields "description","code","profitcenter","itemcategory" The below is what I have and it seems to work partially. In Kibana as a filter it will work but for some reason only on one of the index's I have 2 indexes and between the 2 they do share some of the same field names.

> {  
> "query": {  
> "query\_string": {  
> "analyze\_wildcard": true,  
> "fields": [  
> "description",  
> "code",  
> "profitcenter",  
> "itemcategory"  
> ],  
> "query": " vaccin\* OR drva\* OR wellness\*",  
> "use\_dis\_max": true  
> }  
> }  
> }

---

<div class="post-metadata">

**Author:** ![mjunaidmuzammil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mjunaidmuzammil/32/56910_2.png) [@mjunaidmuzammil](https://discuss.elastic.co/u/mjunaidmuzammil)\
**Post date:** [November 28, 2018, 8:50am UTC](https://discuss.elastic.co/t/elastic-query-dsl-help/158425/2 "2018-11-28T08:50:45Z")

</div>

Can you check mappings for the two indices? They should be identical on both of them.

---

<div class="post-metadata">

**Author:** ![Dallas\_Toth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dallas_toth/32/22630_2.png) [@Dallas\_Toth](https://discuss.elastic.co/u/Dallas_Toth)\
**Post date:** [November 29, 2018, 5:41am UTC](https://discuss.elastic.co/t/elastic-query-dsl-help/158425/3 "2018-11-29T05:41:09Z")

</div>

I know the code field is only available in one but the other 3 fields are all named the same.

---

<div class="post-metadata">

**Author:** ![mjunaidmuzammil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mjunaidmuzammil/32/56910_2.png) [@mjunaidmuzammil](https://discuss.elastic.co/u/mjunaidmuzammil)\
**Post date:** [November 30, 2018, 8:43am UTC](https://discuss.elastic.co/t/elastic-query-dsl-help/158425/4 "2018-11-30T08:43:08Z")

</div>

Can you share the mappings for both the indices?

---

<div class="post-metadata">

**Author:** ![Dallas\_Toth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dallas_toth/32/22630_2.png) [@Dallas\_Toth](https://discuss.elastic.co/u/Dallas_Toth)\
**Post date:** [November 30, 2018, 9:14pm UTC](https://discuss.elastic.co/t/elastic-query-dsl-help/158425/5 "2018-11-30T21:14:12Z")

</div>

The transactions Mappings  
[https://pastebin.com/i9kDQSFK](https://pastebin.com/i9kDQSFK)  
Has "description","code","profitcenter","itemcategory"

The Compensation Mapping  
[https://pastebin.com/wjC3TKuS](https://pastebin.com/wjC3TKuS)  
Has "description","profitcenter","itemcategory"

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 28, 2018, 9:14pm UTC](https://discuss.elastic.co/t/elastic-query-dsl-help/158425/6 "2018-12-28T21:14:32Z")

</div>

Closed on December 28, 2018, 9:14pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
