#Strange error when trying to use search

6 messages · Page 1 of 1 (latest)

echo turret
#

I'm getting a strange error as soon as I'm trying to search on a table with searchIndex. Browser console keeps printing this, repeating forever:

_app-62f3ee54ceeb705a.js:4 Attempting reconnect in 51.837452158347006ms
_app-62f3ee54ceeb705a.js:4 WebSocket reconnected
_app-62f3ee54ceeb705a.js:4 WebSocket closed with code 1011: InternalServerError
_app-62f3ee54ceeb705a.js:4 Attempting reconnect in 67.02649050867504ms
_app-62f3ee54ceeb705a.js:4 WebSocket reconnected```

I'm accessing this function from the convex dashboard:
```export const testsearch = query({
  args: {
    query: v.optional(v.string()),
  },
  handler: async (ctx, { query }) => {
    if (query && query.length > 0) {
      return ctx.db
        .query("partModel")
        .withSearchIndex("search_component", (q) =>
          q.search("component", query),
        )
        .collect();
    } else {
      return ctx.db.query("partModel").collect();
    }
  },
});

When not providing a query the result is as expected. When providing a query string, the UI keeps loading forever and console shows above errors.

#

searchindex is defined in my schema:

#
    partGroupId: v.id("partGroup"),
    manufacturerId: v.id("manufacturer"),
    component: v.string(),
    name: v.string(),
  })
    .searchIndex("search_component", {
      searchField: "component",
      filterFields: ["manufacturerId", "partGroupId"],
    })
    .searchIndex("search_name", {
      searchField: "name",
      filterFields: ["manufacturerId", "partGroupId"],
    }),```
#

Same problems when using the query from my app with useQuery hook. Any ideas?

tawny plinth
#

Hmm I'm seeing a similar issue with search in one of my apps, so I'm investigating if it's an issue on our side

tawny plinth
#

I believe this should now be resolved on our end -- let us know if you're still seeing these errors.