Smart Search Filter

Philip Butler asked on June 25, 2015 15:47

I am trying to use a conditional smart search filter like this:

  1. User enters text in the search dialog text box
  2. in the filter which is a dropdown list, user select's searching for example field headline only

I have followed the instructions on the dev guid here: http://devnet.kentico.com/docs/7_0/devguide/index.html

So expected result is only text that is in the headline field is returned, However when I add this line to the filter: +Headline;{%QueryString.searchtext#%}; Headline

I do not get any results back, if I run without the conditional filter I do get results but of course not the expected.

So is what I am trying to do possible using the search dialog webpart and filters ? I have also looked at using a faceted search, using a text box, but I could'nt get the search results to populate with the value from the text field ? Or will I need to create a custom filter to do this ?

Any help/suggestions would be greatly appreciated.

Thanks Phil

Recent Answers


Trevor Fayas answered on August 10, 2015 21:19

I would check the syntax. If you want to have items filtered by the Headline drop down value, it needs to render as: +Headline('thevalue')

You may want to do some of this programatically, have a hidden text filter that takes the Text box and the drop down list and builds the lucene query text and populates the hidden text filter.

So for instance, if they type "Hello", it would populate the search with "+Hello" If they type in "Hello" but select "Search Headline Only", it would populate "+Headline('Hello')"

Something like that.

0 votesVote for this answer Mark as a Correct answer

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