Nested Query have a default operator?

I ask it before when I looking for "John Joe" it's return all users with
John in the name.

my request

{
"query":{
"nested" : {
"path" : "friends",
"query" : {
"bool" : {
"must" : [
{
"match" : {"friends.name" : "John Doe"}
}
]

            }
        }
    }
}

}'

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I fixed it setting the name field with not_analyzed param :slight_smile:

Em quarta-feira, 15 de maio de 2013 21h32min13s UTC-3, Anderson Bento
escreveu:

I ask it before when I looking for "John Joe" it's return all users with
John in the name.

my request

{
"query":{
"nested" : {
"path" : "friends",
"query" : {
"bool" : {
"must" : [
{
"match" : {"friends.name" : "John Doe"}
}
]

            }
        }
    }
}

}'

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

"name": {"type":"string","index": "not_analyzed"},

Em quarta-feira, 15 de maio de 2013 21h51min40s UTC-3, Anderson Bento
escreveu:

I fixed it setting the name field with not_analyzed param :slight_smile:

Em quarta-feira, 15 de maio de 2013 21h32min13s UTC-3, Anderson Bento
escreveu:

I ask it before when I looking for "John Joe" it's return all users
with John in the name.

my request

{
"query":{
"nested" : {
"path" : "friends",
"query" : {
"bool" : {
"must" : [
{
"match" : {"friends.name" : "John Doe"}
}
]

            }
        }
    }
}

}'

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Anderson

Setting it to not_analyzed may be the way to go, but there are other
approaches too.

For instance, right now a search for "john doe" won't match "John Doe". If
that's what you want, then that's fine.

Alternatively, you could leave the field as analyzed, and change your
search to:

{ match: {
    name: {
        query: "john doe",
        operator: "and"
   }
}

which will only match names that have both "john" and "doe" in them

clint

On 16 May 2013 02:52, Anderson Bento deca.rox@gmail.com wrote:

"name": {"type":"string","index": "not_analyzed"},

Em quarta-feira, 15 de maio de 2013 21h51min40s UTC-3, Anderson Bento
escreveu:

I fixed it setting the name field with not_analyzed param :slight_smile:

Em quarta-feira, 15 de maio de 2013 21h32min13s UTC-3, Anderson Bento
escreveu:

I ask it before when I looking for "John Joe" it's return all users
with John in the name.

my request

{
"query":{
"nested" : {
"path" : "friends",
"query" : {
"bool" : {
"must" : [
{
"match" : {"friends.name" : "John Doe"}
}
]

            }
        }
    }
}

}'

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.