diff --git a/backend/src/main/java/com/storycove/service/SolrService.java b/backend/src/main/java/com/storycove/service/SolrService.java
index 38722b4..38d6d78 100644
--- a/backend/src/main/java/com/storycove/service/SolrService.java
+++ b/backend/src/main/java/com/storycove/service/SolrService.java
@@ -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");
diff --git a/solr/collections/conf/managed-schema b/solr/collections/conf/managed-schema
index 6edc8cf..c85270e 100755
--- a/solr/collections/conf/managed-schema
+++ b/solr/collections/conf/managed-schema
@@ -42,6 +42,7 @@
+
@@ -51,6 +52,7 @@
+
@@ -76,6 +78,7 @@
+