Elasticsearch implementation
What's in this PR?
This is currently work in progress. But wanted to get an initial PR out.
References
Fixes #60
Elastix provides basic functionality for working with elasticsearch. It's a pretty small library (4 modules) and not very long or complex.
This looks awesome! Great job. One thing I would suggest is maybe making the field_filter extensible for other fields. Maybe have a map as an input with %{field: "type"} and field_filter is generated from this map so if we want to add multiple fields at once we can. Also, not an elasticsearch expert but I believe just by adding more mapping types we could put other models in the same index so maybe have another layer to the input map with type? Doesnt seem like we need it right now but just a thought. This is definitely a good step forward towards a higher level elixir elasticsearch client!
Thanks for the kind words. I like the ideas you proposed and think they should work. I'll start working on those ideas soon.
Hey @paulsullivanjr I just wanted to check in on this and see if there's anything we should be doing here?
@JoshSmith I want to discuss what other steps and pieces we'll need to integrate this. I'll catch up with you on slack tonight or tomorrow. I want to get this done so I can get started other other issues.
Awesome, I will be around to discuss.
Hey @paulsullivanjr just adding that suggestions comment here for context to this PR:
- Adding a skills/search endpoint for searching, handled directly in SkillController
- Endpoint point needs to return a collection of Skill structures, need to research how to create from elasticsearch results. The Elasticsearch indexes will need to contain the Skill records from the database including id's.
- Keep an ELASTICSEARCH_URL in .env
We could easily get Skills back by simply:
- using
results = [%{"id" => 1}, %{"id" => 2}] |> Enum.map(&(&1["id"])) - with a where clause:
skills = Skill |> where([s], s.id in [1, 2]) |> Repo.allwhere[1, 2]are theresultsabove