Skip to content
Discussions/App Development/Partial Search in DAMLForum ↗

Partial Search in DAML

App Development6 posts500 views8 likesLast activity May 2021
EN
Enthusiast-BlockOP
May 2021

I went through the link :- Query language — Daml SDK 1.12.0 documentation and also did some research, but could not find how to do a partial query search in DAML.

Example :-

module ExampleModule where
template Example
 with
p : party
text : Text
where
signatory p

Now I created various contracts, for example with text field as “daml@da”

Now, i want to retrieve that contract using partial search on endpoint - /v1/query
with body as -

{
    "templateIds": [
        "ExampleModule:Example"
    ],
    "query": {
        "text": "daml"  (This would be partial query)
    }
}

How should I do this?

Thanks.

GA
Gary_Verhaegen
May 2021

If by “partial” query you mean that you want some sort of text matching, where this would return all the contracts for which the text field contains the word daml as a substring, this is not currently supported.

Per the documentation, the only operator we currently support are equality, greater than and lower than.

If you need other operators, at this point your only option is to do the filtering client-side.

EN
Enthusiast-Block
May 2021

Thanks for this.
Can this (partial query search) be done in future releases.

ST
Stephen
May 2021

We don’t have any firm plans to expand the query language at this time, but we are always interested in user feedback here on the forum and in GitHub issues. In fact, if you have some specific formal behavior in mind (there are several ways to formalize your use case), you may wish to create an issue on GitHub so you might be notified directly on further developments.

You may also take a look at the other JSON API backlog items and “:bell: Subscribe” to any that might interest you.

LE
Leonid_Rozenberg
May 2021
Stephen:

You may also take a look at the other JSON API backlog items and “:bell: Subscribe” to any that might interest you.

Like this one ? :laughing:

ST
Stephen
May 2021

Indeed :slight_smile: However, I don’t think what @Enthusiast-Block is asking for is really compatible at all with what you’ve asked for. But working that out is exactly the kind of formalization and refinement that can be done well in GitHub issues.

← Back to Discussions