Try our conversational search powered by Generative AI!

Problem with PropertyCriteria


I use a DataFactory.Instance.FindPagesWithCriteria(searchRoot, criterias).OfType<ProductPage>(); for a search function but i have a

problem with a criteria.

When i use PropertyDataType.Category i dont get any results if i use CompareCondition.Contained( SEE PASTED CODE)?

When i use CompareCondition.Equals everythings works fine, anyone have an idea what it can be?



        protected PropertyCriteriaCollection GetMarketCriterias(string searchText)
            PropertyCriteriaCollection criterias = new PropertyCriteriaCollection();

            PropertyCriteria criteria = new PropertyCriteria();
            criteria.Name = "PageCategory";
            criteria.Required = false;
            criteria.Type = PropertyDataType.Category;
            criteria.Condition = CompareCondition.Contained;
            criteria.Value = searchText;


            return criterias;



Best regards //Andreas

Oct 08, 2010 15:40

If i remember correctly PageCategory is an int, so you should use CompareCondition.Equal..

Oct 08, 2010 15:47
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions 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.