Class Scope

  • All Implemented Interfaces:
    PostFilter

    public class Scope
    extends java.lang.Object
    implements PostFilter
    Checks that the prefix of the document number (upto the first "-") is included in this list of scopes as given by the scope control. This is a PostFilter, so new_query() is called for each new query, and filter() is called for each result in the resultset.
    Author:
    Craig Macdonald
    • Constructor Detail

      • Scope

        public Scope()
    • Method Detail

      • new_query

        public void new_query​(Manager m,
                              SearchRequest srq,
                              ResultSet rs)
        Creates a HashSet of scopes that can are allowed to be in the document number prefix.
        Specified by:
        new_query in interface PostFilter
        Parameters:
        m - Manager the manager used for processing the request.
        srq - SearchRequest the search request to process.
        rs - ResultSet the result set for the search request.
      • filter

        public byte filter​(Manager m,
                           SearchRequest srq,
                           ResultSet rs,
                           int rank,
                           int docid)
        Called for each result in the resultset, used to filter out unwanted results, based on the presence of some strings in the document number. The document number upto the first "-" is checked for presence in the scopes HashSet.
        Specified by:
        filter in interface PostFilter
        Parameters:
        m - The manager controlling this query
        srq - The search request being processed
        rs - the resultset that is being iterated through
        rank - the array index in the resultset have we reached
        docid - The document number of the currently being processed result.