You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have no control on how attribute is stored. Some entries have it as single string, sometimes as array of strings
Suppose I want to run a query of users where attribute contains the word test. I do:
Filter.createSubstringFilter("attribute", null, new String[]{ "test" }, null).multiValued(null);
which generates
2021-01-08 16:19:28,291 DEBUG [qtp990355670-13] [gluu.persist.couchbase.operation.impl.CouchbaseOperationServiceImpl] (CouchbaseOperationServiceImpl.java:555) - Execution query:
'SELECT gluu_doc.*, dn FROM `gluu_user` AS gluu_doc
WHERE ( ( objectClass = "gluuPerson" ) AND mail LIKE "%test%" )'
That will retrieve user1 only, not user2. The same expression is obtained when using .multiValued(false) which in that case would be correct.
Using .multiValued(true) does the right thing too:
2021-01-08 16:32:52,004 DEBUG [qtp990355670-15] [gluu.persist.couchbase.operation.impl.CouchbaseOperationServiceImpl] (CouchbaseOperationServiceImpl.java:555) - Execution query:
'SELECT gluu_doc.*, dn FROM `gluu_user` AS gluu_doc
WHERE ( ( objectClass = "gluuPerson" ) AND ANY mail_ IN mail SATISFIES mail_ LIKE "%test%" END ) ...
So basically we need an OR in order to glue the two expressions when multivalued = null. The equality filter is already working that way.
I will take a look on other usages (endsWith, etc..)
The text was updated successfully, but these errors were encountered:
The same problem occurs with createGreaterOrEqualFilter and createLessOrEqualFilter where the following is generated when multiValued is null or not set:
WHERE ( numeric >= 0 )
WHERE ( numeric <= 0 )
jgomer2001
changed the title
Containability filter problem in couchbase
Containability, GTEQ, and LTEQ filter problem in couchbase
Jan 10, 2021
yurem
transferred this issue from GluuFederation/oxCore
May 20, 2021
Say I have data like
I have no control on how
attribute
is stored. Some entries have it as single string, sometimes as array of stringsSuppose I want to run a query of users where
attribute
contains the wordtest
. I do:which generates
That will retrieve
user1
only, notuser2
. The same expression is obtained when using.multiValued(false)
which in that case would be correct.Using
.multiValued(true)
does the right thing too:So basically we need an OR in order to glue the two expressions when
multivalued = null
. The equality filter is already working that way.I will take a look on other usages (endsWith, etc..)
The text was updated successfully, but these errors were encountered: