mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
enable string syntax for the filters
This commit is contained in:
parent
a717925caa
commit
b192cb9c1f
2 changed files with 37 additions and 32 deletions
|
@ -2,6 +2,7 @@ use std::collections::HashSet;
|
|||
use std::convert::{TryFrom, TryInto};
|
||||
|
||||
use actix_web::{get, post, web, HttpResponse};
|
||||
use serde_json::Value;
|
||||
use serde::Deserialize;
|
||||
|
||||
use crate::error::ResponseError;
|
||||
|
@ -50,7 +51,12 @@ impl TryFrom<SearchQueryGet> for SearchQuery {
|
|||
.map(|attrs| attrs.split(',').map(String::from).collect::<Vec<_>>());
|
||||
|
||||
let filter = match other.filter {
|
||||
Some(ref f) => Some(serde_json::from_str(f)?),
|
||||
Some(f) => {
|
||||
match serde_json::from_str(&f) {
|
||||
Ok(v) => Some(v),
|
||||
_ => Some(Value::String(f)),
|
||||
}
|
||||
},
|
||||
None => None,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue