You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Trejkaz (JIRA)" <ji...@apache.org> on 2011/04/05 01:11:05 UTC

[jira] [Created] (LUCENE-3013) I wish Lucene query explanations were easier to localise

I wish Lucene query explanations were easier to localise
--------------------------------------------------------

                 Key: LUCENE-3013
                 URL: https://issues.apache.org/jira/browse/LUCENE-3013
             Project: Lucene - Java
          Issue Type: Wish
          Components: Query/Scoring
            Reporter: Trejkaz


Often users ask us to provide a nice UI to explain why a document matched their query.  Currently the strings output by Explanation are very advanced, and probably only understandable to those who have worked on Lucene.  I took a shot at trying to make them friendlier, but it basically came down to parsing the strings it output and trying to figure out what kind of query was at each point (the inability to get to a Query from the Explanation is a small part of the problem here), formulating the result into readable English.  In the end it seems a bit too hard.

The solution to this could be done in at least two ways:

1. Add getLocalizedSummary() / getLocalizedDescription() method(s) and use resource bundles internally.  Projects wishing to localise these could add their own resource bundles to the classpath and/or get them contributed to Lucene.

2. Add subclasses of Explanation with enough methods for callers to interrogate the individual details of the explanation instead of outputting it as a monolithic string.

I do like the tree structure of explanations a lot (as it resembles the query tree), I just think there is work to be done splitting up the strings into usable fragments of information.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3013) I wish Lucene query explanations were easier to localise

Posted by "Michael McCandless (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3013?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-3013:
---------------------------------------

    Labels: gsoc2012 lucene-gsoc-12  (was: )
    
> I wish Lucene query explanations were easier to localise
> --------------------------------------------------------
>
>                 Key: LUCENE-3013
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3013
>             Project: Lucene - Java
>          Issue Type: Wish
>          Components: core/query/scoring
>            Reporter: Trejkaz
>              Labels: gsoc2012, lucene-gsoc-12
>
> Often users ask us to provide a nice UI to explain why a document matched their query.  Currently the strings output by Explanation are very advanced, and probably only understandable to those who have worked on Lucene.  I took a shot at trying to make them friendlier, but it basically came down to parsing the strings it output and trying to figure out what kind of query was at each point (the inability to get to a Query from the Explanation is a small part of the problem here), formulating the result into readable English.  In the end it seems a bit too hard.
> The solution to this could be done in at least two ways:
> 1. Add getLocalizedSummary() / getLocalizedDescription() method(s) and use resource bundles internally.  Projects wishing to localise these could add their own resource bundles to the classpath and/or get them contributed to Lucene.
> 2. Add subclasses of Explanation with enough methods for callers to interrogate the individual details of the explanation instead of outputting it as a monolithic string.
> I do like the tree structure of explanations a lot (as it resembles the query tree), I just think there is work to be done splitting up the strings into usable fragments of information.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3013) I wish Lucene query explanations were easier to localise

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037062#comment-13037062 ] 

Hoss Man commented on LUCENE-3013:
----------------------------------

bq. 2. Add subclasses of Explanation with enough methods for callers to interrogate the individual details of the explanation instead of outputting it as a monolithic string.

I think this is definitely the way to go ... most Explanation objects tend to fall into two fairly basic categories...

* atomic value (ie: the norm for a field, boost multiplier, etc...)
* mathmatic operation on sub explanations (ie: product of all child explanations; addition of all child explanations; etc..)

I think each of those should be concrete subclasses of ComplexExplanation with methods for some of the fixed metadata (ie: the type of math operator), and i think we should then add more additional subclasses of each of those for the things that are really common in Lucene with additional methods where appropriate...

* QueryNormExplanation extends AtomicValueExplanation (no special methods)
* IDFExplanation extends AtomicValueExplanation (getDocFreq, getMaxDocs)
* QueryWeightExplanation extends ProductExplanation (getTerm)
* FieldNormExplanation extends AtomicValueExplanation (getField, getDocId)
* TFExplanation extends AtomicValueExplanation (getTerm, getFreq)
* etc...

...simple clients could then continue to use the simple getValue/getDescription methods, but more complex clients could use introspection to see if it's a ttype they want to generate a more user freindly "explanation" our of.

> I wish Lucene query explanations were easier to localise
> --------------------------------------------------------
>
>                 Key: LUCENE-3013
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3013
>             Project: Lucene - Java
>          Issue Type: Wish
>          Components: core/query/scoring
>            Reporter: Trejkaz
>
> Often users ask us to provide a nice UI to explain why a document matched their query.  Currently the strings output by Explanation are very advanced, and probably only understandable to those who have worked on Lucene.  I took a shot at trying to make them friendlier, but it basically came down to parsing the strings it output and trying to figure out what kind of query was at each point (the inability to get to a Query from the Explanation is a small part of the problem here), formulating the result into readable English.  In the end it seems a bit too hard.
> The solution to this could be done in at least two ways:
> 1. Add getLocalizedSummary() / getLocalizedDescription() method(s) and use resource bundles internally.  Projects wishing to localise these could add their own resource bundles to the classpath and/or get them contributed to Lucene.
> 2. Add subclasses of Explanation with enough methods for callers to interrogate the individual details of the explanation instead of outputting it as a monolithic string.
> I do like the tree structure of explanations a lot (as it resembles the query tree), I just think there is work to be done splitting up the strings into usable fragments of information.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org