Skip to content

nih8/Mini-Search-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧭 Mini Search Engine (C++)

This project implements a mini text-search engine using core C++ data structures. It supports Word Search, Phrase Search, and Autocomplete across multiple .txt files.

Features

Indexes all words from multiple files

Stores word positions for fast lookup

Word search sorted by highest frequency

Phrase search with exact sequential matching

Trie-based autocomplete for prefixes

How It Works

Load text files

Normalize: lowercase + remove punctuation

Skip stopwords

Build global index:

unordered_map<string, unordered_map<string, vector>>

Insert words into Trie

Provide search operations via menu

Word Search

Directly fetch frequency from index and sort files by occurrences.

Phrase Search

Check if phrase words appear sequentially using position matching.

Autocomplete

Trie returns all words matching a given prefix.

A simple BFS-based bipartite check is included to validate graph-like relationships dynamically built during processing. This ensures stable linking of words/files and prevents invalid structural patterns.

🔹 How to Run g++ main.cpp -o search ./search

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages