elasticband 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +5 -0
  5. data/.travis.yml +13 -0
  6. data/CODE_OF_CONDUCT.md +13 -0
  7. data/Gemfile +3 -0
  8. data/LICENSE +21 -0
  9. data/README.md +34 -0
  10. data/Rakefile +8 -0
  11. data/elasticband.gemspec +27 -0
  12. data/lib/elasticband/aggregation/nested.rb +18 -0
  13. data/lib/elasticband/aggregation/terms.rb +23 -0
  14. data/lib/elasticband/aggregation/top_hits.rb +26 -0
  15. data/lib/elasticband/aggregation.rb +56 -0
  16. data/lib/elasticband/filter/and.rb +24 -0
  17. data/lib/elasticband/filter/not.rb +24 -0
  18. data/lib/elasticband/filter/query.rb +24 -0
  19. data/lib/elasticband/filter/term.rb +23 -0
  20. data/lib/elasticband/filter/terms.rb +23 -0
  21. data/lib/elasticband/filter.rb +13 -0
  22. data/lib/elasticband/query/filtered.rb +25 -0
  23. data/lib/elasticband/query/function_score.rb +44 -0
  24. data/lib/elasticband/query/match.rb +25 -0
  25. data/lib/elasticband/query/multi_match.rb +23 -0
  26. data/lib/elasticband/query/score_function/boost_factor.rb +17 -0
  27. data/lib/elasticband/query/score_function/field_value_factor.rb +24 -0
  28. data/lib/elasticband/query/score_function/filtered.rb +19 -0
  29. data/lib/elasticband/query/score_function/script_score.rb +24 -0
  30. data/lib/elasticband/query/score_function.rb +14 -0
  31. data/lib/elasticband/query.rb +127 -0
  32. data/lib/elasticband/search.rb +18 -0
  33. data/lib/elasticband/version.rb +3 -0
  34. data/lib/elasticband.rb +12 -0
  35. data/spec/aggregation/nested_spec.rb +28 -0
  36. data/spec/aggregation/terms_spec.rb +17 -0
  37. data/spec/aggregation/top_hits_spec.rb +26 -0
  38. data/spec/aggregation_spec.rb +48 -0
  39. data/spec/filter/and_spec.rb +31 -0
  40. data/spec/filter/not_spec.rb +21 -0
  41. data/spec/filter/query_spec.rb +21 -0
  42. data/spec/filter/term_spec.rb +17 -0
  43. data/spec/filter/terms_spec.rb +23 -0
  44. data/spec/filter_spec.rb +9 -0
  45. data/spec/query/filtered_spec.rb +37 -0
  46. data/spec/query/function_score_spec.rb +76 -0
  47. data/spec/query/match_spec.rb +23 -0
  48. data/spec/query/multi_match_spec.rb +29 -0
  49. data/spec/query/score_function/boost_factor_spec.rb +9 -0
  50. data/spec/query/score_function/field_value_factor_spec.rb +17 -0
  51. data/spec/query/score_function/filtered_spec.rb +25 -0
  52. data/spec/query/score_function/script_score_spec.rb +17 -0
  53. data/spec/query/score_function_spec.rb +10 -0
  54. data/spec/query_spec.rb +274 -0
  55. data/spec/search_spec.rb +33 -0
  56. data/spec/spec_helper.rb +94 -0
  57. metadata +185 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: af49e433d1512419bc8c9b383a2b0cb61fe968f4
4
+ data.tar.gz: d6c0940f96228c7e203969232ed7ed4f3e236157
5
+ SHA512:
6
+ metadata.gz: d545e4df0a47007b785292f55b29bc6e9a02e7fc3fdf2059c95c9fab1c5fb4b0081d0a241f2373a7f9304f408b7d3eee1b0fdff80bbf9869dddac0906443a43f
7
+ data.tar.gz: 0e7665259f56491b1c876934f7ac584b50a46022de13c2c02dca468fe3d0fe076bb919abf4da28f5bf8641dc5aab431cd9aba75993dda15e60111ca7b1e7ea97
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ *.gem
2
+ .env
3
+ .rspec_persistence
4
+
5
+ /.bundle/
6
+ /.yardoc
7
+ /Gemfile.lock
8
+ /_yardoc/
9
+ /coverage/
10
+ /doc/
11
+ /pkg/
12
+ /spec/reports/
13
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,5 @@
1
+ Style/Documentation:
2
+ Enabled: false
3
+
4
+ Metrics/LineLength:
5
+ Max: 110
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 2.2
5
+ - ruby-head
6
+ git:
7
+ depth: 1
8
+ script:
9
+ - bundle exec rspec
10
+ - bundle exec rubocop
11
+ addons:
12
+ code_climate:
13
+ repo_token: 217146fc082e87b5e4b2352141a8832d0da78d66a9d22cb0b5189344648e821e
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Love Mondays
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Elasticband
2
+ [![Build Status](https://travis-ci.org/LoveMondays/elasticband.svg)](https://travis-ci.org/LoveMondays/elasticband) [![Code Climate](https://codeclimate.com/github/LoveMondays/elasticband/badges/gpa.svg)](https://codeclimate.com/github/LoveMondays/elasticband) [![Test Coverage](https://codeclimate.com/github/LoveMondays/elasticband/badges/coverage.svg)](https://codeclimate.com/github/LoveMondays/elasticband/coverage)
3
+
4
+ Query builder for [elasticsearch-rails gem](https://github.com/elastic/elasticsearch-rails)
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'elasticband'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install elasticband
21
+
22
+ ## Development
23
+
24
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
25
+
26
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
27
+
28
+ ## Contributing
29
+
30
+ 1. Fork it ( https://github.com/LoveMondays/elasticband/fork )
31
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
32
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
33
+ 4. Push to the branch (`git push origin my-new-feature`)
34
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+ require 'rubocop/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ RuboCop::RakeTask.new(:rubocop)
7
+
8
+ task default: [:rubocop, :spec]
@@ -0,0 +1,27 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ require 'elasticband/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = 'elasticband'
8
+ s.version = Elasticband::VERSION
9
+ s.platform = Gem::Platform::RUBY
10
+
11
+ s.date = '2015-06-26'
12
+ s.summary = 'Query builder for elasticsearch-rails'
13
+ s.homepage = 'https://github.com/LoveMondays/elasticband'
14
+ s.license = 'MIT'
15
+
16
+ s.authors = ['Glauber Campinho', 'Rubens Minoru Andako Bueno']
17
+ s.email = ['ggcampinho@gmail.com', 'rubensmabueno@hotmail.com']
18
+ s.files = `git ls-files -z`.split("\x0")
19
+
20
+ s.add_dependency 'activesupport'
21
+
22
+ s.add_development_dependency 'dotenv'
23
+ s.add_development_dependency 'rake'
24
+ s.add_development_dependency 'rspec', '~> 3.3.0'
25
+ s.add_development_dependency 'rubocop'
26
+ s.add_development_dependency 'codeclimate-test-reporter'
27
+ end
@@ -0,0 +1,18 @@
1
+ module Elasticband
2
+ class Aggregation
3
+ class Nested < Aggregation
4
+ attr_accessor :root_aggregation, :nested_aggregation
5
+
6
+ def initialize(root_aggregation, nested_aggregation)
7
+ self.root_aggregation = root_aggregation
8
+ self.nested_aggregation = nested_aggregation
9
+ end
10
+
11
+ def to_h
12
+ root_aggregation.to_h.tap do |h|
13
+ h[root_aggregation.name].merge!(aggs: nested_aggregation.to_h)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,23 @@
1
+ module Elasticband
2
+ class Aggregation
3
+ class Terms < Aggregation
4
+ attr_accessor :field, :options
5
+
6
+ def initialize(name, field, options = {})
7
+ super(name)
8
+ self.field = field.to_sym
9
+ self.options = options
10
+ end
11
+
12
+ def to_h
13
+ super(aggregation_hash)
14
+ end
15
+
16
+ private
17
+
18
+ def aggregation_hash
19
+ { terms: { field: field }.merge!(options) }
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,26 @@
1
+ module Elasticband
2
+ class Aggregation
3
+ class TopHits < Aggregation
4
+ attr_accessor :root_aggregation, :size, :from, :options
5
+
6
+ def initialize(name, root_aggregation, size, options = {})
7
+ super(name)
8
+ self.root_aggregation = root_aggregation
9
+ self.size = size
10
+ self.options = options
11
+ end
12
+
13
+ def to_h
14
+ root_aggregation.to_h.tap do |h|
15
+ h[root_aggregation.name].merge!(aggs: super(top_hits_hash))
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ def top_hits_hash
22
+ { top_hits: { size: size }.merge!(options) }
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,56 @@
1
+ require 'elasticband/aggregation/nested'
2
+ require 'elasticband/aggregation/terms'
3
+ require 'elasticband/aggregation/top_hits'
4
+
5
+ module Elasticband
6
+ class Aggregation
7
+ attr_accessor :name
8
+
9
+ def initialize(name)
10
+ self.name = name.to_sym
11
+ end
12
+
13
+ def to_h(aggregation_hash = {})
14
+ { name => aggregation_hash }
15
+ end
16
+
17
+ class << self
18
+ # Parses some options to a Elasticsearch syntax
19
+ #
20
+ # #### Options
21
+ #
22
+ # * `group_by:` Count results by the value of an attribute using `terms` filter.
23
+ # It can receive an array with some attributes:
24
+ # * `top_hits:` A number of results that should be return inside the group ranked by score.
25
+ # * `size:` Size of the results calculated in each shard (https://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-aggregations-bucket-terms-aggregation.html#_size)
26
+ #
27
+ # #### Examples
28
+ # ```
29
+ # Aggregation.parse(group_by: :status)
30
+ # => { status: { terms: { field: :status } } }
31
+ #
32
+ # Aggregation.parse(group_by: [:status, size: 5, top_hits: 3])
33
+ # => { status: { terms: { field: :status, size: 5 }, aggs: { top_status: { top_hits: 3 } } } }
34
+ def parse(options)
35
+ parse_group_by(options[:group_by]).to_h
36
+ end
37
+
38
+ private
39
+
40
+ def parse_group_by(options_group_by)
41
+ return {} if options_group_by.blank?
42
+
43
+ options_group_by = Array.wrap(options_group_by)
44
+ options = options_group_by.extract_options!
45
+ field = options_group_by.first
46
+
47
+ aggregation = Aggregation::Terms.new(field, field, options.except(:top_hits))
48
+ if options[:top_hits]
49
+ aggregation = Aggregation::TopHits.new(:"top_#{field}", aggregation, options[:top_hits])
50
+ end
51
+
52
+ aggregation
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,24 @@
1
+ module Elasticband
2
+ class Filter
3
+ class And < Filter
4
+ attr_accessor :filters, :options
5
+
6
+ def initialize(filters, options = {})
7
+ self.filters = Array.wrap(filters)
8
+ self.options = options
9
+ end
10
+
11
+ def to_h
12
+ { and: filter_hash }
13
+ end
14
+
15
+ private
16
+
17
+ def filter_hash
18
+ return filters.map(&:to_h) if options.blank?
19
+
20
+ { filter: filters.map(&:to_h) }.merge!(options)
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ module Elasticband
2
+ class Filter
3
+ class Not < Filter
4
+ attr_accessor :other_filter, :options
5
+
6
+ def initialize(other_filter, options = {})
7
+ self.other_filter = other_filter
8
+ self.options = options
9
+ end
10
+
11
+ def to_h
12
+ { not: filter_hash }
13
+ end
14
+
15
+ private
16
+
17
+ def filter_hash
18
+ return other_filter.to_h if options.blank?
19
+
20
+ { filter: other_filter.to_h }.merge!(options)
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ module Elasticband
2
+ class Filter
3
+ class Query < Filter
4
+ attr_accessor :query, :options
5
+
6
+ def initialize(query, options = {})
7
+ self.query = query
8
+ self.options = options
9
+ end
10
+
11
+ def to_h
12
+ return query_hash if options.blank?
13
+
14
+ { fquery: query_hash.merge!(options) }
15
+ end
16
+
17
+ private
18
+
19
+ def query_hash
20
+ { query: query.to_h }
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,23 @@
1
+ module Elasticband
2
+ class Filter
3
+ class Term < Filter
4
+ attr_accessor :filter, :field, :options
5
+
6
+ def initialize(filter, field, options = {})
7
+ self.filter = filter
8
+ self.field = field.to_sym
9
+ self.options = options
10
+ end
11
+
12
+ def to_h
13
+ { term: filter_hash }
14
+ end
15
+
16
+ private
17
+
18
+ def filter_hash
19
+ { field => filter }.merge!(options)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ module Elasticband
2
+ class Filter
3
+ class Terms < Filter
4
+ attr_accessor :filters, :field, :options
5
+
6
+ def initialize(filters, field, options = {})
7
+ self.filters = Array.wrap(filters)
8
+ self.field = field.to_sym
9
+ self.options = options
10
+ end
11
+
12
+ def to_h
13
+ { terms: filter_hash }
14
+ end
15
+
16
+ private
17
+
18
+ def filter_hash
19
+ { field => filters }.merge!(options)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,13 @@
1
+ require 'elasticband/filter/and'
2
+ require 'elasticband/filter/not'
3
+ require 'elasticband/filter/query'
4
+ require 'elasticband/filter/term'
5
+ require 'elasticband/filter/terms'
6
+
7
+ module Elasticband
8
+ class Filter
9
+ def to_h
10
+ { match_all: {} }
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,25 @@
1
+ module Elasticband
2
+ class Query
3
+ class Filtered < Query
4
+ attr_accessor :query, :filter, :options
5
+
6
+ def initialize(filter, query = nil, options = {})
7
+ self.filter = filter
8
+ self.query = query
9
+ self.options = options
10
+ end
11
+
12
+ def to_h
13
+ { filtered: query_hash }
14
+ end
15
+
16
+ private
17
+
18
+ def query_hash
19
+ return { filter: filter.to_h }.merge!(options) if query.blank?
20
+
21
+ { query: query.to_h, filter: filter.to_h }.merge!(options)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,44 @@
1
+ module Elasticband
2
+ class Query
3
+ class FunctionScore < Query
4
+ attr_accessor :query_or_filter, :function, :options
5
+
6
+ def initialize(query_or_filter, function, options = {})
7
+ self.query_or_filter = query_or_filter
8
+ self.function = function
9
+ self.options = options
10
+ end
11
+
12
+ def to_h
13
+ { function_score: function_score_hash }
14
+ end
15
+
16
+ private
17
+
18
+ def function_score_hash
19
+ query_or_filter_hash.merge!(function_hash).merge!(options)
20
+ end
21
+
22
+ def query_or_filter_hash
23
+ if query_or_filter.is_a?(Query)
24
+ { query: query_or_filter.to_h }
25
+ else
26
+ { filter: query_or_filter.to_h }
27
+ end
28
+ end
29
+
30
+ def function_hash
31
+ if function.is_a?(Enumerable)
32
+ { functions: function.map(&:to_h) }
33
+ else
34
+ function_hash = function.to_h
35
+ if function_hash.key?(:filter)
36
+ { functions: [function_hash] }
37
+ else
38
+ function_hash
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,25 @@
1
+ module Elasticband
2
+ class Query
3
+ class Match < Query
4
+ attr_accessor :query, :field, :options
5
+
6
+ def initialize(query, field = nil, options = {})
7
+ self.query = query
8
+ self.field = (field || :_all).to_sym
9
+ self.options = options
10
+ end
11
+
12
+ def to_h
13
+ { match: { field => query_hash } }
14
+ end
15
+
16
+ private
17
+
18
+ def query_hash
19
+ return query if options.blank?
20
+
21
+ { query: query }.merge!(options)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,23 @@
1
+ module Elasticband
2
+ class Query
3
+ class MultiMatch < Query
4
+ attr_accessor :query, :fields, :options
5
+
6
+ def initialize(query, fields = [:_all], options = {})
7
+ self.query = query
8
+ self.fields = Array.wrap(fields).map(&:to_sym)
9
+ self.options = options
10
+ end
11
+
12
+ def to_h
13
+ { multi_match: query_hash }
14
+ end
15
+
16
+ private
17
+
18
+ def query_hash
19
+ { query: query }.merge!(options).merge!(fields: fields)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,17 @@
1
+ module Elasticband
2
+ class Query
3
+ class ScoreFunction
4
+ class BoostFactor < ScoreFunction
5
+ attr_accessor :boost
6
+
7
+ def initialize(boost)
8
+ self.boost = boost
9
+ end
10
+
11
+ def to_h
12
+ { boost_factor: boost }
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,24 @@
1
+ module Elasticband
2
+ class Query
3
+ class ScoreFunction
4
+ class FieldValueFactor < ScoreFunction
5
+ attr_accessor :field, :options
6
+
7
+ def initialize(field, options = {})
8
+ self.field = field.to_sym
9
+ self.options = options
10
+ end
11
+
12
+ def to_h
13
+ { field_value_factor: function_hash }
14
+ end
15
+
16
+ private
17
+
18
+ def function_hash
19
+ { field: field }.merge!(options)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,19 @@
1
+ module Elasticband
2
+ class Query
3
+ class ScoreFunction
4
+ class Filtered < ScoreFunction
5
+ attr_accessor :filter, :score_function, :options
6
+
7
+ def initialize(filter, score_function, options = {})
8
+ self.filter = filter
9
+ self.score_function = score_function
10
+ self.options = options
11
+ end
12
+
13
+ def to_h
14
+ { filter: filter.to_h }.merge!(score_function.to_h).merge(options)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,24 @@
1
+ module Elasticband
2
+ class Query
3
+ class ScoreFunction
4
+ class ScriptScore < ScoreFunction
5
+ attr_accessor :script, :options
6
+
7
+ def initialize(script, options = {})
8
+ self.script = script
9
+ self.options = options
10
+ end
11
+
12
+ def to_h
13
+ { script_score: script_score_hash }
14
+ end
15
+
16
+ private
17
+
18
+ def script_score_hash
19
+ { script: script }.merge!(options)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,14 @@
1
+ require 'elasticband/query/score_function/boost_factor'
2
+ require 'elasticband/query/score_function/field_value_factor'
3
+ require 'elasticband/query/score_function/filtered'
4
+ require 'elasticband/query/score_function/script_score'
5
+
6
+ module Elasticband
7
+ class Query
8
+ class ScoreFunction
9
+ def to_h
10
+ {}
11
+ end
12
+ end
13
+ end
14
+ end