Opened 16 years ago
Closed 16 years ago
#331 closed enhancement (fixed)
Query serialisation uses om_tostring() in places where encode_length() might be more appropriate
Reported by: | Richard Boulton | Owned by: | Richard Boulton |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.0 |
Component: | Backend-Remote | Version: | SVN trunk |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Operating System: | All |
Description
The query serialisation code in in api/omqueryinternal.cc (function Xapian::Query::Internal::serialise), uses om_tostring() to encode the term position and wqf of a leaf query, and also in various places where integer and float parameters are serialised.
It would probably be better to use encode_length() for the integer values, and serialise_double() for the floating values (ie, produce a more compact representation and/or use less CPU to pack/unpack).
The query representation already contains various encode_length() values, so it's not currently human readable, so I don't think there's a downside to doing this.
Marking for milestone 1.1.0 for now, since this would be a fairly minor change, but would break remote protocol compatibility, so now would be a good time to do it.
Change History (4)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Owner: | changed from | to
---|
No, I just noticed it in passing. I'll grab this ticket and work one up, though.
comment:3 by , 16 years ago
Status: | new → assigned |
---|
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
It turns out that the floating values are already serialised with serialise_double() and stored in str_parameter. I've changed the integer representations all to use encode_length() and decode_length(), though. Doesn't require a network protocol bump, because we're already bumping it for 1.1.0.
Fixed in r12010
Sounds good - do you have a patch?