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 and association preloading #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

liamwhite
Copy link

@liamwhite liamwhite commented May 28, 2019

  1. Adds (breaking) support for Elasticsearch 7, which has changed the way that total hits are returned
  2. Allows associations to be preloaded by the paginate method, like so:
  def index(conn, params) do
    query = %{query: %{match_all: %{}}, sort: %{created_at: :desc}}
    opts = %{options: [queryable: from(i in Image, preload: :user)]}

    images = ESx.search(Image, query) |> ESx.paginate(Map.merge(params, opts))

    render conn, "index.html", images: images.entries
  end

@ikeikeikeike
Copy link
Owner

Hello, @liamwhite! This is your first Pull Request that will be reviewed by Ebert, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

@ikeikeikeike
Copy link
Owner

Ebert has finished reviewing this Pull Request and has found:

  • 1 possible new issue (including those that may have been commented here).

You can see more details about this review at https://ebertapp.io/github/ikeikeikeike/scrivener_esx/pulls/1.

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

Successfully merging this pull request may close these issues.

2 participants