Hey guys I am trying to use full text search with ...
# orm-help
j
Hey guys I am trying to use full text search with postgres, but it only seems to work for entire words. Is it also possible to return partial results? Like fuzzy search?
n
Hey Julian ๐Ÿ‘‹ Do you have any particular text search use case which you canโ€™t achieve? Hereโ€™s an example of what can be achieved through full text search in PostgreSQL as of now. We have an existing Feature Request to support PostgreSQL trigrams. If this is what you need can you please leave a ๐Ÿ‘ to the request so that our teams could prioritise it.
j
From what I see so far, this only works if it contains the entire word, is that correct? So if I have a product with name "dogfood", I need to type "dogfood" in order to return the product from the database, and "dog" wouldn't return anything? At least that's what I get right now
I basically want a partial search term like "do", "dogfo" and "food" to also return the item "dogfood"
n
I see, we do have support for
contains
,
startsWith
and
endsWith
clause support as mentioned here. I think that should cover some of the use cases for you
j
Ah okay cool that's exactly what I need
๐Ÿ‘ 1
How is that different from "search" though?
n
Full text search is to support these native Postgres Text Search functions which are somewhat different, you can read bout them here - https://www.postgresql.org/docs/12/functions-textsearch.html
j
Okay cool, thanks!
You guys have a really awesome product with Prisma ๐Ÿ™‚
prisma rainbow 1
n
Glad to hear that you are having a good experience! ๐Ÿ˜ƒ ๐Ÿ™Œ