internal/frontend: copy search mode when replacing basepage

The search mode must be set on the basepage to properly
switch symbol search queries to the symbol search results
page.

Change-Id: I98d22baa501d728983ecc7a97eddfb35357ce9a4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/432420
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
diff --git a/internal/frontend/server.go b/internal/frontend/server.go
index 2ebd73f..8d358bf 100644
--- a/internal/frontend/server.go
+++ b/internal/frontend/server.go
@@ -422,7 +422,10 @@
 	SearchModeSymbol string
 }
 
-func (p *basePage) setBasePage(bp basePage) { *p = bp }
+func (p *basePage) setBasePage(bp basePage) {
+	bp.SearchMode = p.SearchMode
+	*p = bp
+}
 
 // licensePolicyPage is used to generate the static license policy page.
 type licensePolicyPage struct {