radar / elastic

A thin veneer over HTTPotion that talks to Elastic Search

Home Page:https://hex.pm/packages/elastic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nested structs and the Document API

MarkNijhof opened this issue · comments

If I have the following:

defmodule Es.Account.User do
@es_type "user"
@es_index "user"

use Elastic.Document.API

defstruct id: nil,
email: :string,
first_name: :string,
last_name: :string,
mobile: :string,
customer_number: :string,
profiles: [
]
end

And a profile is a list with maps how would I configure it so elastic search knows about them? I.e. https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html

I’m not sure I understand. What isn’t happening at the moment? And what should be happening?