Introduction to Orama
Orama is a feature-rich, open-source search platform designed to provide developers with powerful tools for efficient and versatile data querying. Backed by a comprehensive set of features and plugins, Orama caters to the diverse needs of modern-day development, whether you're dealing with simple text searches or complex data structures.
Key Features
Orama stands out with an array of highlighted features that empower users to perform various types of search operations:
- Full-Text Search: Allows comprehensive searching within text content for quick and accurate results.
- Vector Search: Leverages advanced techniques for searching similar items based on vector mathematics, ideal for scenarios like image or voice recognition.
- Hybrid Search: Combines the strengths of different search types to provide versatile querying capabilities.
- GenAI Chat Sessions: Facilitates intelligent conversational experiences combining search and generation capabilities.
- Search Filters and Facets: Helps refine search results by applying various filters and organizing data into meaningful categories.
- Geosearch: Specializes in location-based searches, suitable for applications that involve geographic data.
- Fields Boosting: Enhances the significance of certain fields in search queries to improve result relevance.
- Typo Tolerance and Exact Match: Ensures robust searches by tolerating minor errors or requiring exact matches in queries.
- BM25 Algorithm: Implements advanced algorithms for ranking documents based on relevance.
- Stemming and Tokenization: Supports text processing in 30 languages, aiding language-specific search optimization.
- Plugin System: Extensible via plugins, allowing for custom functionality and integration with other systems.
Installation
Orama can be easily installed using popular package managers like npm
, yarn
, pnpm
, or bun
. For quick access, it can also be imported directly in browser modules or used with Deno using a CDN URL.
How to Use Orama
Orama is designed to be user-friendly. Start by creating a database instance and defining an indexing schema. The platform supports 10 data types, including strings, numbers, booleans, enums, geopoints, arrays, and vectors, catering to a wide range of applications.
Here's a simple example of setting up a database and performing a search:
import { create, insert, search } from '@orama/orama';
const db = create({
schema: {
name: 'string',
description: 'string',
price: 'number',
embedding: 'vector[1536]',
meta: {
rating: 'number',
},
},
});
insert(db, {
name: 'Noise cancelling headphones',
description: 'Best noise cancelling headphones on the market',
price: 99.99,
embedding: [0.2432, 0.9431, 0.5322, 0.4234, ...],
meta: {
rating: 4.5,
},
});
const results = search(db, {
term: 'Best headphones',
});
Advanced Search Options
Orama supports both vector and hybrid search modes, utilizing text embeddings to enhance search accuracy. This can be especially powerful for finding similar items or categories.
For creating embeddings, Orama offers useful plugins like @orama/plugin-embeddings
, ensuring seamless integration with machine learning tools like TensorFlow. Additionally, OpenAI's APIs can be securely accessed using Orama's Secure Proxy Plugin
, enabling applications like ChatGPT-like experiences.
Orama Plugins
Orama's functionality can be extended with its official plugins. Examples include:
- Plugin Embeddings: Simplifies embedding generation and usage.
- Plugin Secure Proxy: Ensures secure communication with services like OpenAI.
- Plugin Analytics and Data Persistence: Enhances data management and insights.
- Plugin QPS, PT15, and more: Offer specialized features for diverse development needs.
Developers are also encouraged to create custom plugins, as Orama's open architecture supports extensive adaptability.
Conclusion
Orama is a robust solution for developers seeking an efficient, feature-rich search platform. With its wide range of capabilities and easy integration options, Orama ensures that both basic and complex search requirements are met with precision and ease.
For a comprehensive understanding of Orama, its usage, and its capabilities, visit the Orama documentation.