Output field in an autocomplete clause

when I want to index a document in elasticsearch, this problem occurs:

message [MapperParsingException[failed to parse]; nested: IllegalArgumentException[unknown field name [output], must be one of [input, weight, contexts]];]

I know that the output field is removed from elasticsearch in version 5, but why? and what should I do to get a single result for input?

+5
source share
2 answers

output field has been removed from ElasticSearch in version 5, now _source filed is returned with a sentence. An example is shown below.

Mapping

 { "user": { "properties": { "name": { "type": "string" }, "suggest": { "type": "completion", "analyzer": "simple", "search_analyzer": "simple" } } } } 

Data

 { "id": "123", "name": "Abc", "suggest": { "input": "Abc::123" }, "output": "Abc::123" } 

Query

POST - http: // localhost: 9200 / user * / _ suggest? pretty

 { "type-suggest": { "text": "Abc", "completion": { "field": "suggest" } } } 
+1
source

Elastic mentions the following

Since proposals are document-oriented, proposal metadata (e.g., output) should now be indicated as a field in the document. Support for specifying output when entering sentence pointers has been removed. Currently, the text for inputting the results of a proposal is always an unanalyzable value for inputting proposals (the same as not specifying output when specifying sentences in indices up to 5.0).

A source

Update

I managed to get one output from several inputs in ES 5.1.1. You can find the answer here.

0
source

Source: https://habr.com/ru/post/1261918/


All Articles