mastico 0.1.1 → 0.1.2
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 +5 -5
- data/README.md +3 -7
- data/lib/mastico/query.rb +1 -1
- data/lib/mastico/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 10574d0b9586998f4d7fd7543d5c7ef614e28a29
|
4
|
+
data.tar.gz: bd2cad87ba6821b050e3483d857acdf2c4f1cd8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3899db6f982100299f90d94db7fb8e81c6b97513906ef3aaa2247bb1859cfaee7341341b293892e7c41613e69701ad458cf43315afd26867c72cdd2bf2fe44a1
|
7
|
+
data.tar.gz: 6133e753e4409c3fe2e9482d02b198a99f4eae19acdfb82bce766ddc685293ba25b4de95d678624c8420238142116762a646b79ef3957ee93d708a5033c35e6a
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ Mastico creates queries based on a list of fields:
|
|
15
15
|
|
16
16
|
```ruby
|
17
17
|
query = FooIndex.query
|
18
|
-
query = Mastico::Query.new(fields: [:title, description], query: "ciao").
|
18
|
+
query = Mastico::Query.new(fields: [:title, description], query: "ciao").apply(query)
|
19
19
|
```
|
20
20
|
This creates a series of queries: word, prefix, infix and fuzzy match of the word `ciao` against the supplied fields.
|
21
21
|
|
@@ -33,7 +33,7 @@ def weight(word)
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
query = Mastico::Query.new(fields: [:title, description], word_weight: method(:weight), query: "I like cheese").
|
36
|
+
query = Mastico::Query.new(fields: [:title, description], word_weight: method(:weight), query: "I like cheese").apply(query)
|
37
37
|
```
|
38
38
|
|
39
39
|
## Example 3:
|
@@ -41,7 +41,7 @@ query = Mastico::Query.new(fields: [:title, description], word_weight: method(:w
|
|
41
41
|
What if I don't want all the different types of matching?
|
42
42
|
|
43
43
|
```ruby
|
44
|
-
query = Mastico::Query.new(fields: {title: {boost: 4.0, types: [:term]} }, query: "Simple").
|
44
|
+
query = Mastico::Query.new(fields: {title: {boost: 4.0, types: [:term]} }, query: "Simple").apply(query)
|
45
45
|
```
|
46
46
|
This will return only the `term` type search for the attribute `title`.
|
47
47
|
|
@@ -62,10 +62,6 @@ Or install it yourself as:
|
|
62
62
|
|
63
63
|
$ gem install mastico
|
64
64
|
|
65
|
-
## Usage
|
66
|
-
|
67
|
-
TODO: Write usage instructions here
|
68
|
-
|
69
65
|
## Development
|
70
66
|
|
71
67
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/mastico/query.rb
CHANGED
data/lib/mastico/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mastico
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matteo Manzo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.
|
111
|
+
rubygems_version: 2.5.1
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: A chewy helper
|