I am creating a Sitecore.Ecommerce.Search.Query file using FieldQuery objects. I then convert the Sitecore query to Lucene.Net.Search.Query using the LuceneQueryBuilder class. Everything with the query works fine except for the fields where I am trying to match an empty string.
So ... this works:
new FieldQuery(FieldName, "1", MatchVariant.NotEquals)
but this is not so:
new FieldQuery(FieldName, string.Empty, MatchVariant.NotEquals)
I reflected both the Sitecore.Ecommerce assembly and the Lucene.Net assembly, but I did not find any obvious problems. But, when I look at the term that is created and used in the Lucene query, it looks like this:
-FieldName:
which, I believe, is wrong ... but maybe itβs right, and I just donβt have the correct setting of the field indexes ... Iβm not sure what is honest.
Any help is greatly appreciated.
Thanks!
source share