firestore-vector-search does not work when pre-filtering boolean values
Opened this issue · 0 comments
MartinXPN commented
[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