On Fri, Feb 13, 2009 at 5:05 PM, Marcus Stratmann <stratm...@gmx.de> wrote:

> Hm, when I try searching for "grand" using onlyMorePopular=false I do not
> get any results. Same when trying "gran". It seems that there will be no
> results at all when using onlyMorePopular=false.


When onlyMorePopular is false and the word you searched exists in the index,
it is returned as-is. Therefore if "gran" and "grand" are both present in
the index, they will be returned as is.


> Without onlyMorePopular there are suggestions for both terms, so there are
> suggestions close enough to the original word(s). Have you tested your
> example case?
>

I am confused by this. Did you mean "With onlyMorePopular=true there are
suggestions for both terms"?


> Anyway, if you look at it from the user's point of view: The wiki says
> "spellcheck.onlyMorePopular -- Only return suggestions that result in more
> hits for the query than the existing query." This implies that if
> onlyMorePopular=false I will get even results with less hits. So when I'm
> checking "grand" I would expect to get the suggestion "gran" which is less
> frequent in the index. But it seems this is not the case.
>

If onlyMorePopular=true, then the algorithm finds tokens which have greater
frequency than the searched term. Among these terms, the one which is
closest (by edit distance) is returned.

I think I now understand the source of the confusion. onlyMorePopular=true
is a special behavior which uses *only* those tokens which have higher
frequency than the searched term. onlyMorePopular=false just switches off
this special behavior. It does *not* limit suggestions to tokens which have
lesser frequency than the searched term. In fact, onlyMorePopular=false does
not use frequency of tokens at all. We should document this clearly to avoid
such confusions in the future.


> 2) It would be nice if one could get suggestion with lower frequency than
> the checked word (which is, to me, what onlyMorePopular=false implies).


We could enhance spell checker to do that. But can you please explain your
use-case for limiting suggestions to tokens which have lesser frequency? The
goal of spell checker is to give suggestions of wrongly spelled words. It
was neither designed nor intended to give any other sort of query
suggestions.

-- 
Regards,
Shalin Shekhar Mangar.

Reply via email to