Python bindings for Milli, the embeddable Rust-based search engine powering Meilisearch

Related tags

Text search milli-py
Overview

milli-py

ci-badge

Python bindings for Milli, the embeddable Rust-based search engine powering Meilisearch.

Due to limitations around Rust lifecycles, methods available via IndexDocuments and Search have been integrated directly into the Index class. This sacrifices/simplifies functionality available in the original milli package.

Install the package via:

pip install milli

Usage

Basic usage of the milli-py:

import milli

index = milli.Index("path/to/index")
index.add_documents([   
    { "id": 0, "title": "Hello world", "content": "This is a sample" },
    { "id": 1, "title": "Hello moon", "content": "This is another sample" },
    { "id": 2, "title": "Hello sun", "content": "This is yet another sample" },
])
results = index.search("wrold")
document = index.get_document(results[0])
assert(document['title'] == "Hello world")

Documentation

Full documentation for milli-py is available at docs/index.md.

View it online at https://github.com/AlexAltea/milli-py/blob/master/docs/index.md.

Examples

Real-world examples of milli-py in action:

  • Curator: Searching 140k movies (~10 MB csv, ~140 MB index) in around 36ms to obtain metadata from OMDB and auto-rename/tag movie collections.

Do you have other interesting examples? Let me know!

You might also like...
High-performance log search engine.

NOTE: This project is under development, please do not depend on it yet as things may break. MinSQL MinSQL is a log search engine designed with simpli

Perlin: An Efficient and Ergonomic Document Search-Engine

Table of Contents 1. Perlin Perlin Perlin is a free and open-source document search engine library build on top of perlin-core. Since the first releas

🔍TinySearch is a lightweight, fast, full-text search engine. It is designed for static websites.
🔍TinySearch is a lightweight, fast, full-text search engine. It is designed for static websites.

tinysearch TinySearch is a lightweight, fast, full-text search engine. It is designed for static websites. TinySearch is written in Rust, and then com

⚡ Insanely fast, 🌟 Feature-rich searching. lnx is the adaptable deployment of the tantivy search engine you never knew you wanted.  Standing on the shoulders of giants.
⚡ Insanely fast, 🌟 Feature-rich searching. lnx is the adaptable deployment of the tantivy search engine you never knew you wanted. Standing on the shoulders of giants.

✨ Feature Rich | ⚡ Insanely Fast An ultra-fast, adaptable deployment of the tantivy search engine via REST. 🌟 Standing On The Shoulders of Giants lnx

⚡ Insanely fast, 🌟 Feature-rich searching. lnx is the adaptable deployment of the tantivy search engine you never knew you wanted.  Standing on the shoulders of giants.
⚡ Insanely fast, 🌟 Feature-rich searching. lnx is the adaptable deployment of the tantivy search engine you never knew you wanted. Standing on the shoulders of giants.

✨ Feature Rich | ⚡ Insanely Fast An ultra-fast, adaptable deployment of the tantivy search engine via REST. 🌟 Standing On The Shoulders of Giants lnx

Cross-platform, cross-browser, cross-search-engine duckduckgo-like bangs

localbang Cross-platform, cross-browser, cross-search-engine duckduckgo-like bangs What are "bangs"?? Bangs are a way to define where to search inside

Configurable quick search engine shortcuts for your terminal and browser.

Quicksearch Configurable quick search engine shortcuts for your terminal and browser. Installation Run cargo install quicksearch to install Configurat

A full-text search and indexing server written in Rust.

Bayard Bayard is a full-text search and indexing server written in Rust built on top of Tantivy that implements Raft Consensus Algorithm and gRPC. Ach

Image search example by approximate nearest-neighbor library In Rust

rust-ann-search-example Image search example by approximate nearest-neighbor library In Rust use - tensorflow 0.17.0 - pretrain ResNet50 - hora (Ru

Comments
  • Implement Drop for PyIndex

    Implement Drop for PyIndex

    We should implement the Drop trait for PyIndex:

    impl Drop for PyIndex {
        fn drop(&mut self) {
            //self.index.prepare_for_closing().wait();
        }
    }
    

    This would allow us to explicitly close the database, which is needed if we want to programmatically remove the underlying directory where an Index has been created, e.g. after del index or during Index's __enter__ and __exit__.

    The issue with this is that Index.prepare_for_closing() takes the ownership of the value but drop(&mut self) is taking a reference. (Not sure if this sentence makes sense, I'm not a Rust programmer; just expressing my vague intuition).

    In Rust words:

    [...] cannot move out of `self.index` which is behind a mutable reference
    
    bug 
    opened by AlexAltea 2
  • potentially add version tags?

    potentially add version tags?

    First of all - thank you for sharing this useful library with the world!

    I was wondering if you'd be open to adding version tags on git/GitHub along with releases of new versions on pypi - this would be immensely helpful for those who might want to build this package from source

    Thanks again!

    opened by jpetrucciani 5
Owner
Alexandro Sanchez
Security, reversing, mathematics. Writing emulators and hypervisors.
Alexandro Sanchez
A stupid wrapper around Meilisearch 🐻

Mieli ?? Usage ?? mieli 0.1.10 A stupid wrapper around meilisearch USAGE: mieli [OPTIONS] <SUBCOMMAND> FLAGS: -h, --help Prints help i

Irevoire 16 Aug 5, 2022
Shogun search - Learning the principle of search engine. This is the first time I've written Rust.

shogun_search Learning the principle of search engine. This is the first time I've written Rust. A search engine written in Rust. Current Features: Bu

Yuxiang Liu 5 Mar 9, 2022
Tantivy is a full-text search engine library inspired by Apache Lucene and written in Rust

Tantivy is a full text search engine library written in Rust. It is closer to Apache Lucene than to Elasticsearch or Apache Solr in the sense it is no

tantivy 7.4k Dec 28, 2022
AI-powered search engine for Rust

txtai: AI-powered search engine for Rust txtai executes machine-learning workflows to transform data and build AI-powered text indices to perform simi

NeuML 69 Jan 2, 2023
A full-text search engine in rust

Toshi A Full-Text Search Engine in Rust Please note that this is far from production ready, also Toshi is still under active development, I'm just slo

Toshi Search 3.8k Jan 7, 2023
A Rust API search engine

Roogle Roogle is a Rust API search engine, which allows you to search functions by names and type signatures. Progress Available Queries Function quer

Roogle 342 Dec 26, 2022
Tantivy is a full text search engine library written in Rust.

Tantivy is a full text search engine library written in Rust. It is closer to Apache Lucene than to Elasticsearch or Apache Solr in the sense it is no

Quickwit OSS 7.4k Dec 30, 2022
Tantivy is a full-text search engine library inspired by Apache Lucene and written in Rust

Tantivy is a full-text search engine library written in Rust. It is closer to Apache Lucene than to Elasticsearch or Apache Solr in the sense it is no

Quickwit OSS 7.5k Jan 9, 2023
A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (a pun here).

simsearch A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (a pun here). Documentation Usage Add the f

Andy Lok 116 Dec 10, 2022
Lightning Fast, Ultra Relevant, and Typo-Tolerant Search Engine

MeiliSearch Website | Roadmap | Blog | LinkedIn | Twitter | Documentation | FAQ ⚡ Lightning Fast, Ultra Relevant, and Typo-Tolerant Search Engine ?? M

MeiliSearch 31.6k Dec 31, 2022