How do element-based array query?

Hi guys,

My problem succinctly

POST tweet/test
{
"name": "Stefan",
"address": ["Chine street",
"England country"]
}

POST tweet/test
{
"name": "Heroku",
"address": ["bla bla street",
"China country"]
}

GET tweet/_search
{
"query": {
"query_string": {
"default_field": "address",
"query": "China country",
"default_operator": "AND"
}

}

}

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"
]
}
}
]
}
}

Nasıl haritayı değiştirmeden yalnızca ikinci belge dönmek için alabilirim?

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/647e9c10-f42c-42be-b15c-4603cb8d4c22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

You need to define nested documents.

--
David Pilato - Developer | Evangelist

@dadoonet https://twitter.com/dadoonet | @elasticsearchfr https://twitter.com/elasticsearchfr | @scrutmydocs https://twitter.com/scrutmydocs

Le 18 avr. 2015 à 16:33, Terra Sacer terrasacer@gmail.com a écrit :

Hi guys,

My problem succinctly

POST tweet/test
{
"name": "Stefan",
"address": ["Chine street",
"England country"]
}

POST tweet/test
{
"name": "Heroku",
"address": ["bla bla street",
"China country"]
}

GET tweet/_search
{
"query": {
"query_string": {
"default_field": "address",
"query": "China country",
"default_operator": "AND"
}

}

}

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"
]
}
}
]
}
}

Nasıl haritayı değiştirmeden yalnızca ikinci belge dönmek için alabilirim?

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 mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/647e9c10-f42c-42be-b15c-4603cb8d4c22%40googlegroups.com https://groups.google.com/d/msgid/elasticsearch/647e9c10-f42c-42be-b15c-4603cb8d4c22%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

--
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/A5FC30FB-2869-4EF4-A79F-B5B6478C3C08%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Hello David,

I don't want to use the sub-area(address.street as).

Is it possible another solution?

On Saturday, April 18, 2015 at 6:36:09 PM UTC+3, David Pilato wrote:

You need to define nested documents.

--
David Pilato - Developer | Evangelist
elastic.co http://elastic.co
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr | @scrutmydocs
https://twitter.com/scrutmydocs

Le 18 avr. 2015 à 16:33, Terra Sacer <terra...@gmail.com <javascript:>> a
écrit :

Hi guys,

My problem succinctly

POST tweet/test
{
"name": "Stefan",
"address": ["Chine street",
"England country"]
}

POST tweet/test
{
"name": "Heroku",
"address": ["bla bla street",
"China country"]
}

GET tweet/_search
{
"query": {
"query_string": {
"default_field": "address",
"query": "China country",
"default_operator": "AND"
}

}

}

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"
]
}
}
]
}
}

Nasıl haritayı değiştirmeden yalnızca ikinci belge dönmek için alabilirim?

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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/647e9c10-f42c-42be-b15c-4603cb8d4c22%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/647e9c10-f42c-42be-b15c-4603cb8d4c22%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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/3f2139fa-14ad-4758-a7e8-bf3de8172115%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hello David,

match_phrase was a solution to the problem seems.

On Saturday, April 18, 2015 at 6:36:09 PM UTC+3, David Pilato wrote:

You need to define nested documents.

--
David Pilato - Developer | Evangelist
elastic.co http://elastic.co
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr | @scrutmydocs
https://twitter.com/scrutmydocs

Le 18 avr. 2015 à 16:33, Terra Sacer <terra...@gmail.com <javascript:>> a
écrit :

Hi guys,

My problem succinctly

POST tweet/test
{
"name": "Stefan",
"address": ["Chine street",
"England country"]
}

POST tweet/test
{
"name": "Heroku",
"address": ["bla bla street",
"China country"]
}

GET tweet/_search
{
"query": {
"query_string": {
"default_field": "address",
"query": "China country",
"default_operator": "AND"
}

}

}

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"
]
}
}
]
}
}

Nasıl haritayı değiştirmeden yalnızca ikinci belge dönmek için alabilirim?

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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/647e9c10-f42c-42be-b15c-4603cb8d4c22%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/647e9c10-f42c-42be-b15c-4603cb8d4c22%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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/8f1e8f00-81e8-4d38-9c52-b88c4eb1eabc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.