Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-21126

Search suggestions queries are cached on the browser side if the only thing that changes in a search suggest source is the query

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 12.10.5
    • Search - Generic
    • None
    • Unknown

    Description

      How to reproduce:

      • go to the administration > search > search suggest
      • locate the Attachment names source and edit it as follows:
        • set the query to:
          *__INPUT__*
          fq=type:ATTACHMENT
          qf=filename_exact
          
      • save
      • go to the home of the wiki (without forcing the refresh in the browser)
      • make a quick search

      Expected result:

      • the search results, for attachment names, the results matching the new query are provided
        • in this specific case, a fulltext partial search should be performed

      Actual result:

      • the returned results are still using the previous search query

      This is because the search sources are contained in the javascript for the search suggest, there is a cache invalidation mechanism, but this mechanism does not invalidate the cache when the only change is in the query - it invalidates on name of the suggest, url, highlight and icon, as well as the activation state (see https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/javascript.vm#L281 ).

      As a workaround, changing the name of the source would invalidate the caches on users' browsers.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lucaa Anca Luca
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: