Search Results Query Text - Get all data, Exclude all list data except one

Hi Experts,

I have a situation wherein in the global search of our internal site, we have to display all results & restrict any list item except one list. Earlier we had restricted /Lists/ & People to be displayed in the results.

But in the new search results I have to display results from only one list along with other results (documents, sites, pages etc).

Below is the original query text entered in the Search Results Query Text editor

{searchboxquery} -contentclass:STS_List_Links  
-filename:allitems.aspx  -Path:/articles/Pages/default.aspx
-filename:DispForm.aspx  -Path:/Lists/ -Path:person.aspx

I have tried various different queries with AND, OR operator. I have researched other blogs, sites over google. But unsuccessful. I am sure this is not a rare requirement. Need your expert help.

I have tried this query also...

{searchboxquery} (-filename:allitems.aspx -Path:/articles/Pages/ -Path:/Lists/ -Path:/PublishingImages/) OR
(+(+Path: /Lists/ArticleContent/ AND +filename:*.aspx) AND
-(-Path: */Lists/* OR -filename:*.aspx))

February 19th, 2015 12:52am

Vighnesh,

You should have success using the following:

{searchboxquery} -contentclass:STS_List_Links -filename:allitems.aspx  -Path:/articles/Pages/default.aspx -Path:person.aspx ((-filename:DispForm.aspx  -Path:/Lists/) OR Path:/Lists/ArticleContent/)

Two things from your original query were excluding list items from your results, your exclusion of file DispForm.aspx and path Lists.  By using "OR" in the above query, we're creating an exception to also allow items under Lists/ArticleContent to be included in the results.

Free Windows Admin Tool Kit Click here and download it now
March 10th, 2015 4:02pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics