Skip to Content
0
Former Member
Jan 03, 2015 at 01:14 PM

Flexisearch: how to do join on column which is not defined in type definition but is there is database?

417 Views

I need to do join on database column which is not there in type defination. for example to get address that belongs to user the native sql would be

  SELECT u.*

FROM Users as u INNER JOIN addresses as address on address.ownerPkString = u.pk WHERE u.pk = '8796158656516' ;

I need to do the same in flexi search so I have syntax like

SELECT {u:uid} FROM { User as u JOIN Address as address ON {address.ownerPkString} = {u.pk} } WHERE {u.pk} = '8796158656516'

But it is giving error
Unknown column 'address.ownerPkString' in 'on clause

Which I can apprehend as ownerPkString is not defined in Address type definition.

But what is the way of doing the same in flexi search?

Any input would be appreciated.