I need to check either one of the two String fields has value in search query.
I tried two ways, but found its wrong
ExcludeTagClause
request.FilterTags.Add (new ExcludeTagClause (new []
{
new Tag (NordicFeelFieldNames.SustainableBeauty.GetFieldDefinitionForProducts (). GetTagName (), String.Empty),
new Tag (NordicFeelFieldNames. Certificate.GetFieldDefinitionForProducts (). GetTagName (), String.Empty
}}));
OptionalTagClause
request.FilterTags.Add (new OptionalTagClause (new []
{
new Tag (NordicFeelFieldNames.SustainableBeauty.GetFieldDefinitionForProducts (). GetTagName (), "*"),
new tag (NordicFeelFieldNames.Certificate.GetFieldDefinitionForProducts (). GetTagName (), "*")
}));
Search index will not include data that not is set, example null values. Also back office often translate empty string into null of properties when they are stored.
Searching for everything like wildcard searches or strings that’s start with wildcard is the best way to kill performance in the search. Please avoid that! And when you search you can not only have wildcard, you also need another character before or after the wildcard.
@hans, you may use the data service for what you want to do. Right now the question is only a little code fragment and it is hard to answer about alternative ways of doing what the same thing that @nmshkjhn trying to do.
To remember is that data service is touching the database for every execution and that is something that a public website should avoid for the performance.