Ditto provides a search functionality as one of the services around its managed digital twins.
Ditto’s microservice things-search automatically consumes all
events which are emitted for changes to
Policies and updates an for search
optimized representation of the
Thing data into its own database.
No custom indexes have to be defined as the structure in the database is “flattened” so that all data contained in Things can be searched for efficiently.
Example: Search for all things located in “living-room”, reorder the list to start with the lowest thing ID as the first element, and return the first 5 results:
Filter: eq(attributes/location,"living-room") Sorting: sort(+thingId) Paging: limit(0,5)
Search count queries
The Search supports specifying in which
namespaces it should be searched. This may significantly improve the search
performance when many Things of different namespaces are managed in Ditto’s search index.
The RQL limiting part specifies which part (or “page”) should be returned of a large search result set.
Limits the search results to
<count> items, starting with the item at index
- if the paging option is not explicitly specified, the default value
limit(0,25)is used, i.e. the first
25results are returned.
- the maximum allowed count is
Example - return the first ten items
Example - return the items 11 to 20
i.e. Return the next ten items (from index 11 to 20)