#Trouble using the experimental Index Module

1 messages · Page 1 of 1 (latest)

burnt isle
#

So you've created a link definition between the entities but in your flows did you actually create the link between each customer and its respective company?

Should look something like

`
const link = container.resolve(ContainerRegistrationKeys.LINK);

await link.create({
[YOUR_COMPANY_MODULE]: {
company_id: company_a_id
},
[Modules.CUSTOMER]: {
customer_id: your_customer_id
}
});

`

Note the order of the definitions in the create method should match the order your definition is supplied. It's worth noting the definitions can be created but links don't automatically get created. You'll either have to use a migration script, a script or implement the link creation process into your flows somehow.

burnt isle
#

Did you look at the tables themselves to verify this?

#

Can you show your links?

burnt isle
#

Did you try without $contains?
filters: { companies: { id: companyId } } then try $ilike. Just want to find some kind of baseline where there’s success.

burnt isle
#

I wonder if this is a result of some of the de-sync I've been seeing with the index module. It's definitely still experimental.

Try the $contains again.

filters: { companies: { id: { $contains: "some_value" } } }