I am quite new in elastic search and trying to query a data where i need to add filters based on
fields where sorting will also be there which will be in A-Z / Z-A sorting.
here is the request
{
"query": {
"bool": {
"must": [
{"match_phrase": {"categories_filter": "hollywood"}},
{"match_phrase": {"sub_categories_filter": "Sub-Category 7"} },
------ Want to add sorting here--------------
]
}
if i can tell you in mysql query, my data will be fetched like below given query
select * from movies where categories_filter='hollywood' AND
sub_categories_filter='sub-category7' AND genre='Drama' and so on ORDER BY (A-Z / Z-A) DESC...SO the whole set of record come in alphabetically ordered.
Kindly let me know if your given URL will work as per my requirement.
So here is the issue which I am facing right now, which is having 'AND' search as given below example..
Suppose I have selected
Category - Hollywood
Sub-Category - Bond Special
Genre - Action & Drama & Comedy ( as multiple selection will be there )
Language - English, Russian and Hindi ( as multiple selection will be there)
Release Year - 1990,1999,2000 ( as multiple selection will be there)
3D Movie - True OR False (any one will be selected)
and in last
SortBy - “A-Z”OR “Z-A” OR “Date”
Can you help me in making this bulk query for elastic-search. I will use "match_phrase" for making AND condition but the issue is matching parameters are multiple and will be in comma separated (u can say).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.