You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The search plugin requires vuex-orm package version 0.15+
30
+
The search plugin requires **@vuex-orm/core** package version 0.16.1
25
31
26
32
To upgrade the **vuex-orm package** simply run
27
33
```bash
28
-
npm install vuex-orm@latest --save
34
+
npm install @vuex-orm/core
29
35
```
30
36
31
37
## Installation
32
38
```bash
33
39
npm install @vuex-orm/plugin-search --save
34
40
```
35
41
36
-
###Plugin Import Directions
42
+
## Plugin Import Directions
37
43
38
44
Import the search plugin in the Vuex Store entry file.
39
45
40
46
```javascript
41
47
// ex: store/index.js
42
-
importVuexORMfrom'vuex-orm'
48
+
importVuexORMfrom'@vuex-orm/core'
43
49
importVuexORMSearchfrom'@vuex-orm/plugin-search'
44
50
````
45
51
@@ -51,7 +57,7 @@ VuexORM.use(VuexORMSearch, {
51
57
})
52
58
```
53
59
54
-
###Fuse.js Default Options
60
+
## Fuse.js Default Options
55
61
56
62
The plugin provides opinionated default fuse.js options for token based matching for optimum performance. These options are easily changed at two stages of the plugin lifecycle:
57
63
@@ -79,7 +85,9 @@ see: [Fuse.js](http://fusejs.io/) for demo
79
85
80
86
## Option Use Examples
81
87
82
-
**During Plugin Install**
88
+
Some examples on how to use the search plugin with case specific options
89
+
90
+
### During Plugin Install
83
91
84
92
For example, if we want to match based on case sensitive and no fuzzy search logic (perfect match)
85
93
```javascript
@@ -89,7 +97,7 @@ VuexORM.use(VuexORMSearch, {
89
97
})
90
98
```
91
99
92
-
**During Query Chain**
100
+
### During Query Chain
93
101
94
102
The global install options will now default to case sensitive and no fuzzy logic, but for example we have a run-time case we need to ignore case and implement a slightly more strict fuzzy search threshold.
95
103
@@ -109,3 +117,17 @@ const data = this.$store.getters['entities/users/query']()
109
117
.get()
110
118
```
111
119
120
+
### Finding Results Matching Multiple Terms
121
+
122
+
Let's find all matches where both **pat** and **male** exist in our records, and sort by the date added.
0 commit comments