Skip to content

It simulates a simple search engine using an inverted index to efficiently retrieve documents based on user queries. It supports must-have words, optional words, and exclusion filters, enabling flexible and precise search results. The system processes multiple documents, indexes their content,and allows users to search using logical query operators

License

Notifications You must be signed in to change notification settings

Shabnam-Khaqanpoor/Search-Engine-Using-Map

This branch is 1 commit ahead of UI-DS-02/search-engine-Shabnam2003:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5e67d5b Β· Feb 21, 2025

History

14 Commits
Jan 5, 2024
Jan 7, 2024
Feb 21, 2025
Feb 21, 2025

Repository files navigation

Search Engine Project πŸ”

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.

Features πŸ› οΈ

  • Inverted Index Construction πŸ”„: The program reads multiple documents and constructs an inverted index, mapping each word to the documents in which it appears.
  • Search Queries πŸ”: The program supports three types of queries:
    1. Must-have Words ✨: Words that must appear in the search results (no prefix).
    2. At Least One Word βž•: Words prefixed with +, where at least one of the specified words must be present in the result.
    3. Exclusion Words ❌: Words prefixed with -, which should not be present in the search results.

How It Works βš™οΈ

  1. Inverted Index πŸ“‘: The inverted index is created by reading documents and storing the words along with their corresponding document names.
  2. User Input πŸ“: The program takes a search query from the user and returns the document names based on the following rules:
    • No Prefix βž–: Returns documents containing all the specified words.
    • + Prefix βž•: Returns documents containing at least one of the specified words.
    • - Prefix ❌: Excludes documents containing the specified word.

Example πŸ“

Query 1: No Prefix (Must-have Words)

Input: "apple orange"
Output: Documents containing both "apple" and "orange".

Query 2: + Prefix (At Least One Word)

Input: "+apple +banana"
Output: Documents containing either "apple" or "banana" or both.

Query 3: - Prefix (Exclusion)

Input: "-apple"
Output: Documents that do not contain the word "apple".

About

It simulates a simple search engine using an inverted index to efficiently retrieve documents based on user queries. It supports must-have words, optional words, and exclusion filters, enabling flexible and precise search results. The system processes multiple documents, indexes their content,and allows users to search using logical query operators

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%