lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Keegan <>
Subject Re: Function query matching
Date Wed, 27 Nov 2013 18:58:06 GMT
Although the 'scale' is a big part of it, here's a closer breakdown. Here
are 4 queries with increasing functions, and theei response times (caching
turned off in solrconfig):

100 msec:
select?q={!edismax v='news' qf='title^2 body'}

135 msec:
select?qq={!edismax v='news' qf='title^2
body'}q={!func}product(field(myfield),query($qq)&fq={!query v=$qq}

200 msec:
select?qq={!edismax v='news' qf='title^2

320 msec:
select?qq={!edismax v='news' qf='title^2

Btw, that no-op product is necessary, else you get this exception:$BooleanWeight cannot be cast to



On Wed, Nov 27, 2013 at 1:30 PM, Chris Hostetter

> : So, this query does just what I want, but it's typically 3 times slower
> : than the edismax query  without the functions:
> that's because the scale() function is inhernetly slow (it has to
> compute the min & max value for every document in order to know how to
> scale them)
> what you are seeing is the price you have to pay to get that query with a
> "normalized" 0-1 value.
> (you might be able to save a little bit of time by eliminating that
> no-Op multiply by 1: "product(query($qq),1)" ... but i doubt you'll even
> notice much of a chnage given that scale function.
> : Is there any way to speed this up? Would writing a custom function query
> : that compiled all the function queries together be any faster?
> If you can find a faster implementation for scale() then by all means let
> us konw, and we can fold it back into Solr.
> -Hoss

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message