lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Busch (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-1293) Tweaks to PhraseQuery.explain()
Date Sat, 24 May 2008 22:39:55 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-1293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Busch updated LUCENE-1293:
----------------------------------

    Fix Version/s:     (was: 2.3.2)

> Tweaks to PhraseQuery.explain()
> -------------------------------
>
>                 Key: LUCENE-1293
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1293
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>    Affects Versions: 1.9, 2.0.0, 2.1, 2.2, 2.3, 2.3.1, 2.3.2, 2.4
>            Reporter: Itamar Syn-Hershko
>            Priority: Minor
>             Fix For: 2.4
>
>
> The explain() function in PhraseQuery.java is very clumzy and could use many optimizations.
Perhaps it is only because it is intended to use while debugging?
> Here's an example:
> {noformat}
>       result.addDetail(fieldExpl);
>       // combine them
>       result.setValue(queryExpl.getValue() * fieldExpl.getValue());
>       if (queryExpl.getValue() == 1.0f)
>         return fieldExpl;
>       return result;
>    }
> {noformat}
> Can easily be tweaked and become:
> {noformat}
>       if (queryExpl.getValue() == 1.0f) {
>         return fieldExpl;
>       }
>       result.addDetail(fieldExpl);
>       // combine them
>       result.setValue(queryExpl.getValue() * fieldExpl.getValue());
>       return result;
>   }
> {noformat}
> And thats really just for a start...
> Itamar.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message