I want to save some data just in case (Suddenly, later come in handy).
I need them to not be indexed and not involved in the search.
If this data is later needed, I will get it from _source.
I tried to add mapping, but ES swears:
curl -s -H 'content-type: application/json; charset=UTF-8' "http://localhost:9205/test123/_mapping/searchtype?pretty" -XPUT -d'{"properties" : {"name2":{"index":false}}}'
{
"error" : {
"root_cause" : [
{
"type" : "mapper_parsing_exception",
"reason" : "No type specified for field [name2]"
}
],
"type" : "mapper_parsing_exception",
"reason" : "No type specified for field [name2]"
},
"status" : 400
}
You did not understand.
I know that can specify the type and everything will work.
But I believe that this is not correct.
Suppose there is a flow of documents of the form:
I want to fully process only part of the documents. That is, all fields are indexed and searched by them. About the other part, I only need to know the name and type. Since there can be many documents, and the body can be large, I do not want unnecessary fields to be indexed at all. And I can’t remove the body field from them, because the client can come tomorrow and say: "We also need to find certificates!". In this case, I just correct the script and reindex the documents.
It is clear that in most cases it will be "text". But why should I specify a type for a field if I don't want to analyze and index it. There's some raw data. This data should only remain in _source and not be included in the index.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.