Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting fails in certain cases due to wrong fieldtype in schema.xml #863

Closed
michaelkubina opened this issue Nov 14, 2022 · 0 comments · Fixed by #879
Closed

Sorting fails in certain cases due to wrong fieldtype in schema.xml #863

michaelkubina opened this issue Nov 14, 2022 · 0 comments · Fixed by #879
Labels
🐛 bug A non-security related bug.

Comments

@michaelkubina
Copy link
Collaborator

Description

The sorting feature has a fundamental issue, due to the wrong field type specified in the copyfield directive for the field "*_sorting". This causes unexpected and seemingly irrational behaviour of the sorting form or the order of the resultset respectivly.

As long as a metadata is just a single token or value, the sorting works as expecte. As soon as it consists of more than one token it fails to sort properly.

According to the SOLR-Documentation sortable fields are "score", not multivalued, single tokens (likewise analyzed with the keywordTokenizer), from a function or fundamental fieldtypes like string, int, bool. (https://solr.apache.org/guide/8_11/common-query-parameters.html#sort-parameter). Sorting does not work properly, when it's an analyzed field.

In the schema.xml the copyfield uses the "standard" fieldtype, that has its whole analyzerchain:
<dynamicField name="*_sorting" type="standard" stored="true" indexed="true" multiValued="false" />
When it actually should be a string:
<dynamicField name="*_sorting" type="string" stored="true" indexed="true" multiValued="false" />

Changing this would lead to the necessity of creating a fresh core and re-indexing all documents into it. Otherwise SOLR would log errors because of missmatching fieldtypes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug A non-security related bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant