6

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?

4
  • 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. Commented May 4, 2017 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." Commented May 11, 2017 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
    Commented May 14, 2017 at 16:21
  • @Dominic/Velmurugan - If this answer is acceptable and this fixes the issue, can you please post it as answer. Commented Jul 25, 2017 at 4:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.