Opened 14 years ago

Closed 14 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 Olly Betts, 14 years ago

Sounds good - do you have a patch?

comment:2 by Richard Boulton, 14 years ago

Owner: changed from Olly Betts to Richard Boulton

No, I just noticed it in passing. I'll grab this ticket and work one up, though.

comment:3 by Richard Boulton, 14 years ago

Status: newassigned

comment:4 by Richard Boulton, 14 years ago

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.