Skip to content

String filter not working with pluginQPS #935

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

Open
FabioNappi opened this issue May 15, 2025 · 4 comments
Open

String filter not working with pluginQPS #935

FabioNappi opened this issue May 15, 2025 · 4 comments

Comments

@FabioNappi
Copy link

Describe the bug

I have an Orama db with a string property in its schema and the QPS plugin enabled. When I perform a search with an array valued where clause on the string property (just like the second example in the docs) it finds no documents.

To Reproduce

  1. initialize orama with QPS plugin
create({
  schema: {
    title: 'string',
    category: 'string',
  },
  plugins: [pluginQPS()],
})
  1. insert documents
  2. search documents in the db
orama.search(db, {
  term: 'Harry',
  where: {
    category: ['movie', 'book']
  }
})
  1. the result is no documents found

Expected behavior

I expect to actually find documents with category = 'movie' OR category = 'book', but got none.

Environment Info

OS: MacOS 15.4
Node: 22.14.0
Orama: 3.1.6

Affected areas

Search

Additional context

No response

@micheleriva
Copy link
Member

@allevo any idea?

@allevo
Copy link
Collaborator

allevo commented May 17, 2025

Hi! No idea. Can you also give us some documents you insert?

@FabioNappi
Copy link
Author

Hello! Here it is a complete code snippet example to reproduce the bug. If you try to comment the plugin line, the search will actually return both documents

import {create, insertMultiple, search} from '@orama/orama'
import {pluginQPS} from '@orama/plugin-qps'

const db = create({
  schema: {
    title: 'string',
    category: 'string',
  },
  plugins: [pluginQPS()],
})

await insertMultiple(db, [
  {
    title: `Harry Potter and the Philosopher's Stone`,
    category: 'movie',
  },
  {
    title: 'Harry Potter and the Chamber of Secrets',
    category: 'book',
  },
])

const found = await search(db, {
  term: 'Harry',
  where: {
    category: ['movie', 'book'],
  },
})

console.log(found)

@FabioNappi
Copy link
Author

@allevo is there any news?

allevo added a commit that referenced this issue May 28, 2025
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

No branches or pull requests

3 participants