Server-side processing

DataTables provides a server-side processing option for handling large data sets. Since SearchBuilder 1.2.0 a server-side integration has been supported which allows complex queries to be constructed on the client-side before being processed on the server-side.

Client-side

On the client-side in normal running, no special configuration for SearchBuilder when used with server-side processing is required (other than to enable server-side processing with serverSide).

When adding searchBuilder.preDefined conditions there are two properites that must be added. These are searchBuilder.preDefined.criteria.type and searchBuilder.preDefined.criteria.origData. These pass the data type that the condition is to be applied to and the original field name to the server-side script.

Server-side

Libraries

We provide SearchBuilder server-side processing integration with our Editor server-side libraries. These libraries are open source and do not require an Editor license to operate. They can provide a fast way to query your database and return the information needed for DataTables, whilst also constructing queries based on the searchbuilder queries. Full documentation for the platforms we support is available here:

There are two caveats that SearchBuilder's server-side integration carries. The first is that anywhere select elements would normally be used on the client-side, input elements are used instead. This reduces strain on the server significantly, drastically improving performance. The second is that custom conditions are not supported as these would require a custom server-side condition rather than one that can be used on the client side.

Implementation details

Sent parameters

When making a request to the server using server-side processing, SearchBuilder will send all required data, in addition to the parameters documented in the server-side manual in order to let the server know what search query to apply. The format of the data that SearchBuilder sends is the same as is returned from searchBuilder.getDetails() and used to define predefined queries. Please refer to the searchBuilder.preDefined documentation for full details. The data structure documented there is stored in the http request under a searchBuilder header.

Returned data

Once DataTables has made a request for data, with the above parameters sent to the server, it expects JSON data to be returned to it, this is purely those documented in the serverside manual. SearchBuilder itself does not require any additional data from the server, it just applies the criteria defined within it on the client side as where conditions so that the data that is returned matches SearchBuilders requests.