create_custom_attributes 0.5.11 → 0.5.12
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0445ce94c2b0d7cb72b52f3962f73ba59aef43f4
|
|
4
|
+
data.tar.gz: a3e22072e9f332e88219ed67f2b4a08f106d6202
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe1d4d5d02a055d40c58e5c5ff802362a1c2acb791216c0887212960c71fbcf719ed0728f3b10149f6eb48832689f1f3157e0dd89fae5aeab7d203dde943b6af
|
|
7
|
+
data.tar.gz: 2c37132a2f9a37a0ca55cb540d28725b66b0ebbb4ff4dea5883bbb05079fe3681e073d3a3e8d130bdf8b7206c86b59f4a7fe803d8eeee171aa7e8f59f223a068
|
|
@@ -28,7 +28,7 @@ module CustomAttributes
|
|
|
28
28
|
return unless context.class.name == 'Elasticsearch::Model::Indexing::Mappings'
|
|
29
29
|
|
|
30
30
|
context.indexes :visible_in_search, type: 'boolean'
|
|
31
|
-
context.indexes :
|
|
31
|
+
context.indexes :custom_field_values, type: 'nested' do
|
|
32
32
|
context.indexes :value, type: 'text', fields: { raw: { type: 'keyword' } }
|
|
33
33
|
context.indexes :custom_field_id, type: 'integer'
|
|
34
34
|
end
|
|
@@ -142,11 +142,11 @@ module CustomAttributes
|
|
|
142
142
|
if type == :custom_fields
|
|
143
143
|
next unless find_custom_field_by_slug(field_slug).sortable
|
|
144
144
|
{
|
|
145
|
-
'
|
|
145
|
+
'custom_field_values.value.raw' => {
|
|
146
146
|
order: field_data || 'asc',
|
|
147
|
-
nested_path: '
|
|
147
|
+
nested_path: 'custom_field_values',
|
|
148
148
|
nested_filter: {
|
|
149
|
-
term: { '
|
|
149
|
+
term: { 'custom_field_values.custom_field_id' => resolve_custom_field_id(field_slug) }
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -206,18 +206,18 @@ module CustomAttributes
|
|
|
206
206
|
end
|
|
207
207
|
|
|
208
208
|
def custom_query_scaffold(query, field_slug, filter = false)
|
|
209
|
-
condition = { match: { '
|
|
210
|
-
condition = { term: { '
|
|
209
|
+
condition = { match: { 'custom_field_values.value' => query } }
|
|
210
|
+
condition = { term: { 'custom_field_values.value.raw' => query } } if filter
|
|
211
211
|
|
|
212
212
|
{
|
|
213
213
|
nested: {
|
|
214
|
-
path: '
|
|
214
|
+
path: 'custom_field_values',
|
|
215
215
|
query: {
|
|
216
216
|
bool: {
|
|
217
217
|
must: [
|
|
218
218
|
condition,
|
|
219
219
|
{
|
|
220
|
-
term: { '
|
|
220
|
+
term: { 'custom_field_values.custom_field_id' => resolve_custom_field_id(field_slug) }
|
|
221
221
|
}
|
|
222
222
|
]
|
|
223
223
|
}
|