johtani
(Jun Ohtani)
February 24, 2014, 8:35am
1
Hi all,
I am using the nested object.
There is strange behavior of field in nested object.
All sample mapping and data : https://gist.github.com/johtani/9183848
_source store
book.title is not stored
book.contents is stored
If fields parameter specify “book.title” and “book.contents”, I get only “book.title”.
This data is returned from _source.
Why did not return “book.contents”?
Should I use _source instead of store=“true" ?
Regards,
Jun
Jun Ohtani
johtani@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani
Binh_Ly
(Binh Ly)
February 24, 2014, 11:34pm
2
It does look like a bug. Can you please open a ticket/issue? Thank you.
--
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/3ab3b9de-05ae-4b5b-be36-2993d85ba9fc%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
johtani
(Jun Ohtani)
February 25, 2014, 2:35am
3
Thanks for replying.
I open a ticket.
opened 02:33AM - 25 Feb 14 UTC
closed 01:31PM - 03 Mar 14 UTC
If the field in nested object set `store : yes`, elasticsearch does not return s… tored data.
Otherwise, if the field in nested object set `store : no`, elasticsearch return stored data from _source.
Reproduce commands as follows.
- `book.title` field is `store : no`.
- `book.contents` field is `store : yes`.
```
PUT /library
POST /library/books/_mapping
{
"books" : {
"properties": {
"book" : {
"type": "nested",
"properties": {
"title" : { "type": "string", "analyzer": "standard", "store": "no"},
"contents" : {"type": "string", "analyzer": "standard", "store": "yes"}
}
}
}
}
}
PUT /library/books/1
{
"book" : {
"title" : "ElasticSearch Server",
"contents" : "Learn the basics of ElasticSearch"
}
}
GET /library/books/_search
{
"_source" : ["book.title","book.contents"],
"fields": [
"book.title",
"book.contents"
],
"query": {
"nested": {
"path": "book",
"query": {
"query_string" : {
"query" : "ElasticSearch",
"fields" : ["book.title", "book.contents"]
}
}
}
}
}
```
Result of the query.
```
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.625,
"hits": [
{
"_index": "library",
"_type": "books",
"_id": "1",
"_score": 0.625,
"_source": {
"book": {
"title": "ElasticSearch Server",
"contents": "Learn the basics of ElasticSearch"
}
},
"fields": {
"book.title": [
"ElasticSearch Server"
]
}
}
]
}
}
```
2014-02-25 8:34 GMT+09:00 Binh Ly binh@hibalo.com :
It does look like a bug. Can you please open a ticket/issue? Thank you.
--
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/3ab3b9de-05ae-4b5b-be36-2993d85ba9fc%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/CAPW8A5yd-SqitmZt-O8%3DOE2QnbgE-TJXGZ0ZZe%2BGk%2BthSdqdPg%40mail.gmail.com .
For more options, visit https://groups.google.com/groups/opt_out .