Elasticsearch 7 Mapping
How is the code now to assign as mapping settings? I'm trying a few ways with a new application, but I only have this return error:
Types cannot be provided in placement mapping requests unless the include_type_name parameter is set to true. "
I ended up finding a way, just do the process of inserting the data and the attributes will be created automatically
Elastix.Document.index (elastic_url, "twitter", "_doc", "1", date)
But now I'm trying to find out how to search for a file that looks like it has been changed too.
Mapping.put(url, index_name, type, mapping, include_type_name: true) should work.
Changed, now is like this:
Elastix.Document.index (elastic_url, "twitter", "_doc", "1", date)
I made a very basic module based on Elastix.Mapping that works to create an index in 7 without warnings:
defmodule Elastix.NewMapping do
import Elastix.HTTP, only: [prepare_url: 2]
alias Elastix.{HTTP, JSON}
def put(elastic_url, index_name, data) do
prepare_url(elastic_url, "/#{index_name}/_mapping")
|> HTTP.put(JSON.encode!(data))
end
end
Elastix.NewMapping.put(elastic_url, "search", %{
properties: %{
content: %{type: "search_as_you_type"}
}
})
@sb8244 Thanks, your workaround works. Waiting for this to be resolved in the package.
Well... it's worth noting this is not the only change needed for ES7 support: Elastix.Search.search, Elastix.Document.index, Elastix.Document.delete and others have to have "type" arguments removed — for now, giving "_doc" for the latter seems to work around that.
Is it planned to support Elasticsearch 8? (mapping types are not supported anymore)