SmartSearch not retrieving results based on DocumentModifiedWhen filter.

Yowaraj Chhetri asked on May 14, 2018 04:36

Hi, I am trying to use DocumentModifiedWhen field as a daterange filter to retrieve smart search dataset, but I am not getting any result with DocumentModifiedWhen field. However, it works fine when I use DocumentCreatedWhen filed instead.

Any suggestion please?

My Code is as follows:

string documentModifiedWhenFilter = CMS.Search.SearchSyntaxHelper.GetFieldCondition(PageFields.StandardContentPage.Fields.DocumentModifiedWhen, FromDate.ToString("yyyy-MM-dd").Replace("-", ""),ToDate.ToString("yyyy-MM-dd").Replace("-", ""));

SearchCondition = CMS.Search.SearchSyntaxHelper.AddSearchCondition(SearchCondition,documentModifiedWhenFilter);

Correct Answer

Juraj Ondrus answered on May 14, 2018 13:53

Or, you can go to Modules -> Pages modules -> Classes -> edit Page class and go to Search tab - here you can customize the search settings and set the DocumentModifiedWhen column to be Searchable - this change will apply to all your pages. You just need to rebuild the index.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Peter Mogilnitski answered on May 14, 2018 13:18 (last edited on May 14, 2018 13:22)

You have to go to your page type(s), switch to smart search tab and make DocumentModifiedWhen Searchable. Fields must be set as Searchable to be usable in Search filters and general search result filtering or ordering conditions (such as the Search condition and Search sort properties of Smart search result web parts)

0 votesVote for this answer Mark as a Correct answer

Yowaraj Chhetri answered on May 15, 2018 01:36

Thank you Juraj. Now I can find where the CMS_Document fields were selected to be searchable. It worked for me now.

Regards,

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.