Docs: Add FLOAT_VECTOR overview example - #297
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
florinutz
left a comment
There was a problem hiding this comment.
thank you! I have some comments
| change, the :ref:`UPDATE <crate-reference:dml-updating-data>` statement | ||
| sent to CrateDB will include all of the ``ObjectArray`` data. | ||
|
|
||
| .. _floatvector: |
There was a problem hiding this comment.
this example needs a link to its anchor, right?
| Values can be supplied as lists of floating-point numbers. To find nearby | ||
| vectors, use ``knn_match`` in a query: | ||
|
|
||
| >>> item = SearchIndex(name='example', embedding=[1.0, 2.0, 3.0]) |
There was a problem hiding this comment.
I think you need numpy the moment you save a vector, even if you handed it an ordinary list. If so, would be maybe nice to mention it (the [vector] extra) somewhere.
| >>> item = SearchIndex(name='example', embedding=[1.0, 2.0, 3.0]) | ||
| >>> session.add(item) | ||
| >>> session.commit() | ||
| >>> query = session.query(SearchIndex.name).filter( |
There was a problem hiding this comment.
what about the results here? probably needs a REFRESH TABLE if you get [] results without it.
| ... knn_match(SearchIndex.embedding, [1.0, 2.0, 2.9], 10) | ||
| ... ) | ||
|
|
||
| See the :doc:`vector type guide <working-with-types>` for a complete example, |
There was a problem hiding this comment.
please add an anchor for vectors in the target page, and link to the anchor
ea5fa31 to
25ac4cf
Compare
|
Replacement PR: #298 During follow-up, an amend in a shallow clone briefly disconnected this source branch, causing GitHub to auto-close the PR. I rebuilt the change from current upstream main on a fresh branch, preserved the reviewed changes, applied the requested follow-ups, and reran validation. Apologies for the disruption. |
Fixes #190
Adds a focused
FloatVectorexample to the feature overview showing how to define an embedding column, store a vector, and build aknn_matchquery. It also links to the complete vector guide and updates the extension-type introduction so it no longer implies the dialect has only two extension types.Testing
make htmlmake linkcheckgit diff --check