mirror of
https://github.com/qdrant/qdrant.git
synced 2026-10-03 11:27:37 -05:00
separate payload and vector index bases
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
pub mod field_index;
|
||||
pub mod hnsw_index;
|
||||
mod index_base;
|
||||
mod vector_index_base;
|
||||
mod payload_index_base;
|
||||
mod key_encoding;
|
||||
mod payload_config;
|
||||
pub mod plain_payload_index;
|
||||
@@ -10,4 +11,5 @@ mod sample_estimation;
|
||||
mod struct_filter_context;
|
||||
pub mod struct_payload_index;
|
||||
mod visited_pool;
|
||||
pub use index_base::*;
|
||||
pub use vector_index_base::*;
|
||||
pub use payload_index_base::*;
|
||||
|
||||
@@ -1,39 +1,16 @@
|
||||
use std::collections::HashMap;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::atomic::AtomicBool;
|
||||
|
||||
use serde_json::Value;
|
||||
|
||||
use crate::common::Flusher;
|
||||
use crate::data_types::vectors::VectorElementType;
|
||||
use crate::entry::entry_point::OperationResult;
|
||||
use crate::index::field_index::{CardinalityEstimation, PayloadBlockCondition};
|
||||
use crate::payload_storage::FilterContext;
|
||||
use crate::telemetry::VectorIndexSearchesTelemetry;
|
||||
use crate::types::{
|
||||
Filter, Payload, PayloadFieldSchema, PayloadKeyType, PayloadKeyTypeRef, PayloadSchemaType,
|
||||
PointOffsetType, SearchParams,
|
||||
PointOffsetType,
|
||||
};
|
||||
use crate::vector_storage::ScoredPointOffset;
|
||||
|
||||
/// Trait for vector searching
|
||||
pub trait VectorIndex {
|
||||
/// Return list of Ids with fitting
|
||||
fn search(
|
||||
&self,
|
||||
vectors: &[&[VectorElementType]],
|
||||
filter: Option<&Filter>,
|
||||
top: usize,
|
||||
params: Option<&SearchParams>,
|
||||
) -> Vec<Vec<ScoredPointOffset>>;
|
||||
|
||||
/// Force internal index rebuild.
|
||||
fn build_index(&mut self, stopped: &AtomicBool) -> OperationResult<()>;
|
||||
|
||||
fn get_telemetry_data(&self) -> VectorIndexSearchesTelemetry;
|
||||
|
||||
fn files(&self) -> Vec<PathBuf>;
|
||||
}
|
||||
|
||||
pub trait PayloadIndex {
|
||||
/// Get indexed fields
|
||||
@@ -110,5 +87,3 @@ pub trait PayloadIndex {
|
||||
|
||||
fn files(&self) -> Vec<PathBuf>;
|
||||
}
|
||||
|
||||
pub type VectorIndexSS = dyn VectorIndex + Sync + Send;
|
||||
@@ -0,0 +1,31 @@
|
||||
use std::path::PathBuf;
|
||||
use std::sync::atomic::AtomicBool;
|
||||
|
||||
use crate::data_types::vectors::VectorElementType;
|
||||
use crate::entry::entry_point::OperationResult;
|
||||
use crate::telemetry::VectorIndexSearchesTelemetry;
|
||||
use crate::types::{
|
||||
Filter, SearchParams,
|
||||
};
|
||||
use crate::vector_storage::ScoredPointOffset;
|
||||
|
||||
/// Trait for vector searching
|
||||
pub trait VectorIndex {
|
||||
/// Return list of Ids with fitting
|
||||
fn search(
|
||||
&self,
|
||||
vectors: &[&[VectorElementType]],
|
||||
filter: Option<&Filter>,
|
||||
top: usize,
|
||||
params: Option<&SearchParams>,
|
||||
) -> Vec<Vec<ScoredPointOffset>>;
|
||||
|
||||
/// Force internal index rebuild.
|
||||
fn build_index(&mut self, stopped: &AtomicBool) -> OperationResult<()>;
|
||||
|
||||
fn get_telemetry_data(&self) -> VectorIndexSearchesTelemetry;
|
||||
|
||||
fn files(&self) -> Vec<PathBuf>;
|
||||
}
|
||||
|
||||
pub type VectorIndexSS = dyn VectorIndex + Sync + Send;
|
||||
Reference in New Issue
Block a user