|
| 1 | +# Search Engine Project 🔍 |
1 | 2 |
|
2 |
| -# Search Engine Project |
| 3 | +This project simulates a simple **search engine** using the **map data structure** 🗺️. The program constructs an **inverted index** 📚 from a set of documents, enabling efficient searching. The search engine can process different types of user queries and display the names of documents that match the search criteria. |
3 | 4 |
|
4 |
| -This project simulates a simple search engine using the map data structure. The program constructs an inverted index from a set of documents, enabling efficient searching. The search engine can process different types of user queries and display the names of documents that match the search criteria. |
| 5 | +## Features 🛠️ |
5 | 6 |
|
6 |
| -## Features |
| 7 | +- **Inverted Index Construction** 🔄: The program reads multiple documents and constructs an inverted index, mapping each word to the documents in which it appears. |
| 8 | +- **Search Queries** 🔍: The program supports three types of queries: |
| 9 | + 1. **Must-have Words** ✨: Words that must appear in the search results (no prefix). |
| 10 | + 2. **At Least One Word** ➕: Words prefixed with `+`, where at least one of the specified words must be present in the result. |
| 11 | + 3. **Exclusion Words** ❌: Words prefixed with `-`, which should not be present in the search results. |
7 | 12 |
|
8 |
| -- **Inverted Index Construction**: The program reads multiple documents and constructs an inverted index, mapping each word to the documents in which it appears. |
9 |
| -- **Search Queries**: The program supports three types of queries: |
10 |
| - 1. **Must-have Words**: Words that must appear in the search results (no prefix). |
11 |
| - 2. **At Least One Word**: Words prefixed with `+`, where at least one of the specified words must be present in the result. |
12 |
| - 3. **Exclusion Words**: Words prefixed with `-`, which should not be present in the search results. |
| 13 | +## How It Works ⚙️ |
13 | 14 |
|
14 |
| -## How It Works |
| 15 | +1. **Inverted Index** 📑: The inverted index is created by reading documents and storing the words along with their corresponding document names. |
| 16 | +2. **User Input** 📝: The program takes a search query from the user and returns the document names based on the following rules: |
| 17 | + - **No Prefix** ➖: Returns documents containing all the specified words. |
| 18 | + - **+ Prefix** ➕: Returns documents containing at least one of the specified words. |
| 19 | + - **- Prefix** ❌: Excludes documents containing the specified word. |
15 | 20 |
|
16 |
| -1. **Inverted Index**: The inverted index is created by reading documents and storing the words along with their corresponding document names. |
17 |
| -2. **User Input**: The program takes a search query from the user and returns the document names based on the following rules: |
18 |
| - - **No Prefix**: Returns documents containing all the specified words. |
19 |
| - - **+ Prefix**: Returns documents containing at least one of the specified words. |
20 |
| - - **- Prefix**: Excludes documents containing the specified word. |
21 |
| - |
22 |
| -## Example |
| 21 | +## Example 📝 |
23 | 22 |
|
24 | 23 | ### Query 1: No Prefix (Must-have Words)
|
25 | 24 | ```
|
|
0 commit comments