This is a simple search engine application implemented in Java. The application reads records from a file and allows users to search for records using different matching strategies.
These instructions will help you set up and run the project on your local machine for development and testing purposes.
- Java Development Kit (JDK) 11 or higher
- Apache Maven 3.6.3 or higher
- Clone the repository:
git clone https://github.com/BrianVega/SearchEngine_Hyperskill.git
- Navigate to the project directory:
cd SearchEngine_Hyperskill
- Build the project using Maven:
mvn clean install
- Run the program by passing a CLI argument that corresponds to the name of the file in plain text format that will serve as input for load the data.
- 1.1 The CLI argument has the following syntax: --data <value> where value corresponds to the location where the input file is located.
- 1.2 The input file needs to meet the required input standards as shown in the Sample Input File.
Dwight Joseph [email protected]
Rene Webb [email protected]
Katie Jacobs
Erick Harrington [email protected]
Myrtle Medina
Erick Burgess
(...)
<name> <surname> <email>
The application presents a menu with the following options:
- Select this option by entering
1
. - You will be prompted to choose a search strategy (ALL, ANY, NONE).
- After selecting the strategy, enter the search term(s).
- The application will display the records that match the search criteria based on the chosen strategy.
- Select this option by entering
2
. - The application will display all the records currently loaded in the search engine.
- Select this option by entering
0
. - The application will exit.
You can search using three different strategies:
- ALL: Finds records containing all search terms.
- ANY: Finds records containing any of the search terms.
- NONE: Finds records that do not contain any of the search terms.
The project is structured as follows:
- org.search: Main package containing the core logic.
- Main: Entry point of the application.
- SearchEngine: Main class handling data loading and search operations.
- Data: Class representing individual records.
- Enums: Contains the
Strategies
enum defining search strategies. - Interfaces: Contains the
Strategy
interface andBaseSearch
abstract class. - Models.Strategies: Contains implementations of the different search strategies (
All
,Any
,None
) and theStrategyFactory
class. - UI: Handles user interactions.
- IO: Handles input and output operations, including validation.