diff --git a/generations/library_rag/flask_app.py b/generations/library_rag/flask_app.py index 43d0e7a..2e9cdc4 100644 --- a/generations/library_rag/flask_app.py +++ b/generations/library_rag/flask_app.py @@ -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 diff --git a/generations/library_rag/templates/search.html b/generations/library_rag/templates/search.html index d247415..13a8397 100644 --- a/generations/library_rag/templates/search.html +++ b/generations/library_rag/templates/search.html @@ -178,11 +178,13 @@
📍 {{ section.section_path }}
+ {% if section.section_path and section.section_path != section.title %} +📍 {{ section.section_path }}
+ {% endif %} {% if section.summary_text %}{{ section.summary_text }}
{% endif %}