Skip to content

question: Is custom index aliasing and searching possible? #95

Description

@ykurtbas

Hi, I am thinking of using this library for my ES integration.

I am going to cluster my indexes as posts-{region} to scope them and search within those scopes.

ie

posts-americas -> would host and be searchable for Americas region
posts-europe -> similary just for europe posts

and then I could delete the whole index to get rid of sort of a dynamic region.

Looking at the documentation I see this

 # You should configure each index which you maintain in Elasticsearch here.
  # This configuration will be read by the `mix elasticsearch.build` task,
  # described below.
  indexes: %{
    # This is the base name of the Elasticsearch index. Each index will be
    # built with a timestamp included in the name, like "posts-5902341238".
    # It will then be aliased to "posts" for easy querying.
    posts: %{

First: is this possible from the usage of this library or would I have to modify the task itself?

Second: Would the following return an %MyApp.Post{} struct or a raw ES response with the meta-information about the results too?

Elasticsearch.post(MyApp.ElasticsearchCluster, "/posts-americas/_doc/_search", '{"query": {"match_all": {}}}')

Thank you in advance for the library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions