Commit 66d06bce66f980acb52dab343e6e16492515ed9d
1 parent
e406fab1
Exists in
master
and in
18 other branches
Added initial examples for partial match options [skip ci]
Showing
1 changed file
with
11 additions
and
9 deletions
Show diff stats
README.md
... | ... | @@ -271,15 +271,17 @@ Product.search "back", fields: [:name], match: :word_start |
271 | 271 | |
272 | 272 | Available options are: |
273 | 273 | |
274 | -```ruby | |
275 | -:word # default | |
276 | -:word_start | |
277 | -:word_middle | |
278 | -:word_end | |
279 | -:text_start | |
280 | -:text_middle | |
281 | -:text_end | |
282 | -``` | |
274 | +Option | Matches | Example | |
275 | +--- | --- | --- | |
276 | +`:word` | entire word | `apple` matches `apple` | |
277 | +`:word_start` | start of word | `app` matches `apple` | |
278 | +`:word_middle` | any part of word | `ppl` matches `apple` | |
279 | +`:word_end` | end of word | `ple` matches `apple` | |
280 | +`:text_start` | start of text | `gre` matches `green apple`, `app` does not match | |
281 | +`:text_middle` | any part of text | `een app` matches `green apple` | |
282 | +`:text_end` | end of text | `ple` matches `green apple`, `een` does not match | |
283 | + | |
284 | +The default is `:word`. | |
283 | 285 | |
284 | 286 | ### Exact Matches |
285 | 287 | ... | ... |