03-15-2013 07:36 AM
How does the 'Literal' KeyWordOperator work in Unity API? Is it possible to search for a portion of a keyword value? e.g. If I have a document with a keyword type Account Owner that has value of "Smith John" then is it possible to retrieve all documents that have account owners that contain the string "Smith"?
08-27-2013 10:47 AM
Hello Milind,
I apologize for the delay in our response to your question. It is quite a good question and could prove very useful to others who are looking for this functionality.
The Hyland.Unity.KeywordOperator.Literal enumeration essentially compares the actual string value you specify for equality. Take the following code for example:
/* 1 */ query.AddKeyword("Account Owner", "*Smith", KeywordOperator.Equal, KeywordRelation.And);/* 2 */ query.AddKeyword("Account Owner", "*Smith", KeywordOperator.Literal, KeywordRelation.And);
Line 1 will add a keyword restriction for all documents with a "Account Owner" keyword value that ends with the string "Smith" (ie. John Smith, Smith, aSmith)
Line 2 will add a keyword restriction for all documents with an exact "Account Owner" keyword value of "*Smith". There is no wildcard expansion.
If you want to find all documents with an "Account Owner" keyword value containing "Smith", you would use the following restriction:
query.AddKeyword("Account Owner", "*Smith*", KeywordOperator.Equal, KeywordRelation.And);
03-27-2020 01:45 PM
That would be useful information in the SDK documentation.
03-27-2020 04:37 PM
The above is really good info.
Can you provide an example of how to look for a blank value in the keyword and retrieve matching documents?
I tried both the following, but is of no use
query.AddKeyword("Account Owner", "", KeywordOperator.Equal, KeywordRelation.And)
and
query.AddKeyword("Account Owner", "XYZ", KeywordOperator.NotEqual, KeywordRelation.And)
For a blank value, OnBase doesn't create a keyword table record and that's why probably the Add Keyword option doesn't work. But, that's just my guess. Is there any other method to retrieve the data I'm looking for?
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.