I'm trying to query some indexed data with an array of strings as search input.
The indexed data looks like this:
{
"pubMedID": "21528671",
"title": "Basic fibroblast [...] melanoma cells.",
"abstract": "Human malignant [...] cell growth."
}
I would like to search within the 'title' and 'abstract' fields for multiple strings. For example:
queryString=['melanoma', 'dysplastic nevus syndrome']
I already tried with the following code:
queryString=['melanoma', 'dysplastic nevus syndrome']
payload={
"query": {
"bool": {
"should": [
{
"query_string": {
"query": queryString,
"fields": [
"title",
"abstract"
]
}
}
]
}
}
}
payload_json = (json.dumps(payload))
res = esclient.search(index='medicine',body=payload_json)
But I get the following error when running this:
RequestError: RequestError(400, 'parsing_exception', '[query_string] query does not support [query]')
The query does work fine if I just put in a simple string value. Can someone tell me how I should do this kind of queries where you give as an input an array? Thank you in advance!