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
Correct placement of nested query #4
Conversation
@@ -2,7 +2,11 @@ module Arelastic | |||
module Facets | |||
class Nested < Struct.new :path, :facet | |||
def as_elastic | |||
facet.as_elastic.merge("nested" => path) | |||
original = facet.as_elastic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if Facets::Facet implemented as_elastic like this?
def as_elastic
{name => as_elastic_facet}
end
And then inheriting facets implement as_elastic_facet
.
@matthuhiggins ready to go now |
@@ -1,17 +1,16 @@ | |||
module Arelastic | |||
module Facets | |||
class Histogram < Arelastic::Facets::Facet | |||
attr_accessor :name, :options | |||
attr_accessor :options | |||
|
|||
def initialize name, options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea kind of sucks for this part, because all the inheriting classes still define initialize. Muuuurging anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it better anyway. Not as clean as < Struct
, but still better than
munging a hash of a certain format.
On Fri, Oct 18, 2013 at 1:10 PM, Matthew Higgins
notifications@github.comwrote:
In lib/arelastic/facets/histogram.rb:
@@ -1,17 +1,16 @@
module Arelastic
module Facets
class Histogram < Arelastic::Facets::Facet
attr_accessor :name, :options
attr_accessor :options
- def initialize name, options
My idea kind of sucks for this part, because all the inheriting classes
still define initialize. Muuuurging anyway.—
Reply to this email directly or view it on GitHubhttps://github.com//pull/4/files#r7072610
.
Correct placement of nested query
arelastic-0.4.7.gem now on rubygems |
I think you still need to fix Filter#nested. |
Yep. Didn't have ES docs with me on the plane. |
Had the 'nested' value at the wrong level in the query. Tested and fixed.