Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ sudo: false

matrix:
include:
- rvm: 2.3.1
- rvm: 2.5.0
env:
- MONGOID_VERSION=6.0
- MONGOID_VERSION=7.0
before_script:
- bundle exec danger
- rvm: 2.3.1
env:
- MONGOID_VERSION=6.0
- rvm: 2.3.1
env:
- MONGOID_VERSION=5.0
Expand All @@ -25,6 +28,6 @@ services: mongodb
addons:
apt:
sources:
- mongodb-3.2-precise
- mongodb-3.4-precise
packages:
- mongodb-org-server
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### 0.8.1 (Next)

* [#35](https://github.com/mongoid/mongoid_fulltext/pull/35): Mongoid 7 compatibility - [@tomasc](https://github.com/tomasc).
* Your contribution here.

### 0.8.0 (1/19/2017)
Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
source 'http://rubygems.org'

case version = ENV['MONGOID_VERSION'] || '6'
case version = ENV['MONGOID_VERSION'] || '7'
when /7/
gem 'mongoid', '~> 7.0'
when /6/
gem 'mongoid', '~> 6.0'
when /5/
Expand Down
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,40 @@ the AND of all of the individual results for each of the fields. Finally, if a f
but criteria for that filter aren't passed to `fulltext_search`, the result is as if the filter
had never been defined - you see both models that both pass and fail the filter in the results.

SCI Support
-----------

The search respects SCI. From the spec:

```ruby
class MyDoc
include Mongoid::Document
include Mongoid::FullTextSearch

field :title
fulltext_search_in :title
end

class MyInheritedDoc < MyDoc
end
```

```ruby
MyDoc.fulltext_search(…) # => will return both MyDoc as well as MyInheritedDoc documents
MyInheritedDoc.fulltext_search(…) # => will return only MyInheritedDoc documents
```

Criteria Support
----------------

It is also possible to pre-empt the search with Monogid criteria:

```ruby
MyDoc.where(value: 10).fulltext_search(…)
```

Please note that this will not work in case an index is shared by multiple classes (that are not connected through inheritance), since a criteria applies only to one class.

Indexing Options
----------------

Expand Down Expand Up @@ -397,4 +431,3 @@ Copyright and License
MIT License, see [LICENSE](LICENSE) for details.

(c) 2011-2017 [Artsy Inc.](http://artsy.github.io)

Loading