Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-4923

Search query is executed twice on each initial search page load

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Released
    • Icon: Should have Should have
    • 2.32.0
    • None
    • 4
    • Code Refactoring, Search
    • Sprint #135
    • jupiter

      Currently our search code is executed after the "main WordPress loop". In this main loop the search query is executed, however in our search code we build another search query (has some different parameters than the one in the main loop!) and execute it. We only use the result of the second query.

      We should only be executing a single query. This could be done in 2 ways:

      1. Make our search code work with the "main" loop. Seems to make most sense but could be a lot of work to make all our logic work with that.
      2. Keep the current code and prevent the main query from being executed. End result is more complex, but could be a quick fix. Can be done by unsetting the filter from the ElasticPress plugin.

            pvincent Pieter Vincent
            pvincent Pieter Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: