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

Change response status code for non-indexed field search

Brian Weeteling8c6c8d08d770
diff --git a/src/collection.cpp b/src/collection.cpp
index 56e29282..443a96ef 100644
--- a/src/collection.cpp
+++ b/src/collection.cpp
@@ -569,7 +569,7 @@ Option<nlohmann::json> Collection::search(const std::string & raw_query, const s
if(!search_field.index) {
std::string error = "Field `" + field_name + "` is marked as a non-indexed field in the schema.";
- return Option<nlohmann::json>(404, error);
+ return Option<nlohmann::json>(400, error);
}
if(search_field.type != field_types::STRING && search_field.type != field_types::STRING_ARRAY) {