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

terms query missing? #96

Closed
martinklepsch opened this issue Jul 14, 2014 · 10 comments
Closed

terms query missing? #96

martinklepsch opened this issue Jul 14, 2014 · 10 comments

Comments

@martinklepsch
Copy link
Contributor

Maybe I'm mistaken but I think the terms query is missing. Would you consider a patch adding it?

@michaelklishin
Copy link
Member

Missing from elastisch.query? Definitely submit a pull request, I believe this query type is fairly recent.

@michaelklishin
Copy link
Member

@mklappstuhl are you going to contribute this? If not, can you at least tell us where the terms query is missing?

@martinklepsch
Copy link
Contributor Author

Going to contribute! I've been wrangling with editors (going from vim to
emacs) last couple of days but I'll take a look tomorrow or over the
weekend :)

On Wednesday, July 16, 2014, Michael Klishin notifications@github.com
wrote:

@mklappstuhl https://github.com/mklappstuhl are you going to contribute
this? If not, can you at least tell us where the terms query is missing?


Reply to this email directly or view it on GitHub
#96 (comment)
.


Martin
http://martinklepsch.org http://martinklepsch.org?ref=email

@michaelklishin
Copy link
Member

@mklappstuhl hey, we do accept contributions from Vim users ;)

@martinklepsch
Copy link
Contributor Author

Haha, yeah. Just gave emacs another concentrated try and that made my
productivity with everything else tank totally :D

On Wednesday, July 16, 2014, Michael Klishin notifications@github.com
wrote:

@mklappstuhl https://github.com/mklappstuhl hey, we do accept
contributions from Vim users ;)


Reply to this email directly or view it on GitHub
#96 (comment)
.


Martin
http://martinklepsch.org http://martinklepsch.org?ref=email

@martinklepsch
Copy link
Contributor Author

@michaelklishin as it seems the clojurewerkz.elastisch.query/term function automagically becomes a terms query when you supply a collection:

(defn term
  "Term Query"
  [key values & args]
  (merge { (if (coll? values) :terms :term) (hash-map key values) }
         (ar/->opts args)))

I just put together a map on my own when I needed this unknowing that this would work. Maybe it'd be useful to add an alias so that it shows up in the API documentation?

@michaelklishin
Copy link
Member

@mklappstuhl go ahead. A separate function in general should be fine (we can't change term immediately for backwards compatibility).

@martinklepsch
Copy link
Contributor Author

I'm not sure. The existing term query properly supports terms queries as
well.
Duplicating that code doesn't sound like the best idea that's why I
suggested aliasing. Therefore no changes in functionality would be made,
everything would stay compatible.

@michaelklishin
Copy link
Member

Fine, just define a function that will call term internally :)

@michaelklishin
Copy link
Member

Fixed by #104. Thanks @mklappstuhl!

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