Ticket #159: query_introspect.patch

File query_introspect.patch, 1.1 KB (added by Richard Boulton, 17 years ago)

Sketch of some of the API required for this

  • include/xapian/query.h

     
    189189         */
    190190        bool empty() const;
    191191
     192        /** Get the query operator in use.
     193         *
     194         *  This will return -1 for leaf queries.
     195         */
     196        Query::op get_operator() const;
     197
     198        /** Get a vector of all the subqueries inside this query.
     199         */
     200        std::vector<const Query &> get_subqueries() const;
     201
     202        /** Get the numeric parameter from a query.
     203         */
     204        Xapian::termcount get_parameter() const;
     205
     206        /** Get the termname for a leaf query.
     207         *
     208         *  Will return the empty string for non-leaf queries.
     209         */
     210        const std::string & get_termname() const;
     211
     212        /** Get the wqf for a leaf query.
     213         *
     214         *  Undefined result for non-leaf queries.
     215         */
     216        Xapian::termcount get_wqf() const;
     217
     218        /** Get the position for a leaf query.
     219         *
     220         *  Undefined result for non-leaf queries.
     221         */
     222        Xapian::termpos get_position() const;
     223
    192224        /** Returns a string representing the query.
    193225         *  Introspection method.
    194226         */