elastic_ar_sync 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/README.md +11 -1
- data/lib/elastic_ar_sync/elastic/syncable.rb +3 -1
- data/lib/elastic_ar_sync/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af0f13be82cfec282e25814c57cd0b94897e0ada5f5e0887fe07e6aafb66e477
|
4
|
+
data.tar.gz: f82e7af22699dfc5cd0e209c4456616c711a900de2732934d04a9a22490b9754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ffa67fb9b31ff93ac71a031d1d18e5484ca618fe247996313112c5939a61a505db3f7e7abbda04c87fa4c844ee9563f340c78bf254a4209f8a3aaae600029fa
|
7
|
+
data.tar.gz: 25345728724a21b73bb805c38f8a6730015fb7dba096075da5da7c2f306e3769fcb62e6fe4f581f39249f220454898ed2311a6ecb5374797885a10934f30c94d
|
data/README.md
CHANGED
@@ -94,7 +94,17 @@ index_config(override_mappings: { birth: :keyword })
|
|
94
94
|
|
95
95
|
then birth will mapping as keyword type in index of elasticsearch.
|
96
96
|
|
97
|
-
if you
|
97
|
+
if you want add mapping which is not defined as schema column of model, you can save method result as well like below.
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
index_config(override_mappings: { full_name: :keyword })
|
101
|
+
```
|
102
|
+
|
103
|
+
*`full_name` is instance method
|
104
|
+
|
105
|
+
then full_name will mapped to index mapping as keyword type. but you have to define instance method full_name to your model class.
|
106
|
+
|
107
|
+
if you define your original mapping additionally, you can also define like below.
|
98
108
|
|
99
109
|
```ruby
|
100
110
|
settings index: { number_of_shards: number_of_shards } do
|
@@ -37,7 +37,9 @@ module ElasticArSync
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def as_indexed_json(_option = {})
|
40
|
-
|
40
|
+
hash = {}
|
41
|
+
self.class.mapping_list_keys.each { |key| hash[key.to_s] = send(key) }
|
42
|
+
hash.as_json
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|