cancel
Showing results for 
Search instead for 
Did you mean: 

DocumentQuery search a keyword value that may be blank.

Stephen_Wanhell
Champ in-the-making
Champ in-the-making

I'm having some trouble wrapping my head around blank or null keywords in onbase.

For my query, i have a legacy keyword that indicates a legacy document.

I need to search for documents where legacy keyword <> 'LASERFICHE'

so i create a keyword of type legacy with the value 'LASERFICHE' and then do:

legacyKeywordType.createKeyword("LASERFICHE");

docQuery.AddKeyword(legacyKeyword, ,KeywordOperator.NotEqual,KeywordRelation.And)

This doesn't seem to work AND i've notice that attempting to perform the same search through my unity client (ie setting the operator to <> and the text to "LASERFICHE" also doesn't work.

by "Doesn't work" i mean it will NOT return the documents with null legacyKeywords.

Do i need to also create legacyKeywordType.createBlankKeyword() and add it to the doc query -> which i have tried and that doesn't work either?

HELP!  currently my workaround is to leave that keyword OUT of the query and filter the returned documents afterwards, which of course is crazily inneficient. 

1 ACCEPTED ANSWER

Daniel_Quill
Elite Collaborator
Elite Collaborator

Stephen,

In OnBase there is no concept of NULL keyword values unless you are referring to KeywordGroups. This is because if a value does not exist on a document then there is no row in the database which means there is nothing to return. Using the <> will not work because there is nothing to compare your criteria value to. The <> only works if there is a value already assigned to the keyword type on document.

So the keyword is not blank or NULL, it simply does not exists. You will need to return the documents and loop through but instead of looking for the value you would want to look for the keyword type to see if it exists on the document. When looping through the keywords you will notice that any keyword that does not have a value associated with it will not be returned.

Regards,

View answer in original post

15 REPLIES 15

Adam_Kuhn
Star Collaborator
Star Collaborator

There is an SCR (#10710) pertaining to this functionality, however it notes that this change does not make sense for regular keywords and it is not likely to be added any time in future.

Can you suggest a good way for customers to communicate that it *absolutely* makes sense for regular keywords?

It doesn't sound like requesting that we be added to the SCR would successfully communicate much.

Robert_Russ
Confirmed Champ
Confirmed Champ

Alex, I believe the reason that this is the case for regular keywords is that regular keywords are not added to the document within the OnBase database when it does not have a va;ie. There is no way to return null or empty when the actual keyword doesn't exist on the document.  

Robert
The SQL is fairly simple. I have done it a bunch on the back-end. There is no rational reason why Hyland could not do it.

Robert
The SQL is fairly simple. I have done it a bunch on the back-end. There is no rational reason why Hyland could not do it.
Getting started

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.