Some questions about sorting results

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Some questions about sorting results

Gonzalo Faramiñan
Hi all,

I would like to add some sorting options. Just adding the Solr field at [Sorting] section of my local searches.ini file works fine, to me, with some indexes only (for instance, id).

I'm trying to sort by "building" (as primary and/or secondary sorting order). Just adding the field at searches.ini returns a 400 bad request error. I've seen that if I handle it as an array, adding "sort[]=building" directly on the web browser avoids the error. But it seems it's not working as a sorting criteria (is it at last working through relevance?)

So, some questiones:

1.- How can I add building Solr field as a working sorting order?
2.- Should I add "[]" at searches.ini/[Sorting] to get it work? If i do it, it's read as a section delimiter...

I populate the "Building" field trough respective properties files during (marc and xsl) import. On the other hand, it's working fine as a facet/filter.


Thanks in advance for any help!


------------------------------------------------------------------------------

_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Reply | Threaded
Open this post in threaded view
|

Re: Some questions about sorting results

Demian Katz

The problem is most likely related to the fact that Solr does not allow you to sort on multi-valued fields, because it does not know which value to use for sorting. If you want to sort on a multi-valued field, you need to create a custom single-valued sort version of the field, and configure the indexer to populate it. This can often be as simple as:


building_sort_str = [code to index building], first


If you have trouble setting this up, feel free to share your current building indexing rule.


- Demian




From: Gonzalo Faramiñan <[hidden email]>
Sent: Wednesday, November 23, 2016 8:37 AM
To: [hidden email]
Subject: [VuFind-Tech] Some questions about sorting results
 
Hi all,

I would like to add some sorting options. Just adding the Solr field at [Sorting] section of my local searches.ini file works fine, to me, with some indexes only (for instance, id).

I'm trying to sort by "building" (as primary and/or secondary sorting order). Just adding the field at searches.ini returns a 400 bad request error. I've seen that if I handle it as an array, adding "sort[]=building" directly on the web browser avoids the error. But it seems it's not working as a sorting criteria (is it at last working through relevance?)

So, some questiones:

1.- How can I add building Solr field as a working sorting order?
2.- Should I add "[]" at searches.ini/[Sorting] to get it work? If i do it, it's read as a section delimiter...

I populate the "Building" field trough respective properties files during (marc and xsl) import. On the other hand, it's working fine as a facet/filter.


Thanks in advance for any help!


------------------------------------------------------------------------------

_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Reply | Threaded
Open this post in threaded view
|

Re: Some questions about sorting results

Gonzalo Faramiñan
It worked perfectly,

Thank you!


2016-11-23 11:33 GMT-03:00 Demian Katz <[hidden email]>:

The problem is most likely related to the fact that Solr does not allow you to sort on multi-valued fields, because it does not know which value to use for sorting. If you want to sort on a multi-valued field, you need to create a custom single-valued sort version of the field, and configure the indexer to populate it. This can often be as simple as:


building_sort_str = [code to index building], first


If you have trouble setting this up, feel free to share your current building indexing rule.


- Demian




From: Gonzalo Faramiñan <[hidden email]>
Sent: Wednesday, November 23, 2016 8:37 AM
To: [hidden email]
Subject: [VuFind-Tech] Some questions about sorting results
 
Hi all,

I would like to add some sorting options. Just adding the Solr field at [Sorting] section of my local searches.ini file works fine, to me, with some indexes only (for instance, id).

I'm trying to sort by "building" (as primary and/or secondary sorting order). Just adding the field at searches.ini returns a 400 bad request error. I've seen that if I handle it as an array, adding "sort[]=building" directly on the web browser avoids the error. But it seems it's not working as a sorting criteria (is it at last working through relevance?)

So, some questiones:

1.- How can I add building Solr field as a working sorting order?
2.- Should I add "[]" at searches.ini/[Sorting] to get it work? If i do it, it's read as a section delimiter...

I populate the "Building" field trough respective properties files during (marc and xsl) import. On the other hand, it's working fine as a facet/filter.


Thanks in advance for any help!



------------------------------------------------------------------------------

_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech