accessing numfound value

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

accessing numfound value

Steve Pruitt
I'm having difficulty finding the value for numFound that is in the response.  My context is a custom component in the last-components list for /select.

Where rb is the ResponseBuilder parameter for the process(..) method:

rb.getNumberDocumentsFound() is 0.
rb.totalHitCount is 0.

I don't understand those values, why they are 0.

rb.getResults().docList.size() returns only the row size from the query.  I need the total hits.

In the JavaDoc it states rb.rsp.getResponse() returns just an Object.  I found it to be an instance of BasicResultContext in my case.  But, nothing in its description hints at how to get at the total found.

Can someone help?

Thanks.

-S
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: accessing numfound value

Rick Leir-2
Steve,
This is a wild guess because you are not telling us nearly enough. The guess: you are not getting any matches or hits. O. Cheers --Rick

On July 12, 2017 4:29:43 PM EDT, Steve Pruitt <[hidden email]> wrote:

>I'm having difficulty finding the value for numFound that is in the
>response.  My context is a custom component in the last-components list
>for /select.
>
>Where rb is the ResponseBuilder parameter for the process(..) method:
>
>rb.getNumberDocumentsFound() is 0.
>rb.totalHitCount is 0.
>
>I don't understand those values, why they are 0.
>
>rb.getResults().docList.size() returns only the row size from the
>query.  I need the total hits.
>
>In the JavaDoc it states rb.rsp.getResponse() returns just an Object.
>I found it to be an instance of BasicResultContext in my case.  But,
>nothing in its description hints at how to get at the total found.
>
>Can someone help?
>
>Thanks.
>
>-S

--
Sorry for being brief. Alternate email is rickleir at yahoo dot com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: accessing numfound value

Susheel Kumar-3
In reply to this post by Steve Pruitt
You get back QueryResponse after executing a query.  Then you can simply
use below to get qTime, ElapsedTime and numFound.

response.getQTime(),

response.getElapsedTime()

response.getResults().getNumFound()
Thanks,
Susheel

On Wed, Jul 12, 2017 at 4:29 PM, Steve Pruitt <[hidden email]> wrote:

> I'm having difficulty finding the value for numFound that is in the
> response.  My context is a custom component in the last-components list for
> /select.
>
> Where rb is the ResponseBuilder parameter for the process(..) method:
>
> rb.getNumberDocumentsFound() is 0.
> rb.totalHitCount is 0.
>
> I don't understand those values, why they are 0.
>
> rb.getResults().docList.size() returns only the row size from the query.
> I need the total hits.
>
> In the JavaDoc it states rb.rsp.getResponse() returns just an Object.  I
> found it to be an instance of BasicResultContext in my case.  But, nothing
> in its description hints at how to get at the total found.
>
> Can someone help?
>
> Thanks.
>
> -S
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [EXTERNAL] - Re: accessing numfound value

Steve Pruitt
In reply to this post by Rick Leir-2
Sorry. I am just starting out, so it's hard to know what is needed to describe a problem.

Yes, I get matches.  I use the default row setting of 10 and I the response has 10 matches.  But, the total number found is 53, which is correct.  I am using a test index and I know 53 is the correct total.

53 shows up as the value for numFound in the response.  I simply cannot find where this value is located starting from ResponseBuilder.

Thanks.

-S

-----Original Message-----
From: Rick Leir [mailto:[hidden email]]
Sent: Thursday, July 13, 2017 6:42 AM
To: [hidden email]
Subject: [EXTERNAL] - Re: accessing numfound value

Steve,
This is a wild guess because you are not telling us nearly enough. The guess: you are not getting any matches or hits. O. Cheers --Rick

On July 12, 2017 4:29:43 PM EDT, Steve Pruitt <[hidden email]> wrote:

>I'm having difficulty finding the value for numFound that is in the
>response.  My context is a custom component in the last-components list
>for /select.
>
>Where rb is the ResponseBuilder parameter for the process(..) method:
>
>rb.getNumberDocumentsFound() is 0.
>rb.totalHitCount is 0.
>
>I don't understand those values, why they are 0.
>
>rb.getResults().docList.size() returns only the row size from the
>query.  I need the total hits.
>
>In the JavaDoc it states rb.rsp.getResponse() returns just an Object.
>I found it to be an instance of BasicResultContext in my case.  But,
>nothing in its description hints at how to get at the total found.
>
>Can someone help?
>
>Thanks.
>
>-S

--
Sorry for being brief. Alternate email is rickleir at yahoo dot com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [EXTERNAL] - Re: accessing numfound value

Steve Pruitt
In reply to this post by Susheel Kumar-3
I see no reference to QueryResponse from ResponseBuilder.  QueryResponse appears to be a solr client class.

On ResponseBuilder there is a rsp member pointing to a SolrQueryResponse.  But this class doesn't seem to have access to the total hits.

I tried rb. getResponseDocs() which returns a SolrDocumentList.  It has a getNumFound() method.  But rb.getResponseDocs() is null.

Thanks.

-S

-----Original Message-----
From: Susheel Kumar [mailto:[hidden email]]
Sent: Thursday, July 13, 2017 6:47 AM
To: [hidden email]
Subject: [EXTERNAL] - Re: accessing numfound value

You get back QueryResponse after executing a query.  Then you can simply use below to get qTime, ElapsedTime and numFound.

response.getQTime(),

response.getElapsedTime()

response.getResults().getNumFound()
Thanks,
Susheel

On Wed, Jul 12, 2017 at 4:29 PM, Steve Pruitt <[hidden email]> wrote:

> I'm having difficulty finding the value for numFound that is in the
> response.  My context is a custom component in the last-components
> list for /select.
>
> Where rb is the ResponseBuilder parameter for the process(..) method:
>
> rb.getNumberDocumentsFound() is 0.
> rb.totalHitCount is 0.
>
> I don't understand those values, why they are 0.
>
> rb.getResults().docList.size() returns only the row size from the query.
> I need the total hits.
>
> In the JavaDoc it states rb.rsp.getResponse() returns just an Object.  
> I found it to be an instance of BasicResultContext in my case.  But,
> nothing in its description hints at how to get at the total found.
>
> Can someone help?
>
> Thanks.
>
> -S
>
Loading...