Elasticsearch 5.6.3 첨부 파일삽입물을 설치했습니다. 용어 벡터 속성을 첨부 파일 내용에 WithPositionOffsets으로 설정하려고합니다. 내 검색에서 높은 결과를 보려면이 속성을 어디에 설정해야합니까?첨부 파일 내용을 강조하는 탄성 검색 NEST
문서 POCO는 아래와 같다 : 여기서
public class Document
{
public int Id { get; set; }
public string Path { get; set; }
public string Content { get; set; }
public Attachment Attachment { get; set; }
}
가 매핑과 CreateIndex 함수이다.
.Mappings 부분에 나는 FileVield를 사용하여 termvector 및 store 속성을 설정했습니다. 그러나 결과는 다음과 같습니다 :
{
"documents": {
"mappings": {
"document": {
"_all": {
"enabled": false
},
"properties": {
"attachment": {
"properties": {
"author": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"content": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"content_length": {
"type": "long"
},
"content_type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"date": {
"type": "date"
},
"detect_language": {
"type": "boolean"
},
"indexed_chars": {
"type": "long"
},
"keywords": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"language": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"content": {
"type": "attachment",
"fields": {
"content": {
"type": "text",
"store": true,
"term_vector": "with_positions_offsets"
},
"author": {
"type": "text"
},
"title": {
"type": "text"
},
"name": {
"type": "text"
},
"date": {
"type": "date"
},
"keywords": {
"type": "text"
},
"content_type": {
"type": "text"
},
"content_length": {
"type": "integer"
},
"language": {
"type": "text"
}
}
},
"id": {
"type": "integer"
},
"path": {
"type": "text",
"analyzer": "windows_path_hierarchy_analyzer"
}
}
}
}
}
}
그래서 내 질의 결과의 하이라이트 속성을 볼 수 없습니다. 어떻게해야합니까?