fix: Display work/author metadata and improve section titles
Backend fix: - Remove return_properties from hierarchical chunk query - Weaviate returns nested objects (work, document) when return_properties is not specified - This allows chunks to have work.author and work.title available Frontend improvements: - Truncate long section titles to 80 chars with ellipsis - Hide section_path if identical to title (avoid duplication) - Work and author badges should now display correctly in chunk metadata
This commit is contained in:
@@ -442,15 +442,12 @@ def hierarchical_search(
|
||||
filters = filters & work_filter_obj
|
||||
|
||||
# Search chunks in this section
|
||||
# Note: Don't specify return_properties to get nested objects (work, document)
|
||||
chunks_result = chunk_collection.query.near_text(
|
||||
query=query,
|
||||
limit=limit,
|
||||
filters=filters,
|
||||
return_metadata=wvq.MetadataQuery(distance=True),
|
||||
return_properties=[
|
||||
"text", "sectionPath", "sectionLevel", "chapterTitle",
|
||||
"canonicalReference", "unitType", "keywords", "orderIndex", "language"
|
||||
],
|
||||
)
|
||||
|
||||
# Add chunks to section
|
||||
|
||||
Reference in New Issue
Block a user