[KinoSearch] Possible Phrase Query Bug
Nathan Kurz
nate at verse.com
Sat Sep 8 11:28:23 PDT 2007
On 9/7/07, Matthew O'Connor <matthew.oconnor at socialtext.com> wrote:
> I think I've found a bug with phrase queries.
Attached is a patch against SVN that should solve this. The problem
was an unsigned integer underflow if the first occurrence of a term
was at a position less than its phrase offset.
I've fixed it by changing to using from a u32_t to an i32_t and
casting the compare, which seemed like the least invasive change. It
does slightly reduce the range of legal positions to 31-bits, but I
don't think this is going to catch anyone. I didn't look at the .15
version, but presume the problem can be fixed in the same simple
manner.
There are probably more invasive alternatives if the range reduction
is unacceptable. Also, it looks possible to speed up the loop a bit,
but probably at the cost of readability. I'll hold off on trying this
unless it's thought to be a bottleneck.
Nathan Kurz
nate at verse.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phrase-bug.patch
Type: application/octet-stream
Size: 1622 bytes
Desc: not available
Url : http://rectangular.com/pipermail/kinosearch/attachments/20070908/412e75d4/attachment-0001.obj
-------------- next part --------------
_______________________________________________
KinoSearch mailing list
KinoSearch at rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch
More information about the kinosearch
mailing list