How do element-based array query?

Hi guys,

My problem succinctly
POST tweet/test
{

"name": "Stefan",

"address": ["China street",

       "Englang country"]

}

POST tweet/test
{

"name": "Heroku",

"address": ["bla bla street",

       "China country"]

}

Response

{
"took": 1,

"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 0.15342641,
"hits": [
{
"_index": "tweet",
"_type": "test",
"_id": "AUzM7tcIO39NAgkFq0jl",
"_score": 0.15342641,
"_source": {
"name": "Heroku",
"address": [
"China street",
"Englang country"
]
}
},
{
"_index": "tweet",
"_type": "test",
"_id": "AUzM7w2kO39NAgkFq0jm",
"_score": 0.13424811,
"_source": {
"name": "Heroku",
"address": [
"bla bla street",
"China country"
]
}
}
]
}
}

How do I get to return only the second document without changing the map?

Best.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a864e2a8-c713-49b0-b37a-3cc460b5d750%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I'm sorry, I forgot the query :slight_smile:

GET tweet/_search

{

"query": {

   "query_string": {

      "default_field": "address",

      "query": "China country",

      "default_operator": "AND"

   }

}

}

On Saturday, April 18, 2015 at 5:43:04 PM UTC+3, Terra Sacer wrote:

Hi guys,

My problem succinctly
POST tweet/test
{

"name": "Stefan",

"address": ["China street",

       "Englang country"]

}

POST tweet/test
{

"name": "Heroku",

"address": ["bla bla street",

       "China country"]

}

Response

{
"took": 1,

"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 0.15342641,
"hits": [
{
"_index": "tweet",
"_type": "test",
"_id": "AUzM7tcIO39NAgkFq0jl",
"_score": 0.15342641,
"_source": {
"name": "Heroku",
"address": [
"China street",
"Englang country"
]
}
},
{
"_index": "tweet",
"_type": "test",
"_id": "AUzM7w2kO39NAgkFq0jm",
"_score": 0.13424811,
"_source": {
"name": "Heroku",
"address": [
"bla bla street",
"China country"
]
}
}
]
}
}

How do I get to return only the second document without changing the map?

Best.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a1a0c41c-67f3-4e75-9fa3-f06005bb80be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.