I’ve been searching through the existing topics but haven’t found anything matching my issue.
Just trying to make my smart field searchable :
{
field: 'nom complet',
type: 'String',
get: contract => models.identities.findOne({
where: { id: contract.identityIdKey }
}).then(identity => `${identity.lastName.toUpperCase()} ${identity.firstName}`),
search: (query, search) => {
let s = models.sequelize;
let split = search.split(' ');
const searchCondition = {...};
query.where[Op.and][0][Op.or].push(searchCondition);
return query;
}
}
In the documentation the smart field example is a concatenation of this same collection’s fields. But as you can see, my smart field is not based on the collection’s fields, but the identities collection.
I wonder how I can reach out my identities’ fields to match my query terms (the searchCondition
object)