Hello everyone
I actively study Elasticsearch.
I had to update my version ES to the latest from 5. But here I ran into a problem, the answer to which I could not find in the documentation.
I used ES 5 version, when adding new information for example to this sections:
PUT /coin_charts/btc/1
PUT /coin_charts/eth/1
PUT /coin_charts/ada/1
It automatically created the structure and information was added.
But in the new version, when trying to do the same, it gives an error:
Yes that's why it says "Originally, the workflow would have looked something like this" and then shows you how to do it now That's what you need to adapt to.
But, i can't make this mappings already the second day...
I canβt make the structure I need in any way, maybe I donβt understand something.
I need to make stuctures like this:
Elasticsearch no longer supports specifying multiple document types for an index so I would recommend adding a field to each document that contains the type and use a default type (_doc) as follows:
But the problem is that in the future I will need to search by currency name and time, if only one value is indexed, is it possible to search by two parameters at the same time?
You need to introduce a new field in your document body to differentiate the currency name. So 2 fields will be indexed.
"currency name" & "time".
You search the documents using 2 fields. (currency+time)
It basically moves the old "_type" value into the document body and you need to add the currency-name to your query string.
Elasticsearch by default will index all the fields in your document body, unless you tell it not to from "mapping". With the above example after the migration, you should have 3 fields getting indexed. "currency name", "time", "price". Unless you changed this behavior from "mapping". Hope it helps.
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.