[Xapian-tickets] [Xapian] #159: Should be possible to introspect on Query objects

Xapian nobody at xapian.org
Thu Apr 24 14:13:26 BST 2008


#159: Should be possible to introspect on Query objects
-------------------------+--------------------------------------------------
 Reporter:  richard      |        Owner:  nobody  
     Type:  enhancement  |       Status:  new     
 Priority:  normal       |    Milestone:          
Component:  Library API  |      Version:  SVN HEAD
 Severity:  normal       |   Resolution:          
 Keywords:               |    Blockedby:          
 Platform:  All          |     Blocking:          
-------------------------+--------------------------------------------------
Changes (by richard):

  * type:  defect => enhancement


Old description:

> In particular, it should be possible to determine the operator performed
> by the
> "top-level" query in the query object, get a list of the subqueries, get
> any
> appropriate parameters supplied (eg, valno and end of range for a
> VALUE_RANGE
> query, window size for a phrase query, etc) and get the term, wqf and
> position
> for  a leaf query.
>
> This API will necessarily involve quite a few methods - we need to make
> sure
> that it is no more complicated than really necessary, and be sure that it
> doesn't expose internals of the query representation (preventing us
> modifying
> these in future).
>
> One particular issue is that we can't easily just return the "operator"
> used in
> the query, because leaf queries use a special "magic" value for the
> operator
> parameter.  There are several solutions to this: 1) make OP_LEAF public.
> 2)
> make "get_operator()" return -1, and just document that it does that, 3)
> add an
> "is_leaf()" method, and document that get_operator() shouldn't be called
> unless
> "is_leaf()" returns false.

New description:

 In particular, it should be possible to determine the operator performed
 by the
 "top-level" query in the query object, get a list of the subqueries, get
 any
 appropriate parameters supplied (eg, valno and end of range for a
 VALUE_RANGE
 query, window size for a phrase query, etc) and get the term, wqf and
 position
 for  a leaf query.

 This API will necessarily involve quite a few methods - we need to make
 sure
 that it is no more complicated than really necessary, and be sure that it
 doesn't expose internals of the query representation (preventing us
 modifying
 these in future).

 One particular issue is that we can't easily just return the "operator"
 used in
 the query, because leaf queries use a special "magic" value for the
 operator
 parameter.  There are several solutions to this: 1) make OP_LEAF public.
 2)
 make "get_operator()" return -1, and just document that it does that, 3)
 add an
 "is_leaf()" method, and document that get_operator() shouldn't be called
 unless
 "is_leaf()" returns false.

--

-- 
Ticket URL: <http://trac.xapian.org/ticket/159#comment:3>
Xapian <http://trac.xapian.org>
Xapian



More information about the Xapian-tickets mailing list