This commit is contained in:
Stefan Hardegger
2026-07-20 12:32:53 +02:00
parent f7eabe1761
commit ddfc5aef99
2 changed files with 7 additions and 3 deletions

View File

@@ -912,8 +912,8 @@ public class SolrService {
solrQuery.setStart(page * limit);
solrQuery.setRows(limit);
// Sorting - by name ascending
solrQuery.setSort("name", SolrQuery.ORDER.asc);
// Sorting - by name ascending (name_sort is a docValues string copy of name)
solrQuery.setSort("name_sort", SolrQuery.ORDER.asc);
// Explicitly disable faceting
solrQuery.setFacet(false);
@@ -1150,7 +1150,8 @@ public class SolrService {
collection.setCoverImagePath((String) doc.getFieldValue("coverImagePath"));
collection.setIsArchived((Boolean) doc.getFieldValue("isArchived"));
collection.setStoryCount((Integer) doc.getFieldValue("storyCount"));
collection.setTotalWordCount((Integer) doc.getFieldValue("totalWordCount"));
Number totalWordCountVal = (Number) doc.getFieldValue("totalWordCount");
collection.setTotalWordCount(totalWordCountVal != null ? totalWordCountVal.intValue() : null);
collection.setEstimatedReadingTime((Integer) doc.getFieldValue("estimatedReadingTime"));
Double avgRating = (Double) doc.getFieldValue("averageStoryRating");

View File

@@ -42,6 +42,7 @@
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
<fieldType name="pdate" class="solr.DatePointField" docValues="true"/>
<fieldType name="strings" class="solr.StrField" sortMissingLast="true" multiValued="true" docValues="true"/>
<fieldType name="string_facet" class="solr.StrField" sortMissingLast="true" docValues="true"/>
<fieldType name="random" class="solr.RandomSortField" indexed="true"/>
<!-- Fields -->
@@ -51,6 +52,7 @@
<!-- Core Collection Fields -->
<field name="name" type="text_enhanced" indexed="true" stored="true" required="true"/>
<field name="name_sort" type="string_facet" indexed="true" stored="false"/>
<field name="description" type="text_general" indexed="true" stored="true"/>
<field name="rating" type="pint" indexed="true" stored="true"/>
<field name="coverImagePath" type="string" indexed="false" stored="true"/>
@@ -76,6 +78,7 @@
<field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>
<copyField source="name" dest="text"/>
<copyField source="name" dest="name_sort"/>
<copyField source="description" dest="text"/>
<copyField source="tagNames" dest="text"/>