views:

147

answers:

1

Hi,

I am using a SuggestBox and I am having some difficulties to obtain the good behavior of my application.

Consider the following list of suggestions :

1. lol 
2. good evening
3. goodbye
4. end 
5. saluti

If I use my SuggestBox with this list and I type "g" I will obtain :

1. good evening
2. goodbye

It I type "e" :

1. good evening
2. end

But what I want to obtain is the words containing the input and not only the ones beginning with the input. For example if I type "l", I want to obtain :

1. lol
2. saluti

and not only :

1. lol

How can I fix this?

Thank you for your help.

+3  A: 

The SuggestBox is using a SuggestOracle to decide what to return given some input. The default oracle for a SuggestBox is MultiWordSuggestOracle that has the behavior you describe. If you want some other behavior, you will have to write your own oracle by extending SuggestOracle. Check this out for some nice examples how to build your own SuggestOracle using RPC.

Banang
Tank you for your answer, I will check out your link.
Michaël