#1 2012-09-24 14:12:10

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

RESTful FTS query

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

#2 2012-09-24 14:33:12

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: RESTful FTS query

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

#3 2012-09-24 14:42:54

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

Re: RESTful FTS query

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

Board footer

Powered by FluxBB