You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2013/04/11 05:03:15 UTC
[jira] [Updated] (LUCENE-4926) speed up disjunctionmaxscorer
[ https://issues.apache.org/jira/browse/LUCENE-4926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Muir updated LUCENE-4926:
--------------------------------
Attachment: LUCENE-4926.patch
> speed up disjunctionmaxscorer
> -----------------------------
>
> Key: LUCENE-4926
> URL: https://issues.apache.org/jira/browse/LUCENE-4926
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Robert Muir
> Attachments: LUCENE-4926.patch
>
>
> Applying the same approach as LUCENE-4923 gives ~ 30% improvement according to luceneutil.
> {noformat}
> Task QPS trunk StdDev QPS patch StdDev Pct diff
> OrMaxHighHigh 17.94 (2.7%) 23.23 (3.1%) 29.5% ( 23% - 36%)
> OrMaxHighLow 28.08 (2.6%) 37.11 (3.9%) 32.1% ( 25% - 39%)
> OrMaxHighMed 16.80 (2.7%) 22.25 (3.9%) 32.5% ( 25% - 40%)
> {noformat}
> {noformat}
> diff -r e0ea40cf243c perf/TaskParser.java
> --- a/perf/TaskParser.java Mon Apr 01 14:49:08 2013 +0200
> +++ b/perf/TaskParser.java Wed Apr 10 22:35:40 2013 -0400
> @@ -31,6 +31,7 @@
> import org.apache.lucene.search.BooleanClause;
> import org.apache.lucene.search.BooleanQuery;
> import org.apache.lucene.search.CachingWrapperFilter;
> +import org.apache.lucene.search.DisjunctionMaxQuery;
> import org.apache.lucene.search.Filter;
> import org.apache.lucene.search.NumericRangeQuery;
> import org.apache.lucene.search.Query;
> @@ -169,6 +170,17 @@
> true);
> sort = null;
> group = null;
> + } else if (text.startsWith("disjunctionMax//")) {
> + final int spot3 = text.indexOf(' ');
> + if (spot3 == -1) {
> + throw new RuntimeException("failed to parse query=" + text);
> + }
> + DisjunctionMaxQuery dismax = new DisjunctionMaxQuery(1f);
> + dismax.add(new TermQuery(new Term(fieldName, text.substring(16, spot3))));
> + dismax.add(new TermQuery(new Term(fieldName, text.substring(spot3+1).trim())));
> + query = dismax;
> + sort = null;
> + group = null;
> } else if (text.startsWith("nrq//")) {
> // field start end
> final int spot3 = text.indexOf(' ');
> cat wikimedium.10M.nostopwords.tasks | grep "^Or" | sed -e "s/Or\([a-zA-Z]*\)\:\ /OrMax\1\:\ disjunctionMax\/\//g" > dismax.tasks
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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