[Xapian-discuss] Get the FLINT_BTREE_MAX_KEY_LEN variable in Python

Rafael SDM Sierra sdm at underlinux.com.br
Tue Nov 28 13:43:24 GMT 2006


On 11/28/06, Olly Betts <olly at survex.com> wrote:
>
> On Sat, Nov 25, 2006 at 02:24:36PM -0200, Rafael SDM Sierra wrote:
> > How can I get this variable?
>
> It's actually a constant, not a variable and its value isn't currently
> available via the API (the constant itself isn't actually directly
> useful, but a "maximum term length" would be).  This is on my list of
> things to sort out, but it's complicated by zero bytes in terms being
> treated specially in this area.  My plan is to fix that and then we can
> have a "max term length" constant or API call.
>
> Here's a bit of background: The btree manager which Quartz and Flint
> both use versions of has a maximum key length of 252 bytes.  But because
> the keys contain more than just term names, the maximum safe length for
> a term is 240 bytes (or perhaps a few more, but 240 is certainly safe).
> There's one further wrinkle - any zero bytes in a term require 2 bytes
> in the the quartz key.


Yes, a word with more the 240 letters is very big oO

> instead when I add the posting, so, to avoid these kind of error, I
> > can do some "if len(word) > max_length_allowed: continue" and go
> > ahead, I think that this value is variable in some machines, here is
> > 987 bytes.
>
> 987 is the length of the key generated from a term you tried to add,
> not the threshold for key length you exceeded (which is 252 in both
> flint and quartz).  This limit isn't variable, though the effective
> limit on term length is slightly, as noted above.


Yes, it is a number(or code) with this size, after send this mail I make the
system print this, and is just a number that I can ignore. ;)

Thx Olly


-- 
SDM Underlinux
http://stiod.wordpress.com
Membro da equipe UnderLinux
--
PEP-8
There is only 2 kinds of peoples in the world, who know English, and I. oO


More information about the Xapian-discuss mailing list