org.terrier.querying

Interface SearchRequest

    • Method Detail

      • addMatchingModel

        void addMatchingModel(String MatchingModelName,
                            String WeightingModelName)
        Set the matching model and weighting model that the Manager should use for this query. The Matching model should be a subclass of org.terrier.matching.Matching, and the weighting model should implement org.terrier.matching.Model.
        Example: request.addMatchingModel("Matching", "PL2")
        Parameters:
        MatchingModelName - the String class name that should be used
        WeightingModelName - the String class name that should be used
      • setQuery

        void setQuery(Query q)
        Set the query to be a parsed Query syntax tree, as generated by the Terrier query parser
        Parameters:
        q - The Query object syntax tree
      • setQueryID

        void setQueryID(String qid)
        Set a unique identifier for this query request.
        Parameters:
        qid - the unique string identifier
      • getQuery

        Query getQuery()
        Get the Query syntax tree
        Returns:
        The query object as set with setQuery.
      • setControl

        void setControl(String Name,
                      String Value)
        Set a control named to have value Value. This is essentially a hashtable wrappers. Controls are used to set properties of the retrieval process.
        Parameters:
        Name - the name of the control to set the value of.
        Value - the value that the control should take.
      • getQueryID

        String getQueryID()
        Returns the query id as set by setQueryID(String).
        Returns:
        the query Id as a string.
      • getResultSet

        ResultSet getResultSet()
        Returns the resultset generated by the query. Before retrieving this you probably need to have run Manager.runMatching, and (optionally, at your own risk) Manager.runPostProcesses() and Manager.runPostFiltering().
        Returns:
        ResultSet the resultset - ie the set of document Ids and their scores.
      • getControl

        String getControl(String Name)
        Returns the value of the control. Null or empty string if not set.
        Returns:
        the value.
      • isEmpty

        boolean isEmpty()
        Set if the query input had no terms.
        Returns:
        true if the query has no terms. Used by Manager.runMatching() to short circuit the matching process - if this is set, then a resultset with 0 documents is created automatically. - return true if the query has no terms
      • setOriginalQuery

        void setOriginalQuery(String q)
        sets the original query, before any preprocessing
      • getOriginalQuery

        String getOriginalQuery()
        gets the original query, before any preprocessing
      • setNumberOfDocumentsAfterFiltering

        void setNumberOfDocumentsAfterFiltering(int n)
        Sets the number of documents returned for a search request, after applying post filtering
        Parameters:
        n -
      • getNumberOfDocumentsAfterFiltering

        int getNumberOfDocumentsAfterFiltering()
        gets the number of documents returned for a search request, after applying post filtering
        Returns:
        the number of documents returned for a search request. integer.
      • getStartedProcessingTime

        long getStartedProcessingTime()
        Returns the time the process start.
        Returns:
        time long
      • setStartedProcessingTime

        void setStartedProcessingTime(long time)
        Sets the started processing time.
        Parameters:
        time -
      • setContextObject

        void setContextObject(String key,
                            Object value)
        Set a value of a context object.
        Parameters:
        key - the key of the context object
        value - the value of the context object
        Since:
        3.6
      • getContextObject

        Object getContextObject(String key)
        Returns the value of a context object.
        Parameters:
        key - the key of the context object to get
        Returns:
        the value of the context object for the given key
        Since:
        3.6

Terrier 4.0. Copyright © 2004-2014 University of Glasgow