Why is this query not working?

I have both 'title' and 'name' fields that are objects and can contain
multiple locales, i.e.

"title": {
"properties": {
"en": {
...
},
"es" :{
...
}
}
}

"name": {
"properties": {
"en": {
...
},
"es" :{
...
}
}
}

If I do a search on the English title field:

{
"from" : 0,
"size" : 20,
"query" : {
"query_string" : {
"query" : "title.en:elastic"
}
}
}

I am getting a match on the 'name' field. When I look at the translated
Lucene query in Inquistor it translates to:

en:elastic

Why is it removing the 'title' field from the query?

--
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.

Dan,

It appears as if you are defining title and name as types, not as fields.
Both types have the en field, and for a query that doesn't restrict based
on types it searches the en field in both of the types.

What you really want is the title and name fields defined as multi_fieldmappings within some type. And then the sub-mapping of the same name is the
default. For example, here is an excerpt of one of my own field mappings
from an exploratory schema. It is for the cn (common name, in LDAP
parlance) field:

"cn" : {
"type" : "multi_field",
"fields" : {
"cn" : {
"type" : "string",
"analyzer" : "english_stemming_analyzer"
},
"finnish" : {
"type" : "string",
"analyzer" : "finnish_stemming_analyzer"
},
"arabic" : {
"type" : "string",
"analyzer" : "arabic_stemming_Arabic_analyzer"
},
"raw" : {
"type" : "string",
"index" : "not_analyzed"
}
}
},

Then, a Lucene query string for cn: chooses the english_stemming_analyzer,
while cn.finnish chooses the finnish_stemming_analyzer. And so on. Of
course, the actual specifications of these analyzers is not shown here.

Hope this helps.

Brian

--
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.