VIBE v5.1.6
Search Engine
Loading...
Searching...
No Matches
edu.usfca.cs272.QueryProcessor Class Reference
Inheritance diagram for edu.usfca.cs272.QueryProcessor:
edu.usfca.cs272.Processor

Public Member Functions

 QueryProcessor (InvertedIndex invertedIndex, boolean partial)
 
 QueryProcessor (InvertedIndex invertedIndex)
 
void parseQuery (String query)
 
void toJson (Path path) throws IOException
 
String toString ()
 
List< InvertedIndex.Score > getScores (String query)
 
Set< String > getQueries ()
 
- Public Member Functions inherited from edu.usfca.cs272.Processor
default void parseQuery (Path query) throws IOException
 
default int numOfResults ()
 
default int numOfScores (String query)
 
default boolean hasQuery (String query)
 

Detailed Description

Single threaded query processor.

Constructor & Destructor Documentation

◆ QueryProcessor() [1/2]

edu.usfca.cs272.QueryProcessor.QueryProcessor ( InvertedIndex invertedIndex,
boolean partial )

Creates a new query processor.

Parameters
invertedIndexThe index to be searched.
partialtrue if partial search is to be performed.

◆ QueryProcessor() [2/2]

edu.usfca.cs272.QueryProcessor.QueryProcessor ( InvertedIndex invertedIndex)

Creates a new Query Processor that always executes an exact search.

Parameters
invertedIndexindex to be searched

Member Function Documentation

◆ getQueries()

Set< String > edu.usfca.cs272.QueryProcessor.getQueries ( )

Returns the set of queries.

Returns
the set of queries.

Implements edu.usfca.cs272.Processor.

◆ getScores()

List< InvertedIndex.Score > edu.usfca.cs272.QueryProcessor.getScores ( String query)

Returns the scores for a query.

Parameters
querythe query for which to return scores.
Returns
the scores for a query.

Implements edu.usfca.cs272.Processor.

◆ parseQuery()

void edu.usfca.cs272.QueryProcessor.parseQuery ( String query)

Parses a query.

Parameters
querythe query to be searched.

Implements edu.usfca.cs272.Processor.

◆ toJson()

void edu.usfca.cs272.QueryProcessor.toJson ( Path path) throws IOException

Writes the search results in pretty Json to file path.

Parameters
paththe path of the file.
Exceptions
IOExceptionif the file is not found.

Implements edu.usfca.cs272.Processor.


The documentation for this class was generated from the following file: