Skip to content

d1pankarmedhi/rsearch-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Okapi BM25 search

made-with-rust MIT license

Rust

A rust implementation of the BM25 search algorithm for document search, backed by an actix-web server.

BM25 is a bag-of-words retrieval function that ranks a set of documents based on the query terms appearing in each document, regardless of their proximity within the document - Wikipedia

okapi-bm25

Project set-up

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Make sure you have rust installed. If not, check-out the official rust documentation.

Installing

A step by step series of examples that tell you how to get a development env running

  1. Clone the repo and cd into it.
$ git clone https://github.com/d1pankarmedhi/search_bm25.git
$ cd search_bm25
  1. Build the project to add the dependencies and build the project.
$ cargo build
  1. Run the project
$ cargo run
  1. The server should be running on localhost:8080. Make a POST request and check if there's any response using curl. If yes, then the project is set-up successfully.
$ curl -X POST http://localhost:8080/search?query=breadth
# Response
{
  "documents": [
    {
      "document": "Document 5: Breadth-First Search",
      "score": 6.627193106486171
    },
    {
      "document": "A* search is a popular heuristic search algorithm that combines elements of breadth-first search and best-first search. It uses a heuristic function to estimate the cost of reaching the goal from a particular node. A* search intelligently explores the most promising paths first, improving efficiency in finding optimal solutions.",
      "score": 3.558679160608629
    },
    {
      "document": "Breadth-first search (BFS) is another graph traversal algorithm that explores all the vertices of a graph level by level. It starts at a specific vertex and visits all its neighbors before moving to the next level of vertices. BFS is commonly used to find the shortest path between two vertices or to solve puzzles with minimum moves.",
      "score": 3.2969824201070472
    }
  ]
}

Built With

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Releases

No releases published

Packages

No packages published

Languages