-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow configuration of default search query pre-processing function #1518
Comments
Thanks for reporting! This is the only thing I'll try to change before the final release which may impact the configuration structure. Other than that the latest RC should be pretty stable. |
64caf62 adds support for custom search transforms via theme extension, e.g. a (non-sensical) query transform that lowercases all characters before sending it to the index: {% block config %}
<script>
var search = {
transform: function(query) {
return query.toLowerCase()
}
}
</script>
{% endblock %} If no custom transform is given, the default transform is applied: mkdocs-material/src/assets/javascripts/integrations/search/transform/index.ts Lines 50 to 55 in 64caf62
The default transform now allows for quantifiers (
|
The fix was just released as part of RC 4. See #1498 for details. |
I checked that...
Description
Just a reminder that you mentioned here that you want to make the following function overridable in Material 5.0 or 5.1:
mkdocs-material/src/assets/javascripts/components/search/query/react/index.ts
Lines 60 to 64 in 1190104
Use Cases
Overriding defaultTransform() is useful to modify the search behavior, e.g., to disable the addition of a wildcard (*) to each search query.
The text was updated successfully, but these errors were encountered: