advanced setting for enableSearchAsYouType
We are using enableSearchAsYouType with query box. I want to explore the possibility of having some advanced attribute with this setting, e.g.
- Ability to define number of characters before search begins
- Define Relevancy threshold minimum for suggested content returned in type-ahead
- Ability to define specific keywords and apply unique weighting factors(i.e overview boost +10)
- Ability to define specific content to be boosted(i.e âSalesforce for outlook installation guide â boost +30)
Can anyone please suggest me ways to achieve this?
There is presently no option for specifying the number of characters before search as you type fires a query, but you can configure the delay before a search is trigger with the searchAsYouTypeDelay option.
Also, it's not possible to explicitly filter on relevancy (by definition any result returned needs to "match" the query), but you could use the preprocessResults event to prune out results with a lower score before the framework processes them. But be aware that the score value on a result is not an absolute number.
For your two last questions, you should use Ranking Expressions in the advanced query (inject them in the buildingQuery event). For example this expression boosts the keyword
overview by a score of 10:
$qre(expression: overview, modifier: 10)