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

Public Member Functions

default void parseQuery (Path query) throws IOException
 
void parseQuery (String query)
 
void toJson (Path path) throws IOException
 
default int numOfResults ()
 
default int numOfScores (String query)
 
List< InvertedIndex.Score > getScores (String query)
 
Set< String > getQueries ()
 
default boolean hasQuery (String query)
 

Detailed Description

Processor Interface. The processor is responsible for executing searches on the index, populating the results to either be sent to the client or output to a file.

Author
Ravneet Singh Bhatia
Version
Spring 2024

Member Function Documentation

◆ getQueries()

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

Returns the set of queries.

Returns
the set of queries.

Implemented in edu.usfca.cs272.QueryProcessor, and edu.usfca.cs272.ThreadSafeQueryProcessor.

◆ getScores()

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

Returns the scores for a query.

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

Implemented in edu.usfca.cs272.QueryProcessor, and edu.usfca.cs272.ThreadSafeQueryProcessor.

◆ hasQuery()

default boolean edu.usfca.cs272.Processor.hasQuery ( String query)

Returns true if a query is in the results.

Parameters
querythe query to lookup
Returns
true if a query is found in the results.

◆ numOfResults()

default int edu.usfca.cs272.Processor.numOfResults ( )

Returns the number of queries for which there is a result.

Returns
the number of queries for which there is a result.

Implemented in edu.usfca.cs272.ThreadSafeQueryProcessor.

◆ numOfScores()

default int edu.usfca.cs272.Processor.numOfScores ( String query)

Returns the number of results for a query.

Parameters
querythe query for which the number of scores is returned.
Returns
the number of results for a query.

◆ parseQuery() [1/2]

default void edu.usfca.cs272.Processor.parseQuery ( Path query) throws IOException

Reads a file containing queries to parse the queries within.

Parameters
querythe file containing the queries.
Exceptions
IOExceptionif the file is not found.

Implemented in edu.usfca.cs272.ThreadSafeQueryProcessor.

◆ parseQuery() [2/2]

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

Parses a query.

Parameters
querythe query to be searched.

Implemented in edu.usfca.cs272.QueryProcessor, and edu.usfca.cs272.ThreadSafeQueryProcessor.

◆ toJson()

void edu.usfca.cs272.Processor.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.

Implemented in edu.usfca.cs272.QueryProcessor, and edu.usfca.cs272.ThreadSafeQueryProcessor.


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