Class InteractiveQuerying


  • public class InteractiveQuerying
    extends AbstractQuerying
    This class performs interactive querying at the command line. It asks for a query on Standard Input, and then displays the document IDs that match the given query.

    Properties:

    • interactive.model - which weighting model to use, defaults to PL2
    • interactive.matching - which Matching class to use, defaults to Matching
    • interactive.manager - which Manager class to use, defaults to Matching
    Author:
    Gianni Amati, Vassilis Plachouras, Ben He, Craig Macdonald
    • Field Detail

      • INTERACTIVE_COMMAND

        public static final java.lang.String INTERACTIVE_COMMAND
        See Also:
        Constant Field Values
      • logger

        protected static final org.slf4j.Logger logger
        The logger used
      • lowercase

        protected static final boolean lowercase
        Change to lowercase?
      • verbose

        protected boolean verbose
        display user prompts
      • resultFile

        protected java.io.PrintWriter resultFile
        The file to store the output to.
      • RESULTS_LENGTH

        protected static int RESULTS_LENGTH
        The maximum number of presented results.
      • metaKeys

        protected java.lang.String[] metaKeys
      • printDocid

        protected boolean printDocid
    • Constructor Detail

      • InteractiveQuerying

        public InteractiveQuerying​(IndexRef iRef)
        A default constructor initialises the index, and the Manager.
      • InteractiveQuerying

        @Deprecated
        public InteractiveQuerying()
        Deprecated.
    • Method Detail

      • close

        public void close()
        Closes the used structures.
      • processQuery

        public SearchRequest processQuery​(java.lang.String queryId,
                                          java.lang.String query)
        According to the given parameters, it sets up the correct matching class.
        Overrides:
        processQuery in class AbstractQuerying
        Parameters:
        queryId - String the query identifier to use.
        query - String the query to process.
      • processQueries

        public void processQueries()
        Performs the matching using the specified weighting model from the setup and possibly a combination of evidence mechanism. It parses the file with the queries (the name of the file is defined in the address_query file), creates the file of results, and for each query, gets the relevant documents, scores them, and outputs the results to the result file.
      • printResults

        public void printResults​(java.io.PrintWriter pw,
                                 SearchRequest q)
                          throws java.io.IOException
        Prints the results
        Parameters:
        pw - PrintWriter the file to write the results to.
        q - SearchRequest the search request to get results from.
        Throws:
        java.io.IOException
      • main

        public static void main​(java.lang.String[] args)
        Starts the interactive query application.
        Parameters:
        args - the command line arguments.