Closed (fixed)
Project:
Apache Solr Views
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Jan 2015 at 16:36 UTC
Updated:
22 Dec 2015 at 18:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bdlangton commentedComment #2
bdlangton commentedComment #3
bdlangton commentedOne more change was needed. Updated patch.
Comment #4
bdlangton commentedSorry, #3 didn't have the full changes.
Comment #5
miroslavbanov commentedIt is working for me with these modules:
Comment #6
erik frèrejeanI'm seeing the same issue with the following configuration:
apachesolr: 7.x-1.7
apachesolr_views: 7.x-1.x-dev
views: 7.x-3.10
The parameters on the view URI are: ?order=sm_vid_Informatiesoorten&sort=desc
Applying the patch from #4, resolves this issue for me.
Comment #7
miroslavbanov commented@Erik Frèrejean
I tried to reproduce your case and all I get is "HTTP 400; can not sort on multivalued field" with or without the patch in #4 (as I see you are sorting on multivalued term reference: "sm_vid_Informatiesoorten"). I am still trying to understand in what situation this patch will help. Perhaps if you export the view from the administration and upload it here, I can use it as a test case.
Comment #8
erik frèrejean@MiroslavBanov, I'll send you the view export through a pm. Rather not have those things floating around ;).
Comment #9
torgospizzaSorting on a multivalue field doesn't work: "sm_vid_Informatiesoorten" - the "sm" means "string multiple" and allows for more than one value to be attached to that field.
Your best advice is to recreate that as "ss" - or string single field.
Comment #10
erik frèrejeanWell the funny thing is that the sorting somehow does work. It appears to be sorting on the first element in the multivalue (don't ask me exactly how/why that works as I haven't build this view initially)
Comment #11
miroslavbanov commentedWhat I can say is that if the patch #4 is applied, it will break multiple sort criteria.
I exchanged some info with Erik Frèrejean, and could not understand why patch #4 helps his situation situation. Anyway, the actual Solr query can be traced/dumped, and then if it is different with and without the patch, the difference can be back-traced to what is causing it.
For this issue, I need more details than "Sorting doesn't work". One problem that might be affecting some people (but probably not Erik Frèrejean) is that something could call
SolrBaseQuery::parseSortStringand this can reset the Solr filters. This can be overridden in apachesolr_views_solr_base_query, so that the parseSortString() method does not do anything (it doesn't support multiple sort criteria, so we don't want it anyway).Comment #12
estebanvalerio.h commentedNone of the above patches worked for me but a mix of them did. Not sure if it is because I'm applying other patches to the module or if there is another reason.
I'm attaching the one that works for me
Comment #13
miroslavbanov commentedestebanvalerio.h,
Could tell which exactly version of Apachesolr Views you are using, and what patches?
Comment #14
j1mb0b commentedSince the above patch in comment #4 didn't work, I have re-uploaded the patch. I have tested this against multiple sort criteria and it seems to work accordingly.
Here is the output of the sorts:
As expected my results get filtered by sticky and then publish date etc...
I'm using version 7.x-1.1-beta1.
Comment #15
j1mb0b commentedAfter some debugging I have discovered the issue for me, using apachesolr_views in conjunction with weight module breaks all sorts defined in views.
I have created a separate issue for this: https://www.drupal.org/node/2628236
Comment #16
miroslavbanov commented@kingmackenzie
What is the $params['sort'] parameter of the Solr query, after the sortstring with multiple sorts is parsed? For me, I never could get multiple sort parameters to work, unless I directly set the sort parameter with
query->replaceParam('sort', $this->orderby). And also I didn't want to deal with setting "available" sorts.Comment #17
miroslavbanov commentedWith #2628236-4: Apach Solr views sorting not working with setAvailableSort() applied, I think #14 will not change sort order at all. Can't be sure though - people here seem to be experiencing issue that I am not able to reproduce.
Comment #18
j1mb0b commented@MiroslavBanov
Since the related issue I created is merge parsing shouldn't be an issue?Agreed #14, at least for my case, is no longer required based on issue #2628236.
Comment #19
miroslavbanov commentedI call this one fixed but feel free to reopen if it isn't. Thanks to everyone who contributed to the thread.