Dhaval
Dhaval

Reputation: 166

Solr query having Frange with complex custom function performance issue

We are making a solr query where we are giving a custom function (which is pretty complex) and sorting the results by value of that function. The time taken by the query was in the range of 200 to 400 miliseconds. After this we added

fq:{!frange l=40 u=100}$complexCustomFunction

so the whole complex query looks like

solr/select?customFunc=complexFunction(querySpecificValue1,querySpecificValue2)&sort_by=$customFunc&fq={!frange l=40 u=100}$customFunc...

After adding just this frange fq the time taken for the query has go up ten times, so it takes around 4secs

Upvotes: 1

Views: 749

Answers (1)

Dhaval
Dhaval

Reputation: 166

We just moved the frange from fq to q and that changed the time taken by the query between 200 to 400ms. The resulting query now looking something like this:

customFunc=complexFunction(querySpecificValue1,querySpecificValue2)&sort_by=$customFunc&q={!frange l=40 u=100}$customFunc...

Upvotes: 2

Related Questions