Hello team! We face the following issue on typesen...
# community-help
g
Hello team! We face the following issue on typesense
v30.2.rc5
: • We use an async reference from collection
env.booking-payments
towards
env.bookings
defined like:
Copy code
{
  "async_reference": true,
  "cascade_delete": true,
  "facet": true,
  "index": true,
  "infix": false,
  "locale": "",
  "name": "bookingId",
  "optional": false,
  "reference": "bookings.id",
  "sort": true,
  "stem": false,
  "stem_dictionary": "",
  "store": true,
  "truncate_len": 100,
  "type": "string"
}
•
env.bookings
collection is aliased as
bookings
• although the queries on
booking-payments
collection used to work, at some point the reference seems to have broken, and when we
filterBy
using a field from bookings collection:
Copy code
/collections/env.booking-payments/documents/search?q=*&filter_by=$bookings(enterpriseId:='11')
we get:
Copy code
{
  "message": "Failed to join on `env.bookings`: No reference field found."
}
• we checked the schema definition for bookings collection using
/collections/env.bookings
, the id field is not returned, although it is indexed in the documents Do you have any idea what is the issue here?
h
Hey @Grigoris Balaskas
although the queries on
booking-payments
collection used to work, at some point the reference seems to have broken, and when we
filterBy
using a field from bookings collection:
Did you happen to re-index just the booking collection?
g
@Harpreet Sangar could be the case, is there a known issue about this?
can try reproducing it by reindexing bookings
h
The references use internal ids to execute Joins. So when a referenced collection is re-indexed, the referencing collection must also be re-indexed along with it. https://typesense.org/docs/30.1/api/joins.html#using-aliases-with-joins
g
On bookings collection the only action we might have triggered is:
Copy code
typesense
  .collections(schema.name)
  .documents()
  .import_(documents, ImportDocumentsParameters().action(IndexAction.UPSERT))
Would this create an issue?
a
Hey Grigoris, Do you think you have a reproducible example for this issue, so we can further investigate? The most likely possibility is somehow the creation being dropped and recreated.