This has come up a few times, but it’s probably a good to gather the discussions together!
Forum topics
- full-text-search
- udfs-in-index-bindings-array-generation-for-search-over-index
- how-to-build-a-search-index-with-fql
- fql-query-for-prefix-of-search-term
Stack Overflow
The single most comprehensive notes might be this post on stack overflow:
NGram in general
The performant searches come down to using NGram
function. It’s not in the docs. My understanding is that it’s still unstable. Yet if you need to build up a performant sub-string search, this is how to do it.
Examples in the wild
The fwitter example goes through several steps to show how NGram can be used in different ways.
- github: GitHub - fauna-labs/fwitter: Fwitter is an example application that demonstrates the features and functionality of Fauna.
- searching.js: https://github.com/fauna-labs/fwitter/blob/22a44e70ff2a161aeaeb422e9cd3cb8e3fad48c7/src/fauna/setup/searching.js
@eigilsagafos shared a gist (Fauna Ngram search example · GitHub) .
That gist is linked from the Awesome Fauna repo (GitHub - fauna-labs/awesome-fauna: Curated list of FaunaDB resources). I am not sure if any examples shared there implement searching.