Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hybrid search mode and unify vector, hybrid, and full-text search under the same API #587

Merged
merged 37 commits into from
Jan 14, 2024

Conversation

micheleriva
Copy link
Member

@micheleriva micheleriva commented Dec 18, 2023

This PR unifies full-text, vector, and hybrid searches under the same search method.

import { create, insert, search } from '@orama/orama'

const db = await create({
  schema: {
    text: 'string',
    embedding: 'vector[1536]'
  }
})

await insert(db, { ... })
await insert(db, { ... })
await insert(db, { ... })

const fulltextResults = await search(db, {
  term: 'Super Mario games'
})

const hybridResults = await search(db, {
  term: 'Super Mario games',
  mode: 'hybrid'
})

const vectorResults = await search(db, {
  term: 'Super Mario games',
  mode: 'vector'
})

The text-to-embedding part is managed by Orama Cloud under the Secure Proxy API, which lets you connect to OpenAI or any other service from your front-end directly.

This PR also introduces:

  1. Facets for vector search
  2. GroupBy operations for vector search
  3. "where" filters operations for vector search

Copy link

vercel bot commented Dec 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
orama-docs ✅ Ready (Inspect) Visit Preview 4 resolved Jan 14, 2024 1:51pm

@micheleriva micheleriva changed the title adds types for hybrid search Add hybrid search mode Dec 18, 2023
@micheleriva micheleriva changed the title Add hybrid search mode Add hybrid search mode and unify vector, hybrid, and full-text search under the same API Jan 14, 2024
@micheleriva micheleriva changed the base branch from main to feat/orama-2.0-release January 14, 2024 13:54
@micheleriva micheleriva merged commit 0a27b46 into feat/orama-2.0-release Jan 14, 2024
3 checks passed
@micheleriva micheleriva deleted the feat/hybrid-search-and-proxy branch January 14, 2024 13:54
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.

1 participant