简体   繁体   中英

Searchlogic Limit

How do I pass a search limit on searchlogic....

user = User.name_like("John")

... and limit the search to 50 results?

I have a User almost 3,000+ and base on New Relic(Application Tracking) it takes too much memory in the server. I would like to limit the search to 50 for it to not search through all users.

user = User.name_like("John").limit(50)

or make use of other gems such as will_paginate? (ie returning the first page which contains 50 results)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM