Closed (fixed)
Project:
Apache Solr Search
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 May 2009 at 10:58 UTC
Updated:
14 May 2009 at 00:00 UTC
For returning distributed search results, need to know the total count of search results found to build a pager.
| Comment | File | Size | Author |
|---|---|---|---|
| apachesolr_return_total.patch | 1.78 KB | aufumy |
Comments
Comment #1
pwolanin commentedWe already build a pager for search, and we already get the total in the response, so I'm rather unclear why this is needed
Comment #2
aufumy commentedIf other types of interfaces want to query apache solr search to return results, whether exhibit or distributed search via xmlrpc services, the results returned would be by default the first 10 formatted results, with no indication to the caller how many there are in total.
Therefore on the callers side, it cannot show how many pages or results in total.
Comment #3
Scott Reynolds commentedThat prevents you from executing two queries....
Comment #4
aufumy commentedI considered this earlier, and maybe I haven't experimented enough, but I do not believe it would work with separate remote xmlrpc calls.
Since they are completely different calls, I do not believe that the other call would have to the cached $response values in static $_response.
However, the way that I tried to test the theory earlier was by running normal apache solr search, and then having a different page run the code similar to the snippet above, $response was not populated.
Comment #5
pwolanin commentedObviously it won't work in different page loads, but why not just send back the 1st result set + the count on one xml-rpc call?
Comment #6
aufumy commentedActually that makes a lot of sense, thank you for the responses, my brain is going in circles.
Just thinking out loud, the returned array returned could have
$results['total'] = 123;
$results[0]['id'] = 'b9fcd1c7caf9/node/5174';
$results[0]['name'] = 'test.user';
$results[0]['nid'] = '5174';
$results[0]['title'] = 'Test title...';
...