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 8609023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:46:15+00:00 2026-06-12T03:46:15+00:00

I have one massive model (It basically is my entire app). I have 7

  • 0

I have one massive model (It basically is my entire app). I have 7 or more associations on this model, including many to many, :through => etc. This model also has a few simple attributes (title, url, and so on).

The only thing I care about indexing are those 3 or 4 simple attributes (title, url, description, category). The rest I don’t care about.

Everything works perfectly when I use load: true, but as soon as I turn that off everything breaks. The only way to fix this it seems is to go in and add complex mappings, :touch, :touch callbacks and so on for every single association?

I hope I’m understanding this wrong because this would be a huge amount of code only to search through 3 or 4 simple attributes.

I have no idea what I’m talking about but could I maybe search through the elasticsearch index, but return a list of ID’s, and just loop through those in the normal rails way?

Thanks!

  • 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-06-12T03:46:16+00:00Added an answer on June 12, 2026 at 3:46 am

    I don’t know exactly how tire works internally but as far as I understood from the documentation when the load option is true it loads every record from the database. That’s why I don’t think you want to use it in production. Without that option Tire retrieves the information from elasticsearch, since you should have most of the data you want to display stored in elasticsearch. Probably you need to add more stored information to elasticsearch. You can do it configuring the field that you want to store in your mapping, otherwise you always have the source field in elasticsearch, which is exactly the JSON document you indexed.

    The answer to your last question is yes. You can select which fields you want back from elasticsearch instead of getting back the whole source. In your case if I understood correctly you’d configure the only id field. I don’t know how to do it with Tire but in terms of elasticsearch request you can do it either in the url like this:

    curl localhost:9200/_search?fields=id -d '{
      "query" : {
        "match_all" : {}
      }
    }'
    

    or directly in your query like this:

    {
        "fields" : ["id"],
        "query" : {
            "match_all" : {}
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have one time consuming step that flattens a bunch of files. basically i'd like
I have one model User and will be creating another one Category . Both
I have a massive, unfamiliar Java codebase that I need to use in one
I have found this one: http://www.sqlscriptgenerator.com/ Which is actually decent enough but it puts
I have one XML request which I need to modify (to XML) and then
I have one user (only one, all the others are fine) trying to update
I have one repo hosted at https://github.com/aikiframework/json . On my local copy, I added
I have one drop down list in my page, which contains two options. What
I have one problem with parsing *.docx document with OpenXML (C#). So, here's my
I have one table which contains events and dates, and another which contains the

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.