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

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

Open
ykurtbas opened this issue Apr 25, 2021 · 0 comments
Open

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

ykurtbas opened this issue Apr 25, 2021 · 0 comments

Comments

@ykurtbas
Copy link

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!

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

1 participant