VIBE v5.1.6
Search Engine
|
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) |
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.
Set< String > edu.usfca.cs272.Processor.getQueries | ( | ) |
Returns the set of queries.
Implemented in edu.usfca.cs272.QueryProcessor, and edu.usfca.cs272.ThreadSafeQueryProcessor.
List< InvertedIndex.Score > edu.usfca.cs272.Processor.getScores | ( | String | query | ) |
Returns the scores for a query.
query | the query for which to return scores. |
Implemented in edu.usfca.cs272.QueryProcessor, and edu.usfca.cs272.ThreadSafeQueryProcessor.
default boolean edu.usfca.cs272.Processor.hasQuery | ( | String | query | ) |
Returns true if a query is in the results.
query | the query to lookup |
default int edu.usfca.cs272.Processor.numOfResults | ( | ) |
Returns the number of queries for which there is a result.
Implemented in edu.usfca.cs272.ThreadSafeQueryProcessor.
default int edu.usfca.cs272.Processor.numOfScores | ( | String | query | ) |
Returns the number of results for a query.
query | the query for which the number of scores is returned. |
default void edu.usfca.cs272.Processor.parseQuery | ( | Path | query | ) | throws IOException |
Reads a file containing queries to parse the queries within.
query | the file containing the queries. |
IOException | if the file is not found. |
Implemented in edu.usfca.cs272.ThreadSafeQueryProcessor.
void edu.usfca.cs272.Processor.parseQuery | ( | String | query | ) |
Parses a query.
query | the query to be searched. |
Implemented in edu.usfca.cs272.QueryProcessor, and edu.usfca.cs272.ThreadSafeQueryProcessor.
void edu.usfca.cs272.Processor.toJson | ( | Path | path | ) | throws IOException |
Writes the search results in pretty Json to file path.
path | the path of the file. |
IOException | if the file is not found. |
Implemented in edu.usfca.cs272.QueryProcessor, and edu.usfca.cs272.ThreadSafeQueryProcessor.