feat: Unify keyword and semantic search into 'Search My Library'#37
feat: Unify keyword and semantic search into 'Search My Library'#37amanvatss wants to merge 1 commit intoUjjwal-Bajpayee:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR consolidates two separate search interfaces ("Query Stored Summaries" and "Semantic Search (FAISS)") into a single unified "Search My Library" page. Users can now toggle between keyword and semantic search modes within one streamlined interface, improving the overall user experience while maintaining all existing functionality.
Key Changes:
- Removed two separate sidebar navigation options and replaced them with a single "📚 Search My Library" option
- Implemented a radio button toggle allowing users to select between "Keyword" and "Semantic" search modes
- Migrated all search result rendering and download functionality to the new unified page
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| # --- This is the logic from the old "Semantic Search (FAISS)" page --- | ||
| with st.spinner("Running semantic search..."): | ||
| try: | ||
| results = search_similar(query_input) |
There was a problem hiding this comment.
Inconsistent indentation detected. This line appears to have extra indentation compared to the surrounding code block. The indentation should align with other statements at the same nesting level (line 882 uses results = query_db(query_input) with consistent indentation).
| results = search_similar(query_input) | |
| results = search_similar(query_input) |
Feat: Unify Keyword and Semantic Search into "Search My Library" Page
**Closes: #31 **
This PR refactors the user-facing search experience by deprecating the two separate search pages (
Query Stored SummariesandSemantic Search (FAISS)).These have been replaced with a single, unified
📚 Search My Librarypage. This new interface provides a much cleaner UX by allowing the user to select their desired search mode (Keyword or Semantic) from a simple radio toggle before searching.All existing functionality, including loading spinners and the various download options (TXT, MD, PDF), has been preserved and migrated to this new unified page.
Changes Made
In
streamlit_app.py:Query Stored SummariesandSemantic Search (FAISS)from thest.radiosidebar options.📚 Search My Libraryoption to the sidebar.elifblocks that rendered the old, separate search pages.elifblock for📚 Search My Library.st.radioto select"Keyword"or"Semantic"mode.st.text_inputfor the query.🔍 Search Librarybutton.Rebuild Indexbutton (formerly on the "Semantic Search" page) into anst.expanderon this new page.query_dborsearch_similarbased on the selected search mode.How to Test
streamlit run streamlit_app.py.📚 Search My Libraryoption."Keyword".db.json."Semantic".🗂️ Index Managementexpander.🔄 Rebuild Indexand verify the loading animation plays and a success message appears.