Highlighting fields of stored nested document with _source disabled


(angella) #1

Hi all.
I'm experiencing problems trying to highlight fields of nested document.
The parent document has its _source disabled (enabled : false).
Nested document and its fields has store option set to yes. And I'm trying
to query and highlight it with the following request
{
"query": {
"query_string": {
"query": "red"
}
},
"highlight": {
"fields": {
"Metadata.Category": {}
}
}
}

If _source is enabled this request works just fine. But if I disable source
and change mapping to include store option for nested document this doesn't
work(the document is found but not highlighted).

Here is a part of my mapping
{
...
"_source" :{"enabled" :false},
properties: {
...
"Name": {
"type": "multi_field", store : "yes",
"fields": {
"Name": { "type": "string",store : "yes", "analyzer":
"en_analyzer" },
"_Name": { "type": "string",store : "yes", "index":
"not_analyzed" }
}
}
...

      Metadata: {
        store :"yes",
        type: "nested",
        properties: {
           ....
            "Text": {
                "type": "multi_field",  store :"yes",
                "fields": {
                    "Text": {"type": "string", store :"yes", 

"analyzer": "en_analyzer" },
"_Text": { "type": "string",store :"yes", "index":
"not_analyzed" }
}
},
"Category": {
"type": "multi_field", store :"yes",
"fields": {
"Category": {"type": "string", store :"yes" ,
"analyzer": "en_analyzer" },
"_Category": { "type": "string", store :"yes",
"index": "not_analyzed" }
}
}
...
}

    }                                                            

.....
}
};

When I do the same to the field Name that is not in nested document it
works just fine.

Could anybody please tell me what am I doing wrong, and is it possible to
highlight stored field of nested document?

Thanks

--
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/ceac9780-bf60-42d8-9cab-4bcf6dffb393%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Jun Ohtani) #2

Hi,

I had similar situation and I created the following issue.

And this issue is already closed.
Unfortunately, this behavior is the limitation of nested object currently.

I hope this will answer your needs.

Regards,
Jun

2014-02-20 1:59 GMT+09:00 Angel Cross niegis19@gmail.com:

Hi all.
I'm experiencing problems trying to highlight fields of nested document.
The parent document has its _source disabled (enabled : false).
Nested document and its fields has store option set to yes. And I'm trying
to query and highlight it with the following request
{
"query": {
"query_string": {
"query": "red"
}
},
"highlight": {
"fields": {
"Metadata.Category": {}
}
}
}

If _source is enabled this request works just fine. But if I disable
source and change mapping to include store option for nested document this
doesn't work(the document is found but not highlighted).

Here is a part of my mapping
{
...
"_source" :{"enabled" :false},
properties: {
...
"Name": {
"type": "multi_field", store : "yes",
"fields": {
"Name": { "type": "string",store : "yes", "analyzer":
"en_analyzer" },
"_Name": { "type": "string",store : "yes", "index":
"not_analyzed" }
}
}
...

      Metadata: {
        store :"yes",
        type: "nested",
        properties: {
           ....
            "Text": {
                "type": "multi_field",  store :"yes",
                "fields": {
                    "Text": {"type": "string", store :"yes",

"analyzer": "en_analyzer" },
"_Text": { "type": "string",store :"yes",
"index": "not_analyzed" }
}
},
"Category": {
"type": "multi_field", store :"yes",
"fields": {
"Category": {"type": "string", store :"yes" ,
"analyzer": "en_analyzer" },
"_Category": { "type": "string", store :"yes",
"index": "not_analyzed" }
}
}
...
}

    }

.....
}
};

When I do the same to the field Name that is not in nested document it
works just fine.

Could anybody please tell me what am I doing wrong, and is it possible to
highlight stored field of nested document?

Thanks

--
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/ceac9780-bf60-42d8-9cab-4bcf6dffb393%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.

--

Jun Ohtani
blog : http://blog.johtani.info

--
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/CAPW8A5zG00RwzTj6nQVopTybynrNNYsORPfFgq_DyNrtE6dmGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(angella) #3

Jun Ohtani
Thanks. This helped. Now my conscience is clear =)

--
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/75f65fcf-3c82-4e62-9476-11c20127765e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4