Improved Quick Search
Last modified by Vincent Massol on 2024/11/19 16:14
Description
The quick (live) search available on the top right corner of the page is lagging behind in terms on look & feel and user interaction:
- Look & Feel problems:
- the way the search results are displayed is not consistent with the rest of the UI (Bootstrap)
- it's not responsive (XWIKI-11062)
- it doesn't use the Icon Theme (XWIKI-15115)
- too many categories (Page title, Page content, Attachment name, Attachment content)
- User interaction problems:
- it's not accessible (XWIKI-16140)
- missing keyboard navigation
- the search results popup hides too quickly
- Search results problems:
- inconsistency between quick search and search page results (XWIKI-13531)
- the quick search doesn't use the main search page configuration (e.g. Main.SolrSearchConfig)
- it's not easy to search for partial text (XWIKI-14596)
- when matching pages, it doesn't look in objects (page metadata), but only in page title and page content (XWIKI-14184)
- the order of the results doesn't match their relevance (XWIKI-15292)
- you can't view all the results for a given category (only the top 3)
- you get only 3 results in a given category even if the rest of the categories don't have any matches
- inconsistency between quick search and search page results (XWIKI-13531)
- Configuration problems:
- there's no easy way to add custom search sources (i.e. provided by an extension)
- you cannot reorder the search sources and there's no priority between them (XWIKI-11481)
- you may need to clear the browser cache after changing the configuration (XWIKI-11053)
Proposal
Here are some actions that we could take in order to improve the quick search:
- Revise the list of search sources we provide by default. The following should be more than enough by default:
- Pages (merge the "Page title" and "Page content" sources and also add support for matching page metadata, i.e. objects); the results provided by this source should be very similar to the ones you get on the main search page
- Attachments (merge the "Attachment name" and "Attachment content" sources)
- Users
- Wikis
- Enable prefix search by using the __INPUT__ __INPUT__* query (the workaround from XWIKI-14596)
- Prefix search using wildcard is not a problem for Solr (see https://medium.com/walkme-engineering/solr-from-the-field-365204108067#746e ). The problem is with suffix (*foo) and contains (*foo*) wildcard searches, but there haven't been many requests for this and I think most of the users are expecting a prefix search on the quick search.
- By duplicating the query we ensure that we still perform a word-based search (using stemming, lemmatization and locale specific processing), which are disabled when wildcards are used.
- Make the UI consistent by using a Bootstrap dropdown to display the results

- This should make it responsive and the dropdown will hide only when clicking outside or when using the Escape key
- Use the Icon Theme
- Make it accessible
- Add keyboard navigation (Up / Down arrows)
- Show more results in one category if the others don't have matches (basically use the "free" slots from the other categories; e.g. show 6 pages if there are no attachment matches)
- Introduce a keyboard shortcut for quick search (that expands the quick search input and gives the focus)
- Make the list of search sources extensible by converting the XWiki.SearchSuggestSourceClass into a component (implement a WikiBaseObjectComponentBuilder)
- Add scope and priority properties to XWiki.SearchSuggestSourceClass
- Retrieve the list of search sources asynchronously after the page load
- Add links to view all the results for each category (search source)
- Modify the main search page to be able to use a predefined search source (the link from the quick search to view all results would pre-select this source)
- Modify the quick search to use the same default (Solr) configuration as the main search
- Use the "Pages" search source by default on the main page
- Try to reorder the categories (search sources) dynamically based on the scores (e.g. if the Users results have a higher scope than the Pages results then show the Users category first)
- Unify / merge the Jump to Page feature with Quick Search. There's no point in maintaining both when they do almost the same thing.
Marius Dumitru Florea