lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tatu Saloranta <>
Subject Term collector, base Query modifications
Date Sun, 16 Mar 2003 04:41:48 GMT
After submitting the term collector patch I realized that the patch probably 
should be broken into two pieces:  one that contains base changes to Query 
classes, and that are likely to be needed no matter how Terms are collected, 
and second that contains other code built on top of normal query classes 
(query iterator, term iterators).
This way patches can be evaluated separately.

Attached is included set of patches to core Query classes that are not 
specific to term collector idea.

Here's the quick rundown on changes:

  - added 'getQuery()' to be able to access Query contained in boolean clause
    (query member variable is public, but I think access should be done via
    get-method, and member variable could if need be changed to private)

  - added 'getTerm()' for accessing unexpanded base term.

  - added 'hasBoost()' that's equivalent to 'return (boots != 1.0f)'. I think 
    it's better to use this method instead of comparing to a well-known
   constant, although I didn't at this point change those calls.

  - added 'getLowerTerm()' and 'getUpperTerm()', to be able to access
   unexpanded base terms that define range.
 - added 'isInclusive()' for accessing 'inclusive' flag that indicates whether
   limit Terms themselves are to be included in the range to match terms.
- changed 'getField()' from private to public. It might be a good idea to 
  require all Query classes to define 'getField()' method, but I didn't do
  that yet. (it is possible to access field data through various getTerm()
  methods, and then check Term's field... but the way to do that is 
  query type specific).

-+ Tatu +-

View raw message