Skip to content

Combining fulltext_search with other criteria? #12

Description

@eimermusic

I don't index large articles where relevance is the only concern in search results. Therefore I eventually reach a point where I need to order and/or filter the results using other mongoid criteria.

For example finding Articles matching the fulltext term "foo" but also was published in the last week. Or displaying the results in a table and wanting to sort (asc and desc) on different table columns like title, author or published timestamp.

I haven't figured out if or how to work these things into the filters options in mongoid_fulltext. Maybe it is possible. But they seem to require filters that can be "rendered" and index-time.

Limiting with other criteria when calling .fulltext_search() is possible and do work... sort of. They just throw exceptions whenever something is actually filtered and an id is not found. (Thanks to Mongoid 3's new behavior).

So, finally a question or two

Would it be possible for mongoid_fulltext to not use find(foo) but instead use .where('_id' => foo) without breaking other behaviors?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions