Elastic Query DSL Help


(Dallas Toth) #1

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
}
}
}


(Junaid) #2

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


(Dallas Toth) #3

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


(Junaid) #4

Can you share the mappings for both the indices?


(Dallas Toth) #5

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

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