Hello,
I've been trying the API call from the Search Applications > Connect features. Can see the screenshot and below is the sample :
POST /_application/search_application/search-my/_search
{
"params": {
"query": "pizza",
"myCustomParameter": "example value"
}
}
We would like to do API call direct to our search engine, rather than Elasticsearch.
We trying to set the params query according to below conditions :
query condition:
- match keyword in title, description, postfiles
- isprivate = false or (isprivate = true and users_in_channel = userId)
- published date in range date
To give you explanation, first condition, we need to set the params to read if match the search query with any field in the data field which is 'title', 'description', 'postfiles', then it will show the search result, this is the first condition.
Second condition, to check the query with the data in search engine, if its match where, if it (isprivate = true and users_in_channel = userId) or if it is not private (isprivate = false).
Lastly, to check the published_date if its within the range date that user filter from the frontend ui, this parameter will be passed also through API to check the range date and filter the data based on this parameter.
Below is our API call that works :
GET /_application/search_application/search-my/_search
{
"params": {
"query_string": "(1234) OR (Testing)"
}
}
GET /_search
{
"query": {
"multi_match": {
"query": "(1234) OR (Testing)",
"fields": ["users_in_channel","title"]
}
}
}
We've been testing around the API and not sure if this is the correct way to set the params for search query.
Need help to construct the API based on mentioned conditions.