I'm querying the Broker DB on SDL Web 8.5:

CustomMetaValueCriteria index = new CustomMetaValueCriteria(
                                        new CustomMetaKeyCriteria("index"), 
                                        "yes", Criteria.Equal);

Query myQuery = new Query(index);

string[] itemUris = myQuery.ExecuteQuery();

Custom metadatavalues in the DB are ok (1 record, key_name='index', key_string_value='yes'), but the query with index="yes" or index="no" gives the same results (1).

When I change index="yes" to index="something" no results are returned.

Any clues?

  • Can you edit your question and explain (in words) what exactly you are querying for? The code could speak for itself, but there is no way of knowing it is correct for what you are trying to do, if we don't know what you are trying to do. – Bart Koopman May 4 '17 at 16:01
  • I'm not sure how that last parameter (Field Operator) actually works, but I typically used just CustomMetaValueCriteria with just the CustomMetaValueCriteria and string parameters to find items where "key = value." – Alvin Reyes May 11 '17 at 19:44
  • @Theo: It's known issue, Previously we have also based the same issue and raised with SDL support and found that it's a bug and it's fixed got hotfix as Sdl.Web.Delivery DLLs for dot net side, Please check SDL CS team. Issue: The query was generating always eg: fieldvalue = 'value', even though if you pass the field name, the query was not generated with fieldname='value' and fieldvalue='value' instead it's generated to query always fieldvalue = 'value' – Velmurugan May 14 '17 at 16:21
  • @Dominic/Velmurugan - If this answer is acceptable and this fixes the issue, can you please post it as answer. – Vikas Kumar Jul 25 '17 at 4:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.