lex-elastic_app_search 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +23 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +44 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lex-elastic_app_search.gemspec +32 -0
- data/lib/legion/extensions/elastic_app_search.rb +15 -0
- data/lib/legion/extensions/elastic_app_search/helpers/client.rb +19 -0
- data/lib/legion/extensions/elastic_app_search/runners/analytics.rb +25 -0
- data/lib/legion/extensions/elastic_app_search/runners/click_through.rb +17 -0
- data/lib/legion/extensions/elastic_app_search/runners/credentials.rb +40 -0
- data/lib/legion/extensions/elastic_app_search/runners/curations.rb +33 -0
- data/lib/legion/extensions/elastic_app_search/runners/documents.rb +33 -0
- data/lib/legion/extensions/elastic_app_search/runners/engines.rb +41 -0
- data/lib/legion/extensions/elastic_app_search/runners/schemas.rb +23 -0
- data/lib/legion/extensions/elastic_app_search/runners/search.rb +37 -0
- data/lib/legion/extensions/elastic_app_search/runners/synonyms.rb +33 -0
- data/lib/legion/extensions/elastic_app_search/version.rb +7 -0
- metadata +153 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ba5beb19e8b1be44847c355f19f6d29333ec137d2361af8d1d576f918bdde2dc
|
4
|
+
data.tar.gz: b85a04878343d8f8a444f786a82870b9e436211b87c06f3c8ee188aeebdec957
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ec63b23ef3a19742f9836417c9509b4ce03b67ca65271b2fdf2272cd00621d5a674ffedbd1fd29672da0be8a5601500d79de91a9f433ff4d7467079b0db8174a
|
7
|
+
data.tar.gz: 68abe1e2565ba1835de2e6dcd4b830f5791c7b2186796685db4a93cd7b6f38fe51e209a0a4501437f9f691c4fe929606961338b99bf6de7e1282546722f12030
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Layout/LineLength:
|
2
|
+
Max: 120
|
3
|
+
Metrics/MethodLength:
|
4
|
+
Max: 30
|
5
|
+
Metrics/ClassLength:
|
6
|
+
Max: 1500
|
7
|
+
Metrics/BlockLength:
|
8
|
+
Max: 50
|
9
|
+
Metrics/ParameterLists:
|
10
|
+
Max: 10
|
11
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
12
|
+
EnforcedStyle: space
|
13
|
+
Style/Documentation:
|
14
|
+
Enabled: false
|
15
|
+
AllCops:
|
16
|
+
TargetRubyVersion: 2.5
|
17
|
+
NewCops: enable
|
18
|
+
Style/FrozenStringLiteralComment:
|
19
|
+
Enabled: false
|
20
|
+
Naming/FileName:
|
21
|
+
Enabled: false
|
22
|
+
Style/ClassAndModuleChildren:
|
23
|
+
Enabled: false
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at matthewdiverson@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [https://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Esity
|
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
|
13
|
+
all 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
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Legion::Extensions::ElasticAppSearch
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/legion/extensions/elastic_app_search`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'legion-extensions-elastic_app_search'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install legion-extensions-elastic_app_search
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
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`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/legion-extensions-elastic_app_search. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/legion-extensions-elastic_app_search/blob/master/CODE_OF_CONDUCT.md).
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
41
|
+
|
42
|
+
## Code of Conduct
|
43
|
+
|
44
|
+
Everyone interacting in the Legion::Extensions::ElasticAppSearch project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/legion-extensions-elastic_app_search/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'legion/extensions/elastic_app_search'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative 'lib/legion/extensions/elastic_app_search/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'lex-elastic_app_search'
|
5
|
+
spec.version = Legion::Extensions::ElasticAppSearch::VERSION
|
6
|
+
spec.authors = ['Esity']
|
7
|
+
spec.email = ['matthewdiverson@gmail.com']
|
8
|
+
|
9
|
+
spec.summary = 'Legion ElasticAppSearch'
|
10
|
+
spec.description = 'Connects Legion to Elastic App Search'
|
11
|
+
spec.homepage = 'https://bitbucket.org/legion-io/lex-elastic_app_search'
|
12
|
+
spec.license = 'MIT'
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
|
14
|
+
|
15
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
16
|
+
spec.metadata['source_code_uri'] = 'https://bitbucket.org/legion-io/lex-elastic_app_search'
|
17
|
+
spec.metadata['changelog_uri'] = 'https://bitbucket.org/legion-io/lex-elastic_app_search/src/master/CHANGELOG.md'
|
18
|
+
|
19
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
20
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
end
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ['lib']
|
24
|
+
|
25
|
+
spec.add_development_dependency 'rake'
|
26
|
+
spec.add_development_dependency 'rspec'
|
27
|
+
spec.add_development_dependency 'rubocop'
|
28
|
+
spec.add_development_dependency 'simplecov'
|
29
|
+
|
30
|
+
spec.add_dependency 'elastic-app-search'
|
31
|
+
spec.add_dependency 'legion-exceptions'
|
32
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'legion/extensions/elastic_app_search/version'
|
2
|
+
|
3
|
+
module Legion
|
4
|
+
module Extensions
|
5
|
+
module ElasticAppSearch
|
6
|
+
extend Legion::Extensions::Core
|
7
|
+
|
8
|
+
def self.default_settings
|
9
|
+
{
|
10
|
+
host: 'http://localhost:3002'
|
11
|
+
}
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'elastic-app-search'
|
2
|
+
|
3
|
+
module Legion
|
4
|
+
module Extensions
|
5
|
+
module ElasticAppSearch
|
6
|
+
module Helpers
|
7
|
+
module Client
|
8
|
+
def client(**opts)
|
9
|
+
Elastic::AppSearch::Client.new(
|
10
|
+
host_identifier: find_setting('host', opts),
|
11
|
+
api_key: find_setting('api_key', opts)
|
12
|
+
)
|
13
|
+
end
|
14
|
+
include Legion::Extensions::Helpers::Lex
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Legion
|
2
|
+
module Extensions
|
3
|
+
module ElasticAppSearch
|
4
|
+
module Runners
|
5
|
+
module Analytics
|
6
|
+
include Legion::Extensions::ElasticAppSearch::Helpers::Client
|
7
|
+
|
8
|
+
def top_queries(engine:, **opts)
|
9
|
+
client(opts).get_top_queries_analytics(engine, opts)
|
10
|
+
end
|
11
|
+
|
12
|
+
def count(engine:, **opts)
|
13
|
+
client(opts).get_count_analytics(engine, opts)
|
14
|
+
end
|
15
|
+
|
16
|
+
def top_clicks(engine:, **opts)
|
17
|
+
client(opts).get_top_clicks_analytics(engine, opts)
|
18
|
+
end
|
19
|
+
|
20
|
+
include Legion::Extensions::Helpers::Lex
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Legion
|
2
|
+
module Extensions
|
3
|
+
module ElasticAppSearch
|
4
|
+
module Runners
|
5
|
+
module ClickThrough
|
6
|
+
include Legion::Extensions::ElasticAppSearch::Helpers::Client
|
7
|
+
|
8
|
+
def log(engine_name:, data:, **opts)
|
9
|
+
client(opts).log_click_through(engine_name, data)
|
10
|
+
end
|
11
|
+
|
12
|
+
include Legion::Extensions::Helpers::Lex
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Legion
|
2
|
+
module Extensions
|
3
|
+
module ElasticAppSearch
|
4
|
+
module Runners
|
5
|
+
module Credentials
|
6
|
+
include Legion::Extensions::ElasticAppSearch::Helpers::Client
|
7
|
+
|
8
|
+
def list(current: 1, size: 20, **opts)
|
9
|
+
client(opts).list_credentials(current: current, size: size)
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(name:, **opts)
|
13
|
+
client(opts).get_credential(name)
|
14
|
+
end
|
15
|
+
|
16
|
+
def create(name:, type: 'private', read: true, write: false, access_all_engines: true, engines: [], **opts)
|
17
|
+
client(opts).create_credential(
|
18
|
+
{ name: name,
|
19
|
+
type: type,
|
20
|
+
read: read,
|
21
|
+
write: write,
|
22
|
+
access_all_engines: access_all_engines,
|
23
|
+
engines: engines }
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
def update(name:, **opts)
|
28
|
+
client(opts).update_credential(name, opts)
|
29
|
+
end
|
30
|
+
|
31
|
+
def destroy(name:, **opts)
|
32
|
+
client(opts).destroy_credential(name)
|
33
|
+
end
|
34
|
+
|
35
|
+
include Legion::Extensions::Helpers::Lex
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Legion
|
2
|
+
module Extensions
|
3
|
+
module ElasticAppSearch
|
4
|
+
module Runners
|
5
|
+
module Curations
|
6
|
+
include Legion::Extensions::ElasticAppSearch::Helpers::Client
|
7
|
+
|
8
|
+
def create(engine:, **opts)
|
9
|
+
client(opts).create_curation(engine, opts)
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(engine:, curation:, **opts)
|
13
|
+
client(opts).get_curation(engine, curation)
|
14
|
+
end
|
15
|
+
|
16
|
+
def list(engine:, **opts)
|
17
|
+
client(opts).list_curations(engine)
|
18
|
+
end
|
19
|
+
|
20
|
+
def update(engine:, curation:, **opts)
|
21
|
+
client(opts).update_curation(engine, curation, opts)
|
22
|
+
end
|
23
|
+
|
24
|
+
def destroy(engine:, curation:, **opts)
|
25
|
+
client(opts).destroy_curation(engine, curation)
|
26
|
+
end
|
27
|
+
|
28
|
+
include Legion::Extensions::Helpers::Lex
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Legion
|
2
|
+
module Extensions
|
3
|
+
module ElasticAppSearch
|
4
|
+
module Runners
|
5
|
+
module Documents
|
6
|
+
include Legion::Extensions::ElasticAppSearch::Helpers::Client
|
7
|
+
|
8
|
+
def create(engine:, documents:, **opts)
|
9
|
+
client(opts).index_documents(engine, documents)
|
10
|
+
end
|
11
|
+
|
12
|
+
def update(engine:, documents:, **opts)
|
13
|
+
client(opts).update_documents(engine, documents)
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(engine:, document_ids:, **opts)
|
17
|
+
client(opts).get_documents(engine, document_ids)
|
18
|
+
end
|
19
|
+
|
20
|
+
def list(engine:, **opts)
|
21
|
+
client(opts).list_documents(engine)
|
22
|
+
end
|
23
|
+
|
24
|
+
def delete(engine:, document_ids:, **opts)
|
25
|
+
client(opts).destroy_documents(engine, document_ids)
|
26
|
+
end
|
27
|
+
|
28
|
+
include Legion::Extensions::Helpers::Lex
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Legion
|
2
|
+
module Extensions
|
3
|
+
module ElasticAppSearch
|
4
|
+
module Runners
|
5
|
+
module Engines
|
6
|
+
include Legion::Extensions::ElasticAppSearch::Helpers::Client
|
7
|
+
|
8
|
+
def list(**opts)
|
9
|
+
client(opts).list_engines
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(engine:, **opts)
|
13
|
+
client(opts).get_engine(engine)
|
14
|
+
end
|
15
|
+
|
16
|
+
def destroy(engine:, **opts)
|
17
|
+
client(opts).destroy_engine(engine)
|
18
|
+
end
|
19
|
+
|
20
|
+
def create(engine:, **opts)
|
21
|
+
client(opts).create_engine(engine)
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_meta(engine:, sources: [], **opts)
|
25
|
+
client(opts).create_meta_engine(engine, sources)
|
26
|
+
end
|
27
|
+
|
28
|
+
def add_meta_source(engine:, sources: [], **opts)
|
29
|
+
client(opts).add_meta_engine_sources(engine, sources)
|
30
|
+
end
|
31
|
+
|
32
|
+
def delete_meta_source(engine:, sources: [], **opts)
|
33
|
+
client(opts).delete_meta_engine_sources(engine, sources)
|
34
|
+
end
|
35
|
+
|
36
|
+
include Legion::Extensions::Helpers::Lex
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Legion
|
2
|
+
module Extensions
|
3
|
+
module ElasticAppSearch
|
4
|
+
module Runners
|
5
|
+
module Schemas
|
6
|
+
include Legion::Extensions::ElasticAppSearch::Helpers::Client
|
7
|
+
|
8
|
+
def get(engine:, **opts)
|
9
|
+
client(opts).get_schema(engine)
|
10
|
+
end
|
11
|
+
|
12
|
+
def update(engine:, field:, type:, **opts)
|
13
|
+
update = {}
|
14
|
+
update[field.to_sym] = type
|
15
|
+
client(opts).update_schema(engine, update)
|
16
|
+
end
|
17
|
+
|
18
|
+
include Legion::Extensions::Helpers::Lex
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Legion
|
2
|
+
module Extensions
|
3
|
+
module ElasticAppSearch
|
4
|
+
module Runners
|
5
|
+
module Search
|
6
|
+
include Legion::Extensions::ElasticAppSearch::Helpers::Client
|
7
|
+
|
8
|
+
def search(engine:, query:, **opts)
|
9
|
+
client(opts).search(engine, query, opts)
|
10
|
+
end
|
11
|
+
|
12
|
+
def multi_search(engine:, queries: [], **opts)
|
13
|
+
client(opts).multi_search(engine, queries)
|
14
|
+
end
|
15
|
+
|
16
|
+
def query_suggestion(engine:, query:, **opts)
|
17
|
+
client(opts).query_suggestion(engine, query, opts)
|
18
|
+
end
|
19
|
+
|
20
|
+
def settings(engine:, **opts)
|
21
|
+
client(opts).show_settings(engine)
|
22
|
+
end
|
23
|
+
|
24
|
+
def update_settings(engine:, settings:, **opts)
|
25
|
+
client(opts).update_settings(engine, settings)
|
26
|
+
end
|
27
|
+
|
28
|
+
def reset_settings(engine:, **opts)
|
29
|
+
client(opts).reset_settings(engine)
|
30
|
+
end
|
31
|
+
|
32
|
+
include Legion::Extensions::Helpers::Lex
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Legion
|
2
|
+
module Extensions
|
3
|
+
module ElasticAppSearch
|
4
|
+
module Runners
|
5
|
+
module Synonyms
|
6
|
+
include Legion::Extensions::ElasticAppSearch::Helpers::Client
|
7
|
+
|
8
|
+
def create(engine:, synonyms: [], **opts)
|
9
|
+
client(opts).create_synonym_set(engine, synonyms: synonyms)
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(engine:, synonym:, **opts)
|
13
|
+
client(opts).get_synonym_set(engine, synonym)
|
14
|
+
end
|
15
|
+
|
16
|
+
def list(engine:, current: 1, size: 20, **opts)
|
17
|
+
client(opts).list_synonym_sets(engine, current: current, size: size)
|
18
|
+
end
|
19
|
+
|
20
|
+
def update(engine:, synonym:, synonyms: [])
|
21
|
+
client(opts).update_synonym_set(engine, synonym, synonyms: synonyms)
|
22
|
+
end
|
23
|
+
|
24
|
+
def delete(engine:, synonym:, **opts)
|
25
|
+
client(opts).destroy_synonym_set(engine, synonym)
|
26
|
+
end
|
27
|
+
|
28
|
+
include Legion::Extensions::Helpers::Lex
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lex-elastic_app_search
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Esity
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-08-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: simplecov
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: elastic-app-search
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: legion-exceptions
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: Connects Legion to Elastic App Search
|
98
|
+
email:
|
99
|
+
- matthewdiverson@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
|
+
- ".rubocop.yml"
|
107
|
+
- CODE_OF_CONDUCT.md
|
108
|
+
- Gemfile
|
109
|
+
- LICENSE.txt
|
110
|
+
- README.md
|
111
|
+
- Rakefile
|
112
|
+
- bin/console
|
113
|
+
- bin/setup
|
114
|
+
- lex-elastic_app_search.gemspec
|
115
|
+
- lib/legion/extensions/elastic_app_search.rb
|
116
|
+
- lib/legion/extensions/elastic_app_search/helpers/client.rb
|
117
|
+
- lib/legion/extensions/elastic_app_search/runners/analytics.rb
|
118
|
+
- lib/legion/extensions/elastic_app_search/runners/click_through.rb
|
119
|
+
- lib/legion/extensions/elastic_app_search/runners/credentials.rb
|
120
|
+
- lib/legion/extensions/elastic_app_search/runners/curations.rb
|
121
|
+
- lib/legion/extensions/elastic_app_search/runners/documents.rb
|
122
|
+
- lib/legion/extensions/elastic_app_search/runners/engines.rb
|
123
|
+
- lib/legion/extensions/elastic_app_search/runners/schemas.rb
|
124
|
+
- lib/legion/extensions/elastic_app_search/runners/search.rb
|
125
|
+
- lib/legion/extensions/elastic_app_search/runners/synonyms.rb
|
126
|
+
- lib/legion/extensions/elastic_app_search/version.rb
|
127
|
+
homepage: https://bitbucket.org/legion-io/lex-elastic_app_search
|
128
|
+
licenses:
|
129
|
+
- MIT
|
130
|
+
metadata:
|
131
|
+
homepage_uri: https://bitbucket.org/legion-io/lex-elastic_app_search
|
132
|
+
source_code_uri: https://bitbucket.org/legion-io/lex-elastic_app_search
|
133
|
+
changelog_uri: https://bitbucket.org/legion-io/lex-elastic_app_search/src/master/CHANGELOG.md
|
134
|
+
post_install_message:
|
135
|
+
rdoc_options: []
|
136
|
+
require_paths:
|
137
|
+
- lib
|
138
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: 2.5.0
|
143
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
requirements: []
|
149
|
+
rubygems_version: 3.1.2
|
150
|
+
signing_key:
|
151
|
+
specification_version: 4
|
152
|
+
summary: Legion ElasticAppSearch
|
153
|
+
test_files: []
|