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

Feature/orm 2152 - UI-components: supporting multi-index search #78

Merged
merged 4 commits into from
Jan 27, 2025

Conversation

rjborba
Copy link
Collaborator

@rjborba rjborba commented Jan 27, 2025

Add multiindex support.

If passing OramaClient instance, be sure to have mergeResults property set to true.

  • index property now accepts both { api_key: string, endpoint: string } or [ { api_key: string, endpoint: string } ]
  • Below a example of how to manage different schemas by leveraging resultMap callbacks.
{
  resultMap: {
    description: (doc) => {
      return doc.description || doc.content
    },
    section: (doc) => {
      return doc.genres?.[0] || doc.section
    },
  },
  index: [
    {
      api_key: 'hdRgZI3j8Z38pImkqYWbAw7SwnrJk8Nt',
      endpoint: 'https://cloud.orama.run/v1/indexes/videogames-nb9lk0',
    },
    { api_key: 'LerNlbp6379jVKaPs4wt2nZT4MJZbU1J', endpoint: 'https://cloud.orama.run/v1/indexes/docs-orama-b3f5xd' },
  ]
}

First search could fail for any reason. It doesn't seems to be smart to display a error on bootstrap because of it
Copy link

vercel bot commented Jan 27, 2025

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

Name Status Preview Comments Updated (UTC)
orama-ui-components-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 2:42am

@rjborba rjborba merged commit eeae2f0 into main Jan 27, 2025
3 checks passed
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