1
0
mirror of https://github.com/stevenferrer/multi-select-facet.git synced 2025-11-23 21:54:45 +02:00

improve search and auto-suggest

- include query term in search
- improved autosuggest
This commit is contained in:
Steven Ferrer
2020-06-30 15:52:46 +08:00
parent 48c79f4be8
commit 8664f33a10
7 changed files with 127 additions and 76 deletions

View File

@@ -128,6 +128,15 @@ func (h *searchHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
}
q := r.URL.Query().Get("q")
if len(q) == 0 {
q = "*"
} else {
q = fmt.Sprintf("%q", q)
}
productFilters = append(productFilters, fmt.Sprintf("{!tag=top}_text_:%s", q))
query := Map{
"query": "{!parent tag=top filters=$skuFilters which=$product score=total v=$sku}",
"queries": Map{