Hello,
We have quite the situation on our hands.
We need to be able to translate the old ES queries to App Search. How would this be done?
Is this even possible for complexer queries?
We thought of using the /elasticsearch/_search endpoint in appsearch however this does not work with currations/synonyms/relevance tuning, making it useless for our use case.
One of the queries in question (One of the smaller ones):
{
"query": {
"function_score": {
"query": {
"bool": {
"must": [
{
"bool": {
"must": [
{
"match": {
"metadata_44": {
"query": "verslag",
"operator": "and"
}
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"metadata_18.enum": "2019-2024"
}
}
]
}
},
{
"bool": {
"should": [
{
"term": {
"metadata_25.enum": "Some text"
}
}
]
}
}
],
"must_not": []
}
},
"functions": [
{
"weight": 0,
"filter": {
"terms": {
"string": [
"string"
]
}
}
},
{
"script_score": {
"script": {
"source": "COMPLEX SCRIPT"
}
}
}
]
}
},
"aggs": {
"X_TYPE": {
"terms": {
"field": "metadata_25.enum",
"size": 1000,
"order": {
"_count": "desc"
}
}
},
"X_AG": {
"terms": {
"field": "metadata_1.enum",
"size": 1000,
"order": {
"_count": "desc"
}
}
},
"X_AG_TYPE": {
"terms": {
"field": "metadata_2.enum",
"size": 1000,
"order": {
"_count": "desc"
}
}
},
"X_I": {
"terms": {
"field": "metadata_16.enum",
"size": 1000,
"order": {
"_count": "desc"
}
}
},
"X_L": {
"terms": {
"field": "metadata_18.enum",
"size": 1000,
"order": {
"_key": "asc"
}
}
},
"X_Z": {
"terms": {
"field": "metadata_48.enum",
"size": 1000,
"order": {
"_key": "asc"
}
}
},
"X_STATUS": {
"terms": {
"field": "metadata_29.enum",
"size": 1000,
"order": {
"_count": "desc"
}
}
},
"X_IN": {
"terms": {
"field": "metadata_14.enum",
"size": 1000,
"order": {
"_key": "asc"
}
}
},
"X_VR": {
"terms": {
"field": "metadata_47.enum",
"size": 1000,
"order": {
"_key": "asc"
}
}
},
"X_MI": {
"terms": {
"field": "metadata_20.enum",
"size": 1000,
"order": {
"_key": "asc"
}
}
},
"X_INV": {
"terms": {
"field": "metadata_17.enum",
"size": 1000,
"order": {
"_key": "asc"
}
}
},
"X_CO": {
"terms": {
"field": "metadata_8.enum",
"size": 1000,
"order": {
"_count": "desc"
}
}
},
"X_THM": {
"terms": {
"field": "metadata_42.enum",
"size": 1000,
"order": {
"_count": "desc"
}
}
},
"X_SOR": {
"terms": {
"field": "metadata_28.enum",
"size": 1000,
"order": {
"_count": "desc"
}
}
},
"X_YS": {
"terms": {
"field": "metadata_jaar.enum",
"size": 1000,
"order": {
"_key": "asc"
}
}
}
}
}
So our situation is that we need to use app search for this, is this possible?
Again my questions:
- Is it possible to translate queries like this one to App Search?
- Is it possible to get the same results/ results that fit the query ?
- How would I translate this query to app search, and future querries?