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

firestore-vector-search does not work when pre-filtering boolean values #533

Open
MartinXPN opened this issue Sep 5, 2024 · 0 comments
Open

Comments

@MartinXPN
Copy link

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs for a specific extension in this repository.
If you have a general question, need help debugging, or fall into some
other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • To file a bug against the Firebase Extensions platform, or for an issue affecting multiple extensions, please reach out to
    Firebase support directly.

[REQUIRED] Step 2: Describe your configuration

  • Extension name: firestore-vector-search
  • Extension version: 0.0.4

[REQUIRED] Step 3: Describe the problem

When trying to filter with boolean values, the Function crashes. Here is an example call that crashes (but works okay if we turn true into 'true' and false into 'false':

    const {getApp} = await import('firebase/app');
    const {getFunctions, httpsCallable} = await import('firebase/functions');

    const functions = getFunctions(getApp(), 'us-east4');
    const query = httpsCallable(functions, 'ext-firestore-vector-search-queryCallable');
    const res = await query({
        query: submissionText,
        limit: limit,
        prefilters: [
            {field: 'courseId', operator: '==', value: courseId},
            {field: 'exerciseId', operator: '==', value: exerciseId},
            {field: 'isTestRun', operator: '==', value: false},   // The extension seems to only support string values
            {field: 'isBest', operator: '==', value: true},          // The extension seems to only support string values
            {field: 'status', operator: '==', value: 'Solved'},
            // {field: 'createdAt', operator: '<=', value: createdAt},      (The extension does not allow this currently)
        ],
    });
    console.log('Got similar submissions:', res);

Steps to reproduce:

Any pre-filtering based on the boolean values seems to crash the queryCallable Function (4xx error).

Expected result

It should work fine with boolean values.

Actual result

The queryCallable crashes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants