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

The SQL is simple to write, but much more resource-intensive to execute than a normal keyword search. It's not necessarily a query that you want your end users to be able to run over and over.
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.