I am working on an enterprise wiki site collection. and we need to implement an expiry policy for the wiki pages, so if the wiki page is set to be expired or a it is linked to a certain term , then to exclude the wiki page from search. currently i have the following :-
- Each wiki page is linked to a Managed Metadata column. and this column can have values such as
"Project1","Project2","Project3"
.
Also each wiki page is linked to an "Expiry Status" column which have 2 values;
Yes
,No (default)
.now the idea of implementing the expiry policy, is that if the wiki page has its "Expiry Status" =
Yes
, or its Project is expired to exclude the wiki page from the search.
so not sure how i can implement this inside sharepoint , till now i achieve the following :-
- i created a new site column named "Expiry Status" , and then inside the Central Administration >> Search Service >> Result Source, i define to exclude any wiki page which have Expiry Status =
Yes
, as follow:
- now for the managed metadata column , i define a Custom Property for all the terms including; Project 1, Project 2, Project 3 named "Show In Search" with default value =
true
. and users can chnage the value to "No
".
- but i am not sure if i can modify the Result Source inside the Search Service, to exclude from the search any wiki page which is linked to a term and this term have its custom property named "Show In Search" = No ? is this possible ?
so can anyone adivce on this ? or there is a better way to implement my requirement ?
EDIT
Now i tried the following steps but they did not work.
1) I went to the term store , and i click on certain terms, add a new shared property named "ShowInSearch" with two values either;false
or true
. as shown below:-
2) then i went to the "central administration" >> "managed services" >> "Result Sources" , then i modify the query using the query builder where i added the following {Term.ShowInSearch}<>"false"
to exclude pages linked with a term property named "ShowInSearch" with value = false
, as follow:-
{?{searchTerms} -ContentClass=urn:content-class:SPSPeople} {Term.ShowInSearch}<>"false"
Then i run a full scan, but the search will always show the following error:-
Nothing here matches your search
so can anyone adivce on this please ?