elasticsearch_hermes 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81930c441e75a5180feaf4c83e2bfd2c56c5b4ca
|
4
|
+
data.tar.gz: 68a12ce9d23fd52993aaa17107c7e0203c069a10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b849aaf675784c2c9ea8c45add69a5d8d2a1ecb766b7b48e4587a98c4740533069623d1bd0142b303a5e37b3b2004d1587e93f0d1303a9a9aaaea321b4771d92
|
7
|
+
data.tar.gz: 6ff1279329c4e213b7e660e9c4b4960a0a3e9425ca76774152fa2906cc49d33b39903924cd09681b10e47df179029d117ca204c0467dc7215937f4b75a163486
|
data/lib/elasticsearch_hermes.rb
CHANGED
@@ -5,6 +5,7 @@ require 'elasticsearch_hermes/railtie'
|
|
5
5
|
require 'elasticsearch_hermes/errors'
|
6
6
|
require 'elasticsearch_hermes/configuration'
|
7
7
|
require 'elasticsearch_hermes/index'
|
8
|
+
require 'elasticsearch_hermes/indexing'
|
8
9
|
require 'elasticsearch_hermes/query'
|
9
10
|
require 'elasticsearch_hermes/result/base'
|
10
11
|
require 'elasticsearch_hermes/hook'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ElasticsearchHermes
|
4
|
+
module Indexing
|
5
|
+
def elastic_update(type: '_doc', index_name: self.class.to_s.underscore, id:, body:)
|
6
|
+
ElasticsearchHermes.client.index index_payload(
|
7
|
+
index_name: index_name,
|
8
|
+
type: type,
|
9
|
+
body: body,
|
10
|
+
id: id
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
def index_payload(index_name:, type:, id:, body:)
|
15
|
+
{
|
16
|
+
type: type,
|
17
|
+
index: index_name,
|
18
|
+
id: id,
|
19
|
+
body: body
|
20
|
+
}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module ElasticsearchHermes
|
4
4
|
module Query
|
5
|
-
def search(query: '', index_name: to_s.underscore, fields:
|
5
|
+
def search(query: '', index_name: to_s.underscore, fields: @hermes_search_on)
|
6
6
|
@results = ElasticsearchHermes.client.search query_payload(
|
7
7
|
query: query,
|
8
8
|
index_name: index_name,
|
@@ -11,8 +11,8 @@ module ElasticsearchHermes
|
|
11
11
|
ElasticsearchHermes::Result::Base.new(@results.symbolize_keys)
|
12
12
|
end
|
13
13
|
|
14
|
-
def hermes_search_on(
|
15
|
-
|
14
|
+
def hermes_search_on(fields: [])
|
15
|
+
@hermes_search_on ||= fields.map(&:to_s)
|
16
16
|
end
|
17
17
|
|
18
18
|
def search_type; end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch_hermes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ronald Ekambi
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- lib/elasticsearch_hermes/errors.rb
|
43
43
|
- lib/elasticsearch_hermes/hook.rb
|
44
44
|
- lib/elasticsearch_hermes/index.rb
|
45
|
+
- lib/elasticsearch_hermes/indexing.rb
|
45
46
|
- lib/elasticsearch_hermes/logger.rb
|
46
47
|
- lib/elasticsearch_hermes/query.rb
|
47
48
|
- lib/elasticsearch_hermes/railtie.rb
|
@@ -71,6 +72,5 @@ rubyforge_project:
|
|
71
72
|
rubygems_version: 2.6.14.3
|
72
73
|
signing_key:
|
73
74
|
specification_version: 4
|
74
|
-
summary:
|
75
|
-
complicated configuration of elastic
|
75
|
+
summary: I will fix this eventually
|
76
76
|
test_files: []
|