I am currently working on migrating from SOLR v3 to Elasticsearch v5.11. My question is, how would I convert the below query string to an Elasticsearch Match/Match Phrase etc equivalent. Is this even possible?
(entityName:(john AND lewis OR "john lewis")
OR entityNameText:(john AND lewis OR "john lewis"))
AND (status( "A" OR "I" status))
I tried to do so, so far only with the first set of brackets but it doesn't seem correct:
{
"bool": {
"should": [
[{
"bool": {
"should": [
[{
"match_phrase": {
"entityName": "john lewis"
}
}]
],
"must": [
[{
"match": {
"entityName": {
"query": "john lewis",
"operator": "and"
}
}
}]
]
}
}, {
"bool": {
"should": [
[{
"match_phrase": {
"entityNameText": "john lewis"
}
}]
],
"must": [
[{
"match": {
"entityNameText": {
"query": "john lewis",
"operator": "and"
}
}
}]
]
}
}]
]
}
}
Thanks
Updated:
entityName and entityNameText are both mapped as text types with custom analyzers for both search and query. Status is mapped as a keyword type.