Im having trouble building complex queries. I have the following query:
{
"q": {"_or":[{"_text_all":{"patent_title":"cancer"}},{"_text_all":{"patent_abstract":"cancer"}}]},
"o": {"page":1,"per_page":10},
"f": ["patent_id","patent_number","patent_date", "patent_title"]
}
Which returns
{
"patents": [
{
"patent_id": "10000443",
"patent_number": "10000443",
"patent_date": "2018-06-19",
"patent_title": "Compositions and methods for glucose transport inhibition"
}, ...
"total_patent_count": 32107
}
Now, If I do the following query, I would expect to still have results, albeit a lot less than the 32 K, since the first patent_date in the results is 2018-06-19.
{
"q": {
"_and": [
{"_or":[{"_text_all":{"patent_title":"cancer"}},{"_text_all":{"patent_abstract":"cancer"}}]},
{"_gte":{"patent_date":"2018-01-01"}}
]
},
"o": {"page":1,"per_page":10},
"f": ["patent_id","patent_number","patent_date", "patent_title"]
}
In my mind, this query should fetch all the results that have the word cancer in the title or the abstract AND their patent_date is greater than 2018-01-01. But the result Im getting is
{
"patents": null,
"count": 0,
"total_patent_count": 0
}