SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: Limiting number of search results

This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Pages: 1 - Last Post: Sep 7, 2010 12:06 PM Last Post By: Khosro
mihwang

Posts: 14
Registered: 7/13/10
Limiting number of search results
Posted: Aug 10, 2010 5:09 PM
 
  Click to reply to this thread Reply
I am only concerned with the top search results, but each search generates a lot more than I need.

Is there a way to limit the number of search results returned to improve efficiency? So, for example, after finding the top 100 matches, the results will simply be returned instead of continuing to find more.

Thanks,

Mike
Gorunus

Posts: 9
Registered: 7/20/10
Re: Limiting number of search results
Posted: Sep 3, 2010 3:07 AM   in response to: mihwang in response to: mihwang
 
  Click to reply to this thread Reply
I am facing the same problem!
Have you managed to get a solution?

Tks
Khosro

Posts: 21
Registered: 5/16/09
Re: Limiting number of search results
Posted: Sep 7, 2010 12:06 PM   in response to: mihwang in response to: mihwang
 
  Click to reply to this thread Reply
You can use "detach" method of CompassHits.
Look at the following code :
@Resource
  CompassSession compassSession;
 
compassSession.find("your query").detach(1, 100);


Khosro.
Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums