Open data-envoy opened 1 year ago
Maybe we should use the same syntax as Algolia API Reference / API Parameters / searchableAttribute
e.g.
searchableAttributes: [
'attribute1',
'attribute2, attribute3', // both attributes have the same priority
'[unordered](https://www.algolia.com/doc/api-reference/api-parameters/searchableAttributes/#parameter-option-unordered)(attribute4)'
]
And the moment, it's zero-config. Which is really nice becaues the user can get started quickly.
Working on highlight it's starting to look like we should be asking the user for some kind of config, otherwize, we will be highlighting all text columns (like algolia do). And that seems like a waste of processing as aparently
ts_headline
can be slow https://stackoverflow.com/q/71355870/21643056This is also related to how we select columns to return for the main search query. At the moment it's
SELECT *
with some js to remove the vector column https://github.com/dekimir/postgres-searchbox/pull/3#discussion_r1165980504I think there are 2 ways that we could give config.
Pass some options to the handler
Have config set on the client and validation on the handler.
Even futher
The method that we use should be capable when we add facet features. And should support different configs per table.
What do you think?
Edit
As there is potential for XSS and perhaps exposing content of private columns, do you think we should also allow or document how a user could do their own validation in
pages/api/search.jsx