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

document/search vs rest/post & rest/search-url #2

Closed
maetl opened this issue Sep 9, 2012 · 2 comments
Closed

document/search vs rest/post & rest/search-url #2

maetl opened this issue Sep 9, 2012 · 2 comments

Comments

@maetl
Copy link

maetl commented Sep 9, 2012

Assuming an index named products populated with sample data, the following search query does not return any hits:

(document/search "products" "product" :query { :term { :name "macbook" } })

But manually constructing a post with the same query map returns the hit results as expected.

(rest/post (rest/search-url "products") :body { :query { :term { :name "macbook" } } })

Why would this be happening?

@michaelklishin
Copy link
Member

Your manually constructed query searches across all mappings but the one that uses clojurewerkz.elastisch.rest.document uses a specific mapping. You do not demonstrate how you populated the index but these are not equivalent.

Please use the mailing list for questions and provide at least some information about indexing. Search is as much about indexing as it is about querying.

@michaelklishin
Copy link
Member

To query one more indexes across all types, use clojurewerkz.elastisch.rest.document/search-all-types (which we will document before 1.0, #3).

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

2 participants