Skip to content

Textora is a distributed full-text search engine designed to be lightweight, fast, and scalable. Built in Rust, it leverages the power of Tantivy for indexing and searching, aiming to provide a robust alternative to Elasticsearch with a smaller footprint and memory safety guarantees.

License

Notifications You must be signed in to change notification settings

Alkamal01/Textora

Repository files navigation

Textora

A High-Performance Full-Text Search Engine in Rust

License: MIT

Overview

Textora is a distributed full-text search engine designed to be lightweight, fast, and scalable. Built in Rust, it leverages the power of Tantivy for indexing and searching, aiming to provide a robust alternative to Elasticsearch with a smaller footprint and memory safety guarantees.

Textora allows you to create indexes, index documents, and perform complex queries (boolean, range, phrase, etc.) via a simple RESTful API.

Key Features

  • High Performance: Built on top of Tantivy, providing fast indexing and sub-second search latencies.
  • Memory Safe: Logic is written in safe Rust, ensuring stability and preventing common memory bugs.
  • REST API: Easy-to-use JSON API for all operations.
  • Distributed Architecture: (Experimental) Support for clustering and distributed consensus via Raft.
  • Configurable: extensive configuration options for memory usage, commit policies, and more.

Getting Started

Prerequisites

  • Rust: Stable channel (1.39+)
  • Cargo

Building from Source

Clone the repository and build using Cargo:

git clone https://github.com/Alkamal01/Textora.git
cd Textora
cargo build --release

Running Textora

After building, you can start the server:

./target/release/textora

You should see the startup banner:

  _______        __
 /_  __/__  ____/ /____  ________ _
  / / / _ \/ __ \/ __/ _ \/ ___/ _ `/
 /_/  \___/_/ /_/\__/\___/_/   \_,_/

 Textora Search Engine
 
 INFO  textora::index > Indexes: []

Verify it's running:

curl -X GET http://localhost:8080/

Response:

{
  "name": "Textora Search",
  "version": "0.1.1"
}

Configuration

Textora looks for a configuration file in config/config.toml by default.

Example Configuration

host = "127.0.0.1"
port = 8080
path = "data/"
writer_memory = 200000000
log_level = "info"
json_parsing_threads = 4

Settings

  • host: The IP address to bind to (default: 0.0.0.0)
  • port: The port to listen on (default: 8080)
  • path: Directory to store index data.
  • writer_memory: Memory in bytes for the index writer buffer.
  • log_level: Logging verbosity (info, debug, trace, etc.).

Usage Examples

Indexing Documents

Textora supports bulk indexing.

Search Queries

Textora supports various query types including Term, Phrase, Range, and Boolean queries.

Term Query

{ "query": {"term": {"test_text": "document" } }, "limit": 10 }

Phrase Query

{ "query": {"phrase": {"test_text": {"terms": ["search", "engine"] } } }, "limit": 10 }

Boolean Query

{ "query": {"bool": {"must": [ { "term": { "test_text": "rust" } } ], "must_not": [ {"range": {"year": { "lt": 2015 } } } ] } } }

License

This project is licensed under the MIT License.

About

Textora is a distributed full-text search engine designed to be lightweight, fast, and scalable. Built in Rust, it leverages the power of Tantivy for indexing and searching, aiming to provide a robust alternative to Elasticsearch with a smaller footprint and memory safety guarantees.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages