Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 220465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:56:29+00:00 2026-05-11T18:56:29+00:00

I have a rails app in which I am trying to do some full

  • 0

I have a rails app in which I am trying to do some full text searching on. Ferret seems to be the most popular choice. However, I have an issue.

I have a ‘thing’ which contains an id which determines if a user can see it (and therefore search it), but I want to search sub-models of this ‘thing’ which are related to my ‘thing’ but don’t directly contain any references back to the user.

Therefore, how do I implement it? Is there a clever way of implementing this, or do I need to dirty my models with a link to the domain identifier?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:56:29+00:00Added an answer on May 11, 2026 at 6:56 pm

    I think it would be very wrong to assume that Ferret is the most popular choice for this. Most people I know have ditched Ferret and replaced it with Sphinx. And the people who can’t use Sphinx for some reason have opted for Xapian.

    That said, the answer to your question is likely to be largely the same regardless of the indexing system you choose:

    When you’re dealing with permissions and indexing, you can’t effectively index anything related to the permissions system because it’s going to be user-specific. All your permissions stuff needs to live in your models/controllers somewhere. I’m fond of putting all my permissions stuff in a module and then including it in my model, so that I can easily share it between models.

    Pagination can be a real pain for this kind of thing because you request 10 items from your search engine, and then your permissions code rejects 5 of those items, which means you have to keep running searches until you have your first ten items to display. And now when you want page two, well, things turn into a real mess then. Heaven forbid they decide to skip straight to page ten, because now you can’t do tricks like giving a start ID instead of a page number. Really, it’s not something you want to do at all if you can help it.

    There really are no “clever” ways of getting around the mismatch between permissions and full-text indexing. At least, none that I know of. It’s just a pain.

    I suggested to my boss when we first started out that the only sane solution was an egalitarian permissions system: If we gave you a username and password, then you have access. He wasn’t a fan.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a Rails app (which in this case seems like it would
I have got Sinatra/Rails app and an action which starts some long process. Ordinary
In a Ruby on Rails app, we have some details which are stored as
I'm trying to make logging for my rails app and have some dilemmas over
I have a Rails 3 app that is trying to perform some controller action
I'm trying to have a button on the front-end of my rails app which
I have rails app which are working perfectly in the local computer. But when
I have a sequence of migrations in a rails app which includes the following
I have a Rails 3.1.3 app which uses devise for users authentication and soft-deletes
I have a rails app running on passenger standalone, which is working perfectly. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.