Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Check if field in vector query is indexed

ozanarmagan910cedef4b9a
diff --git a/src/collection.cpp b/src/collection.cpp
index 00fae63f..1afef53a 100644
--- a/src/collection.cpp
+++ b/src/collection.cpp
@@ -1260,6 +1260,10 @@ Option<nlohmann::json> Collection::search(std::string raw_query,
return Option<nlohmann::json>(400, "Field `" + vector_query.field_name + "` does not have a vector query index.");
}
+ if(!vector_field_it.value().index) {
+ return Option<nlohmann::json>(400, "Field `" + vector_query.field_name + "` is marked as a non-indexed field in the schema.");
+ }
+
if(is_wildcard_query) {
if(vector_query.values.empty() && !vector_query.query_doc_given) {
// for usability we will treat this as non-vector query