chewy_queries 0.0.3 → 0.0.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 +34 -15
- data/lib/chewy_queries/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 990c8bb612f6b79f93019924a8c6aea863254df480f0329439bb5ce8ff953226
|
|
4
|
+
data.tar.gz: 68974713009f8dc894192431dd2d6226d72a1938245b3ae31cb5d731c30c1eeb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b18a547340987f3d104856a45667be62f90bfaaba8b5481c4512dd974bbdf8f9d53988a69160dc8b65e087764626cd3eb2a374aab430e941e7628b4e3952341e
|
|
7
|
+
data.tar.gz: 9cfc21c59c8625368e3df7fe9a25ac389be2a15c9929a18cc8a4df24fb684c082e3c5ecf6d80869d29cd2839cf4edcf61669af6c64e16c6753abe76663a618bb
|
data/README.md
CHANGED
|
@@ -30,6 +30,7 @@ gem install chewy_queries
|
|
|
30
30
|
|
|
31
31
|
## Search query requires the following
|
|
32
32
|
|
|
33
|
+
|
|
33
34
|
```ruby
|
|
34
35
|
def ChewyQueries.search(class_name, type, condition, value, field)
|
|
35
36
|
# some elastic queries
|
|
@@ -38,15 +39,19 @@ gem install chewy_queries
|
|
|
38
39
|
|
|
39
40
|
Above method includes all possible elastic queries to get the search result.
|
|
40
41
|
|
|
41
|
-
##
|
|
42
|
-
|
|
42
|
+
## Each argument explanation
|
|
43
|
+
|
|
44
|
+
## 1)type is fields types:
|
|
45
|
+
```
|
|
43
46
|
1)text
|
|
44
47
|
2)number
|
|
45
48
|
3)date
|
|
49
|
+
```
|
|
46
50
|
|
|
47
|
-
## Condition required for each fields
|
|
51
|
+
## 2)Condition required for each fields:
|
|
48
52
|
|
|
49
|
-
###
|
|
53
|
+
### a)text field
|
|
54
|
+
```
|
|
50
55
|
1)equal
|
|
51
56
|
2)not equal
|
|
52
57
|
3)contains
|
|
@@ -56,8 +61,9 @@ Above method includes all possible elastic queries to get the search result.
|
|
|
56
61
|
7)ends with
|
|
57
62
|
8)does not end with
|
|
58
63
|
9)matches exactly
|
|
59
|
-
|
|
60
|
-
###
|
|
64
|
+
```
|
|
65
|
+
### b)number field
|
|
66
|
+
```
|
|
61
67
|
1)Is equal to
|
|
62
68
|
2)Is not equal to
|
|
63
69
|
3)Is greater than
|
|
@@ -65,8 +71,9 @@ Above method includes all possible elastic queries to get the search result.
|
|
|
65
71
|
5)Is provided
|
|
66
72
|
6)Is not provided
|
|
67
73
|
7)Is between
|
|
68
|
-
|
|
69
|
-
###
|
|
74
|
+
```
|
|
75
|
+
### c)date field
|
|
76
|
+
```
|
|
70
77
|
1)Is before
|
|
71
78
|
2)Is after
|
|
72
79
|
3)Is on or before
|
|
@@ -76,18 +83,30 @@ Above method includes all possible elastic queries to get the search result.
|
|
|
76
83
|
7)Is provided
|
|
77
84
|
8)Is not provided
|
|
78
85
|
9)Is between
|
|
86
|
+
```
|
|
79
87
|
|
|
80
|
-
## value should be your search value
|
|
81
|
-
## field should be your search filed
|
|
82
|
-
|
|
83
|
-
## Note:This gem will give maximum 10 result if you want more than 10 you can use limit(limit(1000)) after calling methods.
|
|
88
|
+
## 3)value should be your search value
|
|
84
89
|
|
|
90
|
+
## 4)field should be your search filed
|
|
85
91
|
|
|
86
92
|
## Example
|
|
87
93
|
|
|
88
94
|
```ruby
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
#for search
|
|
96
|
+
ChewyQueries.search(ContactIndex, "number", "Is equal to", 23, "age").limit(Contact.count)
|
|
97
|
+
|
|
98
|
+
#Note:limit is to get morethan 10 result
|
|
99
|
+
|
|
100
|
+
#for exact_match_search
|
|
101
|
+
ChewyQueries.exact_match_search(ContactIndex,"email","rakesh@example.com")
|
|
102
|
+
|
|
103
|
+
#for multiple_field_search
|
|
104
|
+
ChewyQueries.multiple_field_search(ContactIndex,["first_name","last_name","full_name"],"rakesh")
|
|
105
|
+
|
|
106
|
+
#for partial_search
|
|
107
|
+
ChewyQueries.partial_search(ContactIndex,"first_name","rak")
|
|
108
|
+
|
|
109
|
+
|
|
92
110
|
```
|
|
93
111
|
|
|
112
|
+
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: chewy_queries
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rakesh
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-07-
|
|
11
|
+
date: 2021-07-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: This gem help you to find the query for chewy gem
|
|
14
14
|
email:
|