AI OnAI Off
ArrayList categories = new ArrayList();
for (int i = 0; i < Request.Params.Count; i++)
{
string key = Request.Params.GetKey(i);
if (key.IndexOf("xxx") > -1 || key.IndexOf("yyy") > -1)
{
categories.Add(Request.Params.GetValues(i)[0]);
}
}
PropertyCriteria criteria = new PropertyCriteria();
criteria.Value = String.Join(',', (string[]) categories.ToArray(typeof(string)));
// etc.
PropertyCriteria crit = new PropertyCriteria();
crit.Type = PropertyDataType.String;
crit.Required = false; //tried true as well
crit.Condition = CompareCondition.Equal;
crit.Name = "SubjectCode";
crit.Value = "H,HA,HC";
Does the comma-separated string as a value only work for categories?
How do I do this then?
Note: I have other criterias as well.
2) Is there a way of getting page hits regardless of capitalization (PropertySearch)?
E.g. user enters "hello world" and I want to find the page with property value "Hello world"?
3) Is it possible to create my own CompareConditions? A yes here would answer question #2 as well
for (int i = 0; i < Request.Params.Count; i++) { string key = Request.Params.GetKey(i); if (key.IndexOf("xxx") > -1 || key.IndexOf("yyy") > -1) { PropertyCriteria criteria = new PropertyCriteria(); criteria.Condition = CompareCondition.Equal; criteria.Type = PropertyDataType.Category; criteria.Name = "PageCategory"; criteria.Value = Request.Params.GetValues(i)[0]; criteria.Required = false; changeSearch.Visible=true; advSearch.Visible=false; SearchResults.Criterias.Add(criteria); } }