You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by David Ryan <he...@gmail.com> on 2011/10/03 22:58:13 UTC

How to obtain the Explained output programmatically ?

Hi,

I need to use some detailed information of the explained result in Solr
search.

Here is one example:

*
http://localhost:8983/solr/select/?q=GB&version=2.2&start=0&rows=10&indent=on&debugQuery=true&fl=id,score
*

    <str name="6H500F0">
0.18314168 = (MATCH) sum of:
  0.18314168 = (MATCH) weight(text:gb in 1), product of:
    0.35845062 = queryWeight(text:gb), product of:
      2.3121865 = idf(docFreq=6, numDocs=26)
      0.15502669 = queryNorm
    0.5109258 = (MATCH) fieldWeight(text:gb in 1), product of:
      1.4142135 = tf(termFreq(text:gb)=2)
      2.3121865 = idf(docFreq=6, numDocs=26)
      0.15625 = fieldNorm(field=text, doc=1)
</str>

I could see the explained result by clicking the "toggle explain" button in
the web browser.   Is there a way to access the explained output
programmatically?


Regards,
David

Re: How to obtain the Explained output programmatically ?

Posted by Erick Erickson <er...@gmail.com>.
If we're talking SolrJ here, I *think* you can
get it from the NamedList<Object> returned
from SolrResponse.getResponse, but I confess
I haven't tried it.

If not SolrJ, what is your plugin doing? And
where to you expect your plugin to be in
the query process?

Best
Erick

On Mon, Oct 3, 2011 at 5:31 PM, David Ryan <he...@gmail.com> wrote:
> Thanks Hoss!
>
> debug.explain.structured<https://wiki.apache.org/solr/CommonQueryParameters#debug.explain.structured>
> is
> definitely helpful.  It adds some structure to the plain explained output.
> Is there a way to access these structured outputs in Java code (e.g., via
> Solr plugin class)?
> We could write a HTML parse to examine the output in the browser, but it's
> probably no the best way to do that.
>
>
>
> On Mon, Oct 3, 2011 at 2:11 PM, Chris Hostetter <ho...@fucit.org>wrote:
>
>>
>> :
>> http://localhost:8983/solr/select/?q=GB&version=2.2&start=0&rows=10&indent=on&debugQuery=true&fl=id,score
>>        ...
>> : the web browser.   Is there a way to access the explained output
>> : programmatically?
>>
>> https://wiki.apache.org/solr/CommonQueryParameters#debug.explain.structured
>>
>>
>> -Hoss
>>
>

Re: How to obtain the Explained output programmatically ?

Posted by David Ryan <he...@gmail.com>.
Thanks Hoss!

debug.explain.structured<https://wiki.apache.org/solr/CommonQueryParameters#debug.explain.structured>
is
definitely helpful.  It adds some structure to the plain explained output.
Is there a way to access these structured outputs in Java code (e.g., via
Solr plugin class)?
We could write a HTML parse to examine the output in the browser, but it's
probably no the best way to do that.



On Mon, Oct 3, 2011 at 2:11 PM, Chris Hostetter <ho...@fucit.org>wrote:

>
> :
> http://localhost:8983/solr/select/?q=GB&version=2.2&start=0&rows=10&indent=on&debugQuery=true&fl=id,score
>        ...
> : the web browser.   Is there a way to access the explained output
> : programmatically?
>
> https://wiki.apache.org/solr/CommonQueryParameters#debug.explain.structured
>
>
> -Hoss
>

Re: How to obtain the Explained output programmatically ?

Posted by Chris Hostetter <ho...@fucit.org>.
: http://localhost:8983/solr/select/?q=GB&version=2.2&start=0&rows=10&indent=on&debugQuery=true&fl=id,score
	...
: the web browser.   Is there a way to access the explained output
: programmatically?

https://wiki.apache.org/solr/CommonQueryParameters#debug.explain.structured


-Hoss