-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Hey!
Thanks for the great library!
We have some analytics running on our VuePress site. Currently, we're just collecting page views but would like to extend that to collect search terms too. We'll use that to align our documentation to what people are actually searching for.
What are you feelings on adding a hook to this plugin that gets called on every search? That'll be a great extension point for us to emit our metrics.
I was thinking something like this:
[
"flexsearch",
{
search_options: {
encode: "balance",
tokenize: "reverse",
threshold: 0,
resolution: 3,
depth: 3,
doc: {
id: "key",
field: ["title", "headers", "content"],
},
},
callbacks: {
onSearch: (someObjectRepresentingTheSearch) => {
// emit metrics here
}
}
},
]
I don't mind doing the work, I just wanted your input whether this is something you'd like in the library and what the API should look like.
Thanks!
Metadata
Metadata
Assignees
Labels
No labels