[BUG] `term_vector` does not work on `search_as_you_type` fields
#1901 aperta il 14 gen 2022
Metriche repository
- Star
- (8123 star)
- Metriche merge PR
- (Merge medio 5g 9h) (266 PR mergiate in 30 g)
Descrizione
Describe the bug TL;DR: same issue reported here.
Per ElasticSearch's 7.10 documentation (which AFAICT should be compatible with OpenSearch 1.x), setting term_vector on a search_as_you_type field should only affect the shingle subfields, but not the index prefix subfield. However, when attempting to index documents with this mapping, an illegal_argument_exception is thrown.
To Reproduce Steps to reproduce the behavior:
- Create a new index with the following mapping:
{
// ...
"my_field":
"type": "search_as_you_type",
"term_vector": "with_positions_offsets"
// ...
}
- Attempt to index a document containing a
my_fieldfield - Observe the following error:
{
"type": "illegal_argument_exception",
"reason": "cannot index term vector offsets when term vectors are not indexed (field=\"my_field._index_prefix\")"
}
Expected behavior
Documents should be indexed without issue. Only the ._2gram and ._3gram shingle subfields should have the term_vector set, and not the ._index_prefix n-gram subfield.
Plugins N/A
Screenshots N/A
Host/Environment
- Version: 1.2.3 (opensearchproject/opensearch:latest)