If one of you kind souls could give me syntax for a KQL string that will exclude pages/URLs from results, I would be much obliged, as I am somewhat newbiish at this… When I do a keyword search SP is returning the documents tagged with the keyword as well as the pages containing them, I am trying to eliminate that behavior. Thanks in advance!!
ah, sounds about like what i was looking for. Cool, Ty! Yeah, I am talking the whole site collection level, at least for now, so far we are mainly using SP as a doc repository with revision control. Thanks man!
What we want to find out is what level to add these rules in. You could make these rules (inclusion or exclusion) all the way to the farm level and down the page level.
Are you wanting to this only on one site? Do you want this to happen when someone uses the “Search this site” option on the site, uses a “Search Center” or uses a custom page in which you added a Search box?
If you only want to show documents you could do inclusion by using an example like this:
(FileExtension:doc OR FileExtension:docx OR FileExtension:xls OR FileExtension:xlsx OR FileExtension:ppt OR FileExtension:pptx OR FileExtension:pdf) (IsDocument:”True” OR contentclass:”STS_ListItem”)
Thanks Drew!
Well hmm… I want search to return only results for the documents we have sitting in various libraries around the site, not their containing pages. So, I guess, I would have to hunt down every file type/extension we have and add them as inclusions while also excluding the aspx file type? Or would that not work…? I
A simple way to remove pages from search results is with: –FileExtension:aspx
This is something I wouldn’t recommend doing for all search results as it would remove all pages. Do you have a page or smaller search center that you are planning to build this logic? If there is a smaller area you want to return results for it would be easier to build a query to return only the results you want by using inclusion commands instead of exclusion.