Skip to content

Add client-side TF-IDF full-text search engine (closes #806) - #812

Closed
dikshajangra12918-oss wants to merge 1 commit into
praveenscience:mainfrom
dikshajangra12918-oss:feat/tfidf-search-engine
Closed

Add client-side TF-IDF full-text search engine (closes #806)#812
dikshajangra12918-oss wants to merge 1 commit into
praveenscience:mainfrom
dikshajangra12918-oss:feat/tfidf-search-engine

Conversation

@dikshajangra12918-oss

Copy link
Copy Markdown
Contributor

Description

Implements a client-side full-text search engine with TF-IDF based relevance ranking, built entirely as a single self-contained HTML file — no backend, no database, no external libraries.

Features

  • Paste multiple documents/paragraphs to build an in-browser inverted index
  • TF-IDF scoring (normalized term frequency × smoothed inverse document frequency) computed entirely client-side
  • Search bar returns ranked results with relevance scores displayed
  • Matched terms highlighted within result snippets for context
  • Add/remove documents dynamically, with a "Load Sample Docs" option for quick testing
  • Fully offline — works directly from file://, zero dependencies

Testing

Tested locally in browser — indexed sample documents, ran multiple queries, verified ranking order, score display, and term highlighting all work as expected.

Closes #806

@praveenscience

Copy link
Copy Markdown
Owner

Kindly follow the contribution guidelines. Also honour the PR task list please.

@praveenscience

Copy link
Copy Markdown
Owner

Create a new PR with the following insturctions:

Procedure

  1. Make a great design & think of a style, say retro.
  2. Go to main branch of the repo.
  3. Pull the upstream branch: git pull upstream main.
  4. Copy the contents of the HTML.
  5. Inside the tools, create the file github-token-validator-retro.html.
  6. Paste the contents of the HTML.
  7. Take a screenshot of the UI.
  8. Save it as github-token-validator-retro.png.
  9. Edit the tools.json with the newly created github-token-validator-retro.
  10. Fill in all the fields.
  11. Update the ReadMe with the newly created file.
  12. Run two commands: node build and node sort-norm tools.json.
  13. Commit the files.
  14. Raise the Pull Request.
  15. Get it merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Idea: Client-Side Full-Text Search Engine with TF-IDF Ranking

2 participants