I am trying to configure my Examine search to include a limited number of document types. What I've got so far is below
var criteria = ExamineManager.Instance.CreateSearchCriteria();
var expression = criteria.GroupedOr(new string[] { "nodeName", "bodyText" }, searchTerm)
.And()
.Field("nodeTypeAlias", "Standard")
.Or()
.Field("nodeTypeAlias", "NewsArticle");
This is only half working as it's only finding results in the first document type mentioned - in this case "Standard" - and ignoring any matches in "NewsArticles" documents. If I swap them round it will find matches in NewsArticles
Can anyone advise how I can tweak this to get results from multiple document types? I need to do this as there are some document types I need to exclude.
Examine - specifying document types to search
I am trying to configure my Examine search to include a limited number of document types. What I've got so far is below
This is only half working as it's only finding results in the first document type mentioned - in this case "Standard" - and ignoring any matches in "NewsArticles" documents. If I swap them round it will find matches in NewsArticles
Can anyone advise how I can tweak this to get results from multiple document types? I need to do this as there are some document types I need to exclude.
Thanks
Hi Graeme,
You can specify docTypes for search in your Examine config file. http://our.umbraco.org/documentation/reference/searching/examine/overview-explanation
Thanks, Alex
Graeme,
Do a And().GroupedOR on the nodetypealias field
Regards
Ismail
Thanks for your replies. Alex - I did try the config file but couldn't get it to work. Must have been doing something wrong.
Ismail - thanks for that suggestion. I think that would do the trick.
However I already managed to get it working by using the following syntax to explicitly state which doc types not to include:
Thanks again both for your help
is working on a reply...