I have following document structure:
Movie:
{
id: int,
title: string,
language: string,
genre: string,
description: string,
cast: array[string],
directors: array[string],
(...)
}
Now, in the web interface, the user can choose (checkbox) the language, genre, directors etc and type some query to the search box.
Let's say I want to search within all thrillers (genre), that are in French or English (language), directed by James Cameron or George Lucas (directors) and I'm typing to the search box "abc" that I would like to find within title or description.
What I want as a result: - only movies only in French or English - only movies directed by James Cameron or George Lucas - only thrillers - movies that corresponds to "abc"
I'm not sure how to do the OR in the filters, but I have started from something like:
curl -X -XGET 'localhost:9200/movies/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query" : {
"constant_score" : {
"filter" : {
"bool" : {
"should" : [
{ "term" : {"language" : "french"}},
{ "term" : {"language" : "english"}},
{ "term" : {"directors" : "James Cameron"}},
{ "term" : {"directors" : "George Lucas"}}
],
"filter" : [
{ "term" : {"genre" : "thriller"}}
]
}
}
}
}
}
'
Could you please give me some hints?