supabase-community / postgrest-py

PostgREST client for Python. This library provides an ORM interface to PostgREST

Home Page:https://postgrest-py.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to perform Full-text Search?

yuchdev opened this issue · comments

You see, I tried to execute select().textSearch(), which is provided by JS API, but it sems to not ported to the PythonAPI

Executing the same request as a raw SQL query to Postgres would've solved the problem, but I didn't find it either.
Could you give some guidance, on how such a functionality could be performed through your API?
Sorry if the questions are too basic, I just started to use it.

commented

All questions welcome, don't worry!

The full text search method is named .fts; you'd use it like select().fts()

Perhaps we should add an alias (.text_search) to match the JS API.

Let's port this over! Here's the JS source if anyone wants to take up the issue. Else I'll get to it when a slot frees up

Hey we just ported a utility text_search command over, going to close for now - feel free to give it a try -
the usage looks something like: client.from_("listing").select("*").text_search("description", f"'{query}'", {"type": "websearch", "config": "english"}).execute()

Going to close this issue for now but feel free to let me know if there are still issues

Thanks!