Curious Query Question


(Jack Park) #1

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.
To view this discussion on the web visit 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.


(Clinton Gormley) #2

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 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.
To view this discussion on the web visit
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.

--
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/CAPt3XKREPV%2BjQBOhQjWh4CXN%2Be%3Dg0x41o-a7sWZ0-9E9%2BNHeMg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Jack Park) #3

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 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 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.
To view this discussion on the web visit
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.

--
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/CAPt3XKREPV%2BjQBOhQjWh4CXN%2Be%3Dg0x41o-a7sWZ0-9E9%2BNHeMg%40mail.gmail.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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAH6s0fxcaUPZOs3Q1f975nNqFvxCfk%3DSNLmeLEwhytW5QEc0aw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #4