let someSearchField === ""let someSearchField === ""). This is problematic because we now need to create an entirely separate index to return all records instead of handling that by default when no filtering criteria is provided. This also would align with other search engines like elastic.foo: defineTable({ name: v.string() }).searchIndex("name", { searchField: "name" })foo: defineTable({ name: v.string() }).searchIndex("name", { searchField: "name" })db.query("company").withSearchIndex("name", (q) => q.search("name", name)).paginate(paginationOpts)db.query("company").withSearchIndex("name", (q) => q.search("name", name)).paginate(paginationOpts)const result = someSearchField ? ...withSearchIndex(...) : withIndex(...)const result = someSearchField ? ...withSearchIndex(...) : withIndex(...)Join the Discord to ask follow-up questions and connect with the community
Join the Convex Discord! Explore Convex, the backend platform that keeps your app in sync.
16,164 Members
Join