Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elasticsearch 7 Mapping #65

Open
gabriel137 opened this issue Apr 15, 2020 · 7 comments
Open

Elasticsearch 7 Mapping #65

gabriel137 opened this issue Apr 15, 2020 · 7 comments

Comments

@gabriel137
Copy link

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. "

@gabriel137
Copy link
Author

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.

@nilcolor
Copy link

nilcolor commented Jun 2, 2020

Mapping.put(url, index_name, type, mapping, include_type_name: true) should work.

@gabriel137
Copy link
Author

Changed, now is like this:

Elastix.Document.index (elastic_url, "twitter", "_doc", "1", date)

@sb8244
Copy link

sb8244 commented Oct 27, 2020

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"}
  }
})

@costa
Copy link

costa commented Dec 23, 2020

@sb8244 Thanks, your workaround works.
Waiting for this to be resolved in the package.

@costa
Copy link

costa commented Dec 23, 2020

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.

@mruoss
Copy link

mruoss commented Mar 17, 2022

Is it planned to support Elasticsearch 8? (mapping types are not supported anymore)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants