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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:01:00+00:00 2026-05-21T02:01:00+00:00

in the docs it’s said: MyObject.search() returns an instance of MetaSearch::Builder (something like ActiveRecord::Relation).

  • 0

in the docs it’s said:

MyObject.search()

returns an instance of MetaSearch::Builder (something like ActiveRecord::Relation). But in my case when I do this I get a collection of objects because the sql-query is send to the database.

I would like to have something like this:

search = MyObject.search() # no sql-query should be done here

count = search.count # count sql done

objects = search.all # select sql done - maybee with pagination

does anyone know how to stop Meta_search from doing the the query to early?

-> ok, something mysterious going on in my shell:

search = MyObject.search() # queries the database
search = MyObject.search(); 0 # stores a MetaSearch-Object in search

the console seems to call an extra method after each comand

  • 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-21T02:01:01+00:00Added an answer on May 21, 2026 at 2:01 am

    If you’re testing in irb, be aware that returned objects are inspected. In the case of a MetaSearch builder, this means the relation gets inspected. If you have a look at ActiveRecord’s inspect method, in relation.rb, you’ll see that it calls to_a, which executes the query and returns the results.

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

Sidebar

Related Questions

The docs mention :XML, :JSON, and :HTML, but I have a URL that returns
The docs for Dictionary.TryGetValue say: When this method returns, [the value argument] contains the
MSDN docs say that only value types need boxing, but this does not apply
http://docs.python.org/3.0/whatsnew/3.0.html says it lists whats new , but in my opinion, it only lists
https://docs.oracle.com/javase/6/docs/api/java/lang/System.html#currentTimeMillis() says: Returns the current time in milliseconds. Note that while the unit of
The docs vaguely say that it will stick around as long as needed, but
DOCS http://developer.yahoo.com/yui/3/event/#eventsimulation . but I do not understand how to do it( So how
Docs say: Returns TRUE if the file named by filename was uploaded via HTTP
Google Docs does provide sharing of files.But it does not provide sharing of folders.
The docs say: F# gives special status to non-virtual instance member properties compatible with

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.