var searchQry = criteria.NodeTypeAlias("NewsArticle");
if (!string.IsNullOrWhiteSpace(filter.Category))
{
searchQry = criteria.GroupedOr(new string[] { "articleType" }, filter.Category.Split(','));
}
Where filter.Category is a comma separated string of items.
On thing you might need to be wary of is that your category list in the your index may need to be space separated, ie "1232,1423,2141" => "1232, 1423, 2141"
On Ismael's point, yeah the values need to be space separated on most circumstances. I've found it way easier searching on an index whereby data would be stored like "1232 1423 2141" rather than "1232,1423,2141" as wildcards tend to work better.
Querying Examine - contains one of the strings in an array
Hi
Sorry, I'm having a little trouble explaning this in english...
I have an Examine index on my news items. These news items have a property which is an json string of categories (ect. "1232,1423,2141").
I have another string array that I need to match up against the items in the index.
How do I make a search criteria for that?
Thanks, Tom
I'm with the same doubt.
Possibly something like
Where filter.Category is a comma separated string of items.
On thing you might need to be wary of is that your category list in the your index may need to be space separated, ie "1232,1423,2141" => "1232, 1423, 2141"
Cheers.
On Ismael's point, yeah the values need to be space separated on most circumstances. I've found it way easier searching on an index whereby data would be stored like "1232 1423 2141" rather than "1232,1423,2141" as wildcards tend to work better.
is working on a reply...