OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Error creating single-field vector index in Firestore with gcloud CLI

  • Thread starter Thread starter capiono
  • Start date Start date
C

capiono

Guest
I'm trying to create a single-field vector index in my Firestore database using the gcloud command-line interface (CLI) to enable vector search functionality.

However, I keep getting this error:

ERROR: (gcloud.alpha.firestore.indexes.composite.create) Invalid value for [--field-config]: Composite indexes must be configured with at least 2 fields. For single-field index management, use the commands under gcloud firestore indexes fields.

This is the command I'm running, based on the official documentation and what is returned when I try to query the collection:

Code:
gcloud alpha firestore indexes composite create --collection-group=People --query-scope=COLLECTION --field-config field-path="embedding",vector-config='{"dimension":"768", "flat": "{}"}'

I've confirmed that:

  • The embedding field exists in my Firestore documents.
  • I have the necessary permissions to create indexes.
  • I'm using the latest version of the gcloud CLI.

I understand this functionality is still in alpha, but I think the documentation is broken because it uses the composite command to create a single field index.

How can I create a single-field vector index in Firestore using the gcloud CLI?
<p>I'm trying to create a single-field vector index in my Firestore database using the gcloud command-line interface (CLI) to enable vector search functionality.</p>
<p>However, I keep getting this error:</p>
<blockquote>
<p>ERROR: (gcloud.alpha.firestore.indexes.composite.create) Invalid value for [--field-config]: Composite indexes must be configured with at least 2 fields. For single-field index management, use the commands under <code>gcloud firestore indexes fields</code>.</p>
</blockquote>
<p>This is the command I'm running, based on the official <a href="https://firebase.google.com/docs/firestore/vector-search#create_a_single-field_vector_index" rel="nofollow noreferrer">documentation</a> and what is returned when I try to query the collection:</p>
<pre><code>gcloud alpha firestore indexes composite create --collection-group=People --query-scope=COLLECTION --field-config field-path="embedding",vector-config='{"dimension":"768", "flat": "{}"}'
</code></pre>
<p>I've confirmed that:</p>
<ul>
<li>The embedding field exists in my Firestore documents.</li>
<li>I have the necessary permissions to create indexes.</li>
<li>I'm using the latest version of the gcloud CLI.</li>
</ul>
<p>I understand this functionality is still in alpha, but I think the documentation is broken because it uses the composite command to create a single field index.</p>
<p>How can I create a single-field vector index in Firestore using the gcloud CLI?</p>
Continue reading...
 

Latest posts

I
Replies
0
Views
1
impact christian
I
Top