You are not logged in.
Pages: 1
I want to make a FTS query to a mORMot server using 'GET ModelRoot/TableName' but can't see how to access more than one table.
I can do it in a service using SQL like:
SELECT myRecord.* FROM myRecord, myFTSrecord WHERE myFTSrecord MATCH good stuff AND myRecord.ID = myFTSrecord.DocID;
Is it possible to do it in a RESTful way using 'GET ModelRoot/TableName' with the URI function?
Offline
By definition, REST is per-table oriented.
The TSQLRest.FTSMatch() methods are the one to be used for such queries:
- You retrieve a list of matching IDs[] - using ranking for result order;
- You retrieve a list of records associated to those IDs[] - via a *FillPrepare() call.
I do not think this will be a big performance issue, and will be 100% RESTful.
If you explicitly need to have a more sophisticated SQL statement, I think that such a request should better be implemented by a dedicated server-side service, probably with more process. It could use simple DTOs (like a dynamic array of records) for serializing the results.
Offline
I'm using a javascript client so I can't use TSQLRest.FTSMatch() client-side. It looks like a dedicated server-side service is what I need.
Thanks for the help.
Offline
Pages: 1