0

We have a list in sharepoint online intranet. We have a result source created with predefined query configured in search webpart.

Now this list has a column called publishedDate and business would like to have items as part of search result only if items are published after 2010

I tried below query and it works FirstPublishedDate >= 2010-01-01T00:00:00Z

Challenge is, this result source is used for search across intranet and if above query is added then only items from that list are returned.

Expectation is if i search for word "holidays", all items (Pages, documents, list items) across the site should be returned however if any result is from this particular list then return it only if its published after 2010

so i can either use

{searchTerm} OR FirstPublishedDate >= 2010-01-01T00:00:00Z but this will return everything since there is OR operator.

OR

{searchTerm} AND FirstPublishedDate >= 2010-01-01T00:00:00Z But this will restrict result to the particular list since this column is added only to this list.

Unfortunately both these queries does not satisfy the condition, is there any way to ignore this date column where its not applicable. Having another dedicated result source for this list is not an option

0

You can exclude all items published before 2010 (FirstPublishedDate<2010-01-01) without excluding items that have no FirstPublishedDate date, use the following query text.

-FirstPublishedDate:1900-01-01T00:00:00Z..2010-01-01T00:00:00Z

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.