Skip to content

Add enhanced search with autocomplete Enter-to-search and dedicated results page - #339

Merged
jpmccu merged 7 commits into
mainfrom
copilot/update-search-autocomplete-functionality
Dec 19, 2025
Merged

jpmccu merged 7 commits into
mainfrom
copilot/update-search-autocomplete-functionality

Conversation

Copilot AI commented Dec 19, 2025 •

Copy link
Copy Markdown
Contributor

The search autocomplete lacked keyboard-driven search submission and the search results view was still using deprecated AngularJS. This implements a modern search experience with Enter-key search submission and a Vue-based results page with infinite scroll.

Changes

Search Autocomplete Component

  • Rewrote to handle Enter key → navigates to search page with query
  • Added "Search for '{{query}}'" option (always first in dropdown)
  • Arrow key navigation across search option and entity results
  • Removed nested component dependency for direct control

Search Results Page (search-page.vue)

  • Vue 2 component with dedicated search bar for new queries
  • Infinite scroll: displays 10 results at a time from pre-fetched data (limit: 1000)
  • Search-engine style cards: title, description, types, direct entity links
  • Right sidebar: KG card for highest-scoring result
  • IntersectionObserver for efficient scroll detection

Backend Templates

  • search.json: SPARQL full-text search with score-based ordering
  • search.html: Vue component wrapper

View System Registration (default_vocab.ttl)

  • Updated whyis:search to use search.html (Vue-based) instead of search-view.html (AngularJS)
  • Added whyis:searchData property pointing to search.json SPARQL template
  • Defined whyis:searchView and whyis:searchData as subproperties of whyis:hasView

Usage

// Autocomplete now supports Enter key
<search-autocomplete></search-autocomplete>

// New dedicated search page
<search-page></search-page>

Users can now:

  1. Type in search autocomplete, press Enter → redirects to /about?view=search&query=...
  2. Click "Search for '{{term}}'" in autocomplete dropdown
  3. Scroll infinitely through results
  4. View top result details in sidebar KG card
Original prompt

The current search autocomplete component isn't working correctly. It needs to implement the following additional behavior (in addition to its existing autocomplete function):

When the user hits enter, the search string is sent to the search view to render as a web page.

The user can also select "search for '{{search value}}' and also be sent to the search page with that as the search string.

The search page needs to be migrated to Vue 3.

The search page needs a dedicated search bar that performs new searches.

Search results should be displayed in useful ways like a search engine.

The search results should offer infinite scroll like the instances views.

If there's a good match, the highest scoring entity should be displayed on a right sidebar using a kg card.

All matches (and the KG card) should link to the pages for the entities in question.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits December 19, 2025 04:25
Co-authored-by: jpmccu <602385+jpmccu@users.noreply.github.com>
…delay, increase search limit

Co-authored-by: jpmccu <602385+jpmccu@users.noreply.github.com>
Co-authored-by: jpmccu <602385+jpmccu@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix search autocomplete component to enhance functionality Add enhanced search with autocomplete Enter-to-search and dedicated results page Dec 19, 2025
Copilot AI requested a review from jpmccu December 19, 2025 04:36
@jpmccu

jpmccu commented Dec 19, 2025

Copy link
Copy Markdown
Member

@copilot You also need to update the search views in default_vocab.ttl to make sure things render correctly. That's the primary way that we display web pages and data.

Co-authored-by: jpmccu <602385+jpmccu@users.noreply.github.com>

Copilot AI commented Dec 19, 2025

Copy link
Copy Markdown
Contributor Author

@copilot You also need to update the search views in default_vocab.ttl to make sure things render correctly. That's the primary way that we display web pages and data.

Updated in commit 8206da9. Changed whyis:search to use the new search.html template (Vue-based) instead of search-view.html (AngularJS), and added whyis:searchData property pointing to the new search.json SPARQL template.

@github-actions

Copy link
Copy Markdown

✅ Vue.js tests passed! Coverage report available in artifacts.

@jpmccu
jpmccu marked this pull request as ready for review December 19, 2025 18:26
@jpmccu
jpmccu merged commit 887021e into main Dec 19, 2025
3 checks passed
@jpmccu
jpmccu deleted the copilot/update-search-autocomplete-functionality branch December 19, 2025 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants