diff --git a/CHANGELOG.md b/CHANGELOG.md index fba5dd4f3..eb24de051 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ See [STATUS.md](server/STATUS.md) to learn more about which features will remain ## UNRELEASED - Remove `tpf` queries from `atomic-cli` #610 +- Fix `pageSize` property in Collections not using persistence ## [v0.34.2] - 2023-03-04 diff --git a/lib/src/client.rs b/lib/src/client.rs index 6250c64c0..650493914 100644 --- a/lib/src/client.rs +++ b/lib/src/client.rs @@ -1,6 +1,4 @@ //! Functions for interacting with an Atomic Server -use url::Url; - use crate::{ agents::Agent, commit::sign_message, diff --git a/lib/src/collections.rs b/lib/src/collections.rs index 133b8c1c9..0df9751f6 100644 --- a/lib/src/collections.rs +++ b/lib/src/collections.rs @@ -340,6 +340,9 @@ pub fn construct_collection_from_params( if let Ok(val) = resource.get(urls::COLLECTION_PROPERTY) { property = Some(val.to_string()); } + if let Ok(val) = resource.get(urls::COLLECTION_PAGE_SIZE) { + page_size = val.to_int()?.try_into().unwrap_or(DEFAULT_PAGE_SIZE); + } if let Ok(val) = resource.get(urls::COLLECTION_VALUE) { value = Some(val.to_string()); } diff --git a/server/src/handlers/search.rs b/server/src/handlers/search.rs index e5f1f4e9c..8525fa6ff 100644 --- a/server/src/handlers/search.rs +++ b/server/src/handlers/search.rs @@ -32,8 +32,10 @@ pub struct SearchQuery { pub limit: Option, /// Only include resources that have this resource as its ancestor pub parent: Option, - /// Filter based on props, using tantivy QueryParser syntax - pub filter: Option, + /// Filter based on props, using tantivy QueryParser syntax. + /// e.g. `prop:val` or `prop:val~1` or `prop:val~1 AND prop2:val2` + /// See https://docs.rs/tantivy/latest/tantivy/query/struct.QueryParser.html + pub filters: Option, } const DEFAULT_RETURN_LIMIT: usize = 30; @@ -160,7 +162,7 @@ fn query_from_params( query_list.push((Occur::Must, Box::new(text_query))); } - if let Some(filter) = ¶ms.filter { + if let Some(filter) = ¶ms.filters { let filter_query = BoostQuery::new( build_filter_query(fields, filter, &appstate.search_state.index)?, 20.0,