You would need to boost your "startswith" matches artificially for the
desired behavior.
I would do it this way -

   1. Create a KeywordTokenized field with n-gram filter.
   2. Create a Whitespace tokenized field with n-gram flter.
   3. Search on both the fields, boost matches for #1 over #2.

Hope this helps.

Cheers
Avlesh

On Thu, Oct 8, 2009 at 10:30 AM, R. Tan <tanrihae...@gmail.com> wrote:

> Hi,
> How can I get wildcard search (e.g. cha*) to score documents based on the
> position of the keyword in a field? Closer (to the start) means higher
> score.
>
> For example, I have multiple documents with titles containing the word
> "champion". Some of the document titles start with the word "champion" and
> some our entitled "we are the champions". The ones that starts with the
> keyword needs to rank first or score higher. Is there a way to do this? I'm
> using this query for auto-suggest term feature where the keyword doesn't
> necessarily need to be the first word.
>
> Rihaed
>

Reply via email to