seitime-frappe/frappe/search/__init__.py
Ankush Menat 01c6a55031
perf: random memory optimizations (#36102)
* perf: preload mysqlclient

Now the default choice instead of PyMySQL.

* perf: Lazy load JWT

OAuth is not used that frequently, on that many sites.

* perf: Lazy load whoosh

Rarely loaded
2026-01-20 06:57:19 +00:00

14 lines
387 B
Python

# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe.utils import cint
@frappe.whitelist(allow_guest=True)
def web_search(query, scope=None, limit=20):
from frappe.search.website_search import WebsiteSearch
limit = cint(limit)
ws = WebsiteSearch(index_name="web_routes")
return ws.search(query, scope, limit)