I'm trying to search for mails to "John Smith". If I will just search like:
{
"bool": {
"must": [
{
"name.first_name": {
"user": "Jonh"
}
},
{
"name.second_name": {
"user": "Smith"
}
}
]
}
}
I'm getting document I've described - it have somebody with first name "John" as recipient and somebody whos second name is Smith. But it is not correct, because I want to get mails to "John Smith" really.
Very silly question, but I can't understand how to solve it
You'll need to use Nested documents or Parent/Child. Inner objects like
you have do not maintain relations between elements. The fields just
become bags of values:
I'm trying to search for mails to "John Smith". If I will just search
like:
{
"bool": {
"must": [
{
"name.first_name": {
"user": "Jonh"
}
},
{
"name.second_name": {
"user": "Smith"
}
}
]
}
}
I'm getting document I've described - it have somebody with first name
"John" as recipient and somebody whos second name is Smith. But it is not
correct, because I want to get mails to "John Smith" really.
Very silly question, but I can't understand how to solve it
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.