[opencms-dev] Solr sorting issue

Stephan Hartmann hartmann at metamesh.de
Fri Feb 14 10:26:15 CET 2014


Hi Thorsten,
I missed that with your priority sort field.
Do you just want to give your higher prioritized elements some kind of a
boolean boost, i.e. a checkbox, so that all elements marked with the
checkbox come first, ordered by their title and then all elements without
this checkbox checked, again ordered by their title, or do you want to
completely adjust the order of the higher prioritized elements?
For the first case, map your boolean value to a field named
"priority_sort_b" or so, *_b is mapped as dynamic field of type boolean.
For the second case, try to map your integer value to a field of type sint
(sortable int). There is no dynamic field definition for that type, so you
have to create your own field definition like for your sort title.
In either case, you can sort in solr by multiple fields. First take your
priority sort field, then your title field, e.g. "sort=priority_sort_b asc,
sorttitle_de_s asc".
Both types, boolean and sint, are defined to sort empty values at the end,
so you should be fine with this default setting.

HTH,
Stephan



2014-02-13 15:56 GMT+01:00 Thorsten Duhn <duhn at regio-gmbh.de>:

> Hello,
>
>
>  You could configure a new field in Solr's schema
>> (/WEB-INF/solr/conf/schema.xml) that takes a copy of your title
>> with a type that is appropriate for your sorting requirements.
>>
>
> thanks a lot for your response. Sounds great for the smaller problem
> (sorting case-insensitive and ignoring special characters), but is this a
> way to solve the problem of having some items sorted out of order (f.i.
> first) without modifying title? That was why I mentioned this idea of
> having another "sortname" field with some different content, and my problem
> of getting default value for this. Maybe it's just a stupid way and you
> know something better.
>
> Regards,
>
> Thorsten
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20140214/660294b0/attachment.htm>


More information about the opencms-dev mailing list