# Curious Query Question

**URL:** <https://discuss.elastic.co/t/curious-query-question/15409>\
**Category:** Elasticsearch\
**Created:** [January 25, 2014, 1:00am UTC](https://discuss.elastic.co/t/curious-query-question/15409 "2014-01-25T01:00:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackpark](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jackpark](https://discuss.elastic.co/u/jackpark)\
**Post date:** [January 25, 2014, 1:00am UTC](https://discuss.elastic.co/t/curious-query-question/15409/1 "2014-01-25T01:00:54Z")

</div>

I have a nested structure, where I am capturing labels against their  
language, thus:

```
"label": {
    "en": [
        "Ontology Inverse Functional Property Type"
    ]
},

```

My question: what does a query look like to find an object with a  
label such as that one? or one for a different language?

Many thanks in advance  
Jack

--  
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/CAH6s0fyew1gbDsCj%2BQ%3DgjiH-K6BTKsWseBCg8aJDjA7MpAkjzA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fyew1gbDsCj%2BQ%3DgjiH-K6BTKsWseBCg8aJDjA7MpAkjzA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [January 25, 2014, 12:14pm UTC](https://discuss.elastic.co/t/curious-query-question/15409/2 "2014-01-25T12:14:32Z")

</div>

You want something like:

curl localhost:9200/\_search -d '  
{  
"query": {  
"match": {  
"label.en": "property type"  
}  
}  
}'

clint

On 25 January 2014 02:00, Jack Park [jackpark@topicquests.org](mailto:jackpark@topicquests.org) wrote:

> I have a nested structure, where I am capturing labels against their  
> language, thus:
> 
> ```
> "label": {
> "en": [
> "Ontology Inverse Functional Property Type"
> ]
> },
> 
> ```
> 
> My question: what does a query look like to find an object with a  
> label such as that one? or one for a different language?
> 
> Many thanks in advance  
> Jack
> 
> --  
> 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/CAH6s0fyew1gbDsCj%2BQ%3DgjiH-K6BTKsWseBCg8aJDjA7MpAkjzA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fyew1gbDsCj%2BQ%3DgjiH-K6BTKsWseBCg8aJDjA7MpAkjzA%40mail.gmail.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPt3XKREPV%2BjQBOhQjWh4CXN%2Be%3Dg0x41o-a7sWZ0-9E9%2BNHeMg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPt3XKREPV%2BjQBOhQjWh4CXN%2Be%3Dg0x41o-a7sWZ0-9E9%2BNHeMg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jackpark](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jackpark](https://discuss.elastic.co/u/jackpark)\
**Post date:** [January 25, 2014, 3:54pm UTC](https://discuss.elastic.co/t/curious-query-question/15409/3 "2014-01-25T15:54:13Z")

</div>

Great idea!  
Close, but didn't work, but that got me to playing with  
QueryBuilders.matchQuery, landing on this:  
{  
"match" : {  
"label.en" : {  
"query" : "Ontology Inverse Functional Property Type",  
"type" : "boolean"  
}  
}  
}

which worked fine!  
It did not occur to me that one could treat the query as a path query  
along nested properties.

Many thanks.

On Sat, Jan 25, 2014 at 4:14 AM, Clinton Gormley [clint@traveljury.com](mailto:clint@traveljury.com) wrote:

> You want something like:
> 
> curl localhost:9200/\_search -d '  
> {  
> "query": {  
> "match": {  
> "label.en": "property type"  
> }  
> }  
> }'
> 
> clint
> 
> On 25 January 2014 02:00, Jack Park [jackpark@topicquests.org](mailto:jackpark@topicquests.org) wrote:
> 
> > I have a nested structure, where I am capturing labels against their  
> > language, thus:
> > 
> > ```
> > "label": {
> > "en": [
> > "Ontology Inverse Functional Property Type"
> > ]
> > },
> > 
> > ```
> > 
> > My question: what does a query look like to find an object with a  
> > label such as that one? or one for a different language?
> > 
> > Many thanks in advance  
> > Jack
> > 
> > --  
> > 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/CAH6s0fyew1gbDsCj%2BQ%3DgjiH-K6BTKsWseBCg8aJDjA7MpAkjzA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fyew1gbDsCj%2BQ%3DgjiH-K6BTKsWseBCg8aJDjA7MpAkjzA%40mail.gmail.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAPt3XKREPV%2BjQBOhQjWh4CXN%2Be%3Dg0x41o-a7sWZ0-9E9%2BNHeMg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPt3XKREPV%2BjQBOhQjWh4CXN%2Be%3Dg0x41o-a7sWZ0-9E9%2BNHeMg%40mail.gmail.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAH6s0fxcaUPZOs3Q1f975nNqFvxCfk%3DSNLmeLEwhytW5QEc0aw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fxcaUPZOs3Q1f975nNqFvxCfk%3DSNLmeLEwhytW5QEc0aw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:54am UTC](https://discuss.elastic.co/t/curious-query-question/15409/4 "2017-07-06T01:54:48Z")

</div>


