Sorted empty search bug

Hello Dave, Hello all,

I’ve got this error because I try to search something and sort it by
name :

Argument Error occured at <except.c>:93 in xraise
Error occured in sort.c:551 - field_cache_get_index
Cannot sort by field “name”. It doesn’t exist in the index.

The problem, occur when my index is empty, so the field “name” does not
exists.


Florent

Excerpts from Florent S.'s message of Fri Mar 02 07:25:16 -0800 2007:

Argument Error occured at <except.c>:93 in xraise
Error occured in sort.c:551 - field_cache_get_index
Cannot sort by field “name”. It doesn’t exist in the index.

The problem, occur when my index is empty, so the field “name” does not
exists.

What version of Ferret are you using? I submitted a patch for this a few
months ago that Dave committed, though I’m not sure to which version.

William M. wrote:

Excerpts from Florent S.'s message of Fri Mar 02 07:25:16 -0800 2007:

Argument Error occured at <except.c>:93 in xraise
Error occured in sort.c:551 - field_cache_get_index
Cannot sort by field “name”. It doesn’t exist in the index.

The problem, occur when my index is empty, so the field “name” does not
exists.

What version of Ferret are you using? I submitted a patch for this a few
months ago that Dave committed, though I’m not sure to which version.

I’m using 0.11.2.

Excerpts from Florent S.'s message of Fri Mar 02 09:43:23 -0800 2007:

The problem, occur when my index is empty, so the field “name” does not
exists.

What version of Ferret are you using? I submitted a patch for this a few
months ago that Dave committed, though I’m not sure to which version.

I’m using 0.11.2.

Ok, I’m actually thinking of a patch for a similar, but different issue.

In this case Ferret’s behavior actually strikes me as correct. You
haven’t defined the field, right? Does the error still occur with an
empty index but where the field has been defined, e.g. via
FieldInfos#create_index?

On 3/5/07, William M. [email protected] wrote:

In this case Ferret’s behavior actually strikes me as correct. You
haven’t defined the field, right? Does the error still occur with an
empty index but where the field has been defined, e.g. via
FieldInfos#create_index?

Hi Florent,

I agree with William here. I think the behavior is correct as it is
impossible to sort by a field which doesn’t exist. However, it was an
extra line of code to make searches return an empty result set no
matter what when the index is empty so I added it. You should no
longer be getting a exception in this situation in 0.11.3.

Cheers,
Dave