Skip to content
Back

[SOLVED] Query.search() returning all rows in the table

  • 0
  • Databases
  • React Native
SwapnaSahoo
11 Feb, 2026, 11:49

When I use Query.search() instead of returning rows with the keywords provided it just returns all the rows in the table.

TL;DR
Issue: Query.search() function is returning all rows in the table instead of filtering by the provided keywords. Solution: Instead of passing the 'content' column directly, use Query.field("content") inside Query.search() to specify the field to search in. Update the code as follows: ```typescript queries: [Query.search(Query.field("content"), query)], ``` This will correctly filter rows based on the provided keywords.
SwapnaSahoo
11 Feb, 2026, 11:52
TypeScript
  try {
    return await tablesDB.listRows<Post>({
      databaseId: CRIC_TALK_DATABASE_ID,
      tableId: POSTS_TABLES_ID,
      queries: [Query.search("content", query)],
    });
  } catch (error) {
    console.log(`Error while searching posts ${error}`);
    throw error;
  }
}```

this is the code i am using
SwapnaSahoo
11 Feb, 2026, 11:55

[SOLVED] Query.search() returning all rows in the table

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more