I need to do a specific search (specific meaning searching only one page attribute), using PropertyCriteria to be able to exclude text from the search result, ie the same way you would do it when using PageSearch.SearchQuery (for instance "+episerver -sharepoint"). Is this possible?
How would I modify this piece of simple code to apply/emulate the "-" search syntax?
pc = new PropertyCriteria();pc.StringCondition = EPiServer.Filters.StringCompareMethod.Contained;pc.Value = "sharepoint";pc.Required = true; // false?pc.Type = EPiServer.Core.PropertyDataType.String;pc.Name = "PageName";pageSearch.Criterias.Add(pc);pageSearch.DataBind();
Do you have other parameters in youre search. Ie searching for pages that contains parameter1 and parameter2 but shouldn't have parameter3.
Then I think you could search for the parameters that it should contain and then create a filter to filterout the ecxlude parameter. Checkout the searchdatasource webcontrol I think it does something like that.