Closed (fixed)
Project:
Search API Solr
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Sep 2012 at 09:28 UTC
Updated:
8 Apr 2021 at 14:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
drunken monkeyJust realized that we still aren't doing this. Patch attached which should fix that. (It also fixes some slightly related problem when passing empty array parameters, and unsets the
qfparameter when no keys are present. (I don't think either makes any difference to Solr or performance, but the URLs look a bit cleaner then which makes debugging easier.))Comment #2
drunken monkeyCommitted.
Comment #4
Anonymous (not verified) commentedHi,
After upgrading to the latest search_api_solr version I noticed a performance downgrade because of this patch. A performance gain can be acquired by using fq instead of q. Not the other way around. The idea behind q.alt is to set a default query when q is empty.
Filter queries take advantage of the filter cache, whereas doing a normal query it will not. I would strongly advise to remove this "performance improvement" in order to get back the real performance improvement, which is, use filter queries to filter, even when the query is empty.
From https://cwiki.apache.org/confluence/display/solr/Common+Query+Parameters
Better would be to make q.alt configurable from a view, which should contain a query, not filters.
Best,
Jeroen
Comment #5
nick_vhq.alt should be used when the q parameter is empty. This way you avoid going through the query parser and you can directly start filtering your content.
Can you prove with some more numbers, in Solr access log format, that the q.alt in your case is actually slower compared to the empty q= and the fq parameters?
This thread mentions that it actually increases performance when used correctly:
https://www.drupal.org/node/1429218
Comment #6
drunken monkeyYes, could you please provide some benchmarks on this? The Apachesolr module has had this for ages and no-one has ever complained there (as far as I know – or at least not convinced the maintainers). Best make benchmarks with different loads and different index sizes.
Comment #7
drunken monkeySee #2532812: Revert the "q.alt" performance "improvement" for this discussion.
Performance tests would still be great, but I'm pretty much convinced now anyways.
Comment #9
jordanmagnuson commentedHas default q.alt handling changed at all in recent versions of solr? I just upgraded from Solr 3.x to 6.x, and was getting strange behavior on my Browse pages (with custom filters) defined by the Apache Solr module.
Specifically, these browse pages started to return all results, rather than only results defined by my custom filters, and it appears that the reason for this is that somehow in switching from Solr 3.x to Solr 6.x, the q.alt parameters got switched from AND processing to OR processing. See screenshot: http://i.imgur.com/zR2OS06.png
I altered apachesolr.module and changed the equivalent of line 916 in the above patch from:
To:
And that solved the issue for me. Any thoughts? Should this be changed in the core module code, or is there another way I should be handling this?
Comment #10
martingz commentedAny news on this?
Comment #11
jordanmagnuson commentedThis seems to be fixed in latest builds.