Try our conversational search powered by Generative AI!

Searching for multiple IUser attributes

Vote:
 

I´m having a problem when searching for multiple user attributes and I don´t want them all to be required. Example: I want to display all users containing query text "developers" in either in attribute "title" OR in attribute "profession".

Is there a way to set the criteria to Required=false like in PropertyCriteria?

Example:

StringCriterion criteria = new StringCriterion();
criteria.Value = queryText;
criteria.WildCardType = WildCardType.Both;
criteria.Required = false;
attributeQuery[attribute] = criteria;

#35058
Nov 26, 2009 11:35
Vote:
 

I think I might use a CriteriaGroup for that. Karoline Klever has an example here:

http://karolikl.blogspot.com/2009/09/using-query-system-in-episerver.html

#35060
Nov 26, 2009 14:00
Vote:
 

That works like a charm! Thanks!

#35065
Nov 26, 2009 15:48
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.