เอกสารในห้องสมุดของฉัน

แถบด้านข้างหลายราก

flex-layout

  • Getting Started

  • Guides

  • Reference

typed-rx-http

  • Getting Started

  • Guides

  • Reference

global-rx-state

  • Getting Started

  • Guides

  • Reference

webflux-fe-dev-assistant

reactive-mongo-dsl

Vector Search

อธิบายการค้นหา Vector ด้วย query manual/Automated Embedding, ANN/ENN, pre/post filter, ตัวเลือก nested vector ของ Driver 5.10 และเส้นทางการขยาย Bson.


การค้นหา Vector พื้นฐาน.
java

การค้นหา Vector ต้องการชื่อดัชนีที่ชัดเจนและ $vectorSearch จะเป็น stage แรกของการรวม.

Query vector / Automated Embedding.

queryVector(float[]/double[]/Collection<Double>)

ส่งเวกเตอร์ที่สร้างโดยแอปพลิเคชัน.

queryVector(BinaryVector).

ใช้การแสดงผลเวกเตอร์ไบนารีที่กระชับของ MongoDB Driver โดยตรง.

query(String).

ส่ง query text เองไปยังดัชนี Automated Embedding ของ MongoDB.

query(VectorSearchQuery).

เป็น escape hatch ที่เข้ากันได้ในอนาคตสำหรับการส่งประเภท query ที่เป็น native ของ Driver โดยตรง.

java

ฟังก์ชันที่ให้ DSL core เรียกผู้ให้บริการ embedding ภายนอกเพื่อสร้างเวกเตอร์ไม่ได้รวมอยู่ด้วย เวกเตอร์แบบ manual จะถูกสร้างโดยแอปพลิเคชันที่เรียกและส่งไปยัง queryVector(...).

ANN / ENN.

ANN.

ใช้ approximate(numCandidates) หรือ numCandidates(...) ใน ANN ต้องการจำนวนผู้สมัคร.

ENN.

ใช้ exact() หรือ exact(true) เมื่อเปิดใช้งาน exact ค่าของ numCandidates ที่มีอยู่จะถูกลบออก.

Pre-filter / post-filter.
java

filter()/filterFields().

เป็น pre-filter ที่ส่งผลต่อการเลือกผู้สมัครเองใน $vectorSearch.filter.

fields(...).

post-filter ทั่วไปหลัง $vectorSearch คือ $match.

การฝังซ้อน/อาร์เรย์ (Driver 5.10).
java

filter / filterFields.

filter ของเอกสารใบปลิวใน nested embedding.

parentFilter / parentFilterFields.

parentFilter ที่ใช้กับเอกสารหลักใน Driver 5.10

nestedScoreMode

รวมคะแนน embedding ที่ตรงกันหลายคะแนนของเอกสารหนึ่งด้วย AVG หรือ MAX

Score / projection / terminal
java

findAll / find

ส่งคืนผลลัพธ์เวกเตอร์เป็น Flux/Mono

count().execute()

นับจำนวนผลลัพธ์ของ pipeline หลังจากเวกเตอร์ลิมิต ไม่ใช่จำนวนทั้งหมดของ corpus

existsQuery().execute()

ตรวจสอบว่ามีผลลัพธ์ของ pipeline เวกเตอร์หรือไม่

Driver-native post stage / options
java

stage(Bson) จะถูกเรียกใช้ก่อนหลังจาก $vectorSearch และก่อน post-filter/metadata/projection driverOptions(...) เป็น escape hatch ที่สามารถใช้ตัวเลือก Driver ปัจจุบัน/อนาคตที่ยังไม่มีใน convenience API ได้