smartsearch dialog - search mode option - make different default option

Murugesan Manokaran asked on September 19, 2018 18:42

is it possible to make one of the search mode option as default? search mode dropdown list showing 4 options: Any word All words Any word or synonyms Exact phrase.

I need to set the "All words" as the default option. possible?

Recent Answers


Zach Perry answered on September 19, 2018 18:47

There is a property SearchMode on the Smart Search Dialog webpart for setting the default search mode.

0 votesVote for this answer Mark as a Correct answer

Murugesan Manokaran answered on September 19, 2018 19:50

Thanks. I set that the dropdown to "All words". But in the page its showing "Any Words" always. is there any other place that option can be set when the page showed up?

0 votesVote for this answer Mark as a Correct answer

Zach Perry answered on September 19, 2018 20:52 (last edited on September 19, 2018 20:58)

If you only want them to search by All Words, set the default and disable the search mode for the web part.

If you want to change the order in the dropdown, you will have to clone the web part and the module. The values in the drop down are added from an Enum. You might be able to set sort to true for it. ControlsHelper.FillListControlWithEnum<SearchModeEnum>(drpSearchMode, "srch.dialog", useStringRepresentation: true, true);

A more hacky way would be to modify the order of the drop down with JS after the page loads. Probably wouldn't recommend this method.

You could also not use that webpart, and just use custom html/js. Just add a textbox, dropdown with the items in the order you want, and a button. When the button is clicked just redirect to the results page with the querystring parameters set: "?searchtext=test&searchmode=anyword"

0 votesVote for this answer Mark as a Correct answer

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