Merge pull request #550 from brianweet/fix/non-indexed-field-search

Change response status code for non-indexed field search
This commit is contained in:
Kishore Nallan 2022-03-16 11:44:34 +05:30 committed by GitHub
commit e696f7299e

View File

@ -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) {