jabra
jabra
CCConvex Community
Created by jabra on 3/26/2025 in #support-community
stream support for withSearchIndex ?
@Ian I have a page where I list pods that the user is a member of with additional constraints. - Basic use case joining pods and members table using stream, that works - To filter with a selected category, I can merge the stream one above with podCategories table, that works Now to be able to add filter on pod's name query (searching on pod names that contain the search query) - I need to change the pods stream using WithSearchIndex to filter the pods using name and then merge then with member table and this is not supported
const podsStream =
args.query?.name && args.query.name.trim() !== ''
? stream(ctx.db, schema)
.query('pods')
// .withSearchIndex('search_name', (q: any) =>
// q.search('name', args.query!.name!).eq('superPodId', args.superPodId)
// )
.withIndex('by_superPodId_name_start_time', (q) =>
q.eq('superPodId', args.superPodId).gte('name', args.query!.name!)
).order('desc')
: stream(ctx.db, schema)
.query('pods')
.withIndex('by_superPodId_start_time', (q) => q.eq('superPodId', args.superPodId))
.order('desc')
const podsStream =
args.query?.name && args.query.name.trim() !== ''
? stream(ctx.db, schema)
.query('pods')
// .withSearchIndex('search_name', (q: any) =>
// q.search('name', args.query!.name!).eq('superPodId', args.superPodId)
// )
.withIndex('by_superPodId_name_start_time', (q) =>
q.eq('superPodId', args.superPodId).gte('name', args.query!.name!)
).order('desc')
: stream(ctx.db, schema)
.query('pods')
.withIndex('by_superPodId_start_time', (q) => q.eq('superPodId', args.superPodId))
.order('desc')
for now to make it not crash, I added gte but this is not what i need
5 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
@ian @lee any idea when stream will support withSearchIndex ? https://github.com/get-convex/convex-helpers/blob/main/packages/convex-helpers/server/stream.ts#L602
withSearchIndex(_indexName: any, _searchFilter: any): any {
throw new Error("Cannot paginate withSearchIndex");
}
withSearchIndex(_indexName: any, _searchFilter: any): any {
throw new Error("Cannot paginate withSearchIndex");
}
41 replies
CCConvex Community
Created by itslekan on 3/25/2025 in #general
Custom domain
No description
4 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
No description
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
@lee great articles small fix: In this query you are missing
query('messages')
query('messages')
before
.withIndex
.withIndex
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
Thanks @lee and @ian
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
I used it and this is exactly and I needed
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
this is awesome
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
Exactly, thanks for brainstorming and the link, helped a lot
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
No description
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
Seems the best way is a materialized view
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
Let’s say I solved my issue and added to the members table superpodId. The filter is what throwing me off , imagine I filter on categories so when I paginate, if I have a batch 10 then the first batch can be empty and need to call loadmore on the client
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
Let say you paginate and filter like I did above
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
But it will affect how I think about schemas etc….
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
Since I’m not hitting those limits now
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
I’m also trying to understand convex
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
Is it with aggregates, flat tables
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
But for the sake of the discussion to understand convex when I really scale how should I approach the join paginate
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
So you are saying can do the following, collect , collect and … and then paginate on the final result and I will hit no issues
41 replies
CCConvex Community
Created by jabra on 3/19/2025 in #general
Hi All,
That’s easy to do
41 replies