-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
NEST/Elasticsearch.Net version: 5.0.0-RC4
Elasticsearch version: 5.0.1
Description of the problem including expected versus actual behavior:
expected : If result json includes title, it should assign value to attachement.title.
actual : Attachment.Title value is always null.
Steps to reproduce:
- Create Index.
POST documents/document/1
{
"id" : 1,
"path": "/a/b/c/d/",
"attachment":{
"author": "author",
"content": "I have a pen. I have an apple",
"content_length": 12345,
"content_type": "plain/txt",
"date" : "2016-12-06T12:34:56Z",
"language": "ja",
"name": "name",
"title": "title test",
"keywords": "keywords",
"indexed_chars": 12345,
"detect_language" : "ja"
}
}
- Get Index.
public class Document
{
public int Id { get; set; }
public string Path { get; set; }
public string Content { get; set; }
public Attachment Attachment { get; set; }
}
and get document (using nest)
var connectionSettings = new ConnectionSettings(
new Uri("http://xxx.xxx.xxx.xxx:9200"))
.DisableDirectStreaming();
var client = new ElasticClient(connectionSettings);
var response = client .Get<Document>(1, idx => idx.Index("documents"));
Console.WriteLine(response.DebugInformation);
var document = response.Source;
- Access Attachment.Title
Title value is null. (should be "title test").
Provide ConnectionSettings
(if relevant):
N/A
Provide DebugInformation
(if relevant):
# Response:
{"_index":"documents","_type":"document","_id":"1","_version":1,"found":true,"_source":{
"id" : 1,
"path": "/a/b/c/d/",
"attachment":{
"author": "author",
"content": "I have a pen. I have an apple",
"content_length": 12345,
"content_type": "plain/txt",
"date" : "2016-12-06T12:34:56Z",
"language": "ja",
"name": "name",
"title": "title test",
"keywords": "keywords",
"indexed_chars": 12345,
"detect_language" : "ja"
}
}
Response json has "title" . but, Attachment.Title field value is null.
In Nest/Mapping/Types/Specialized/Attachment.cs (ReadJson method),
it seems to title is not used any which case.
Metadata
Metadata
Assignees
Labels
No labels