[pdm-devel] [PATCH datacenter-manager v3 3/9] server: api: resources: add more complex filter syntax

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Aug 27 22:15:52 CEST 2025


On 27/08/2025 11:33, Stefan Hanreich wrote:
> On 8/27/25 11:16 AM, Lukas Wagner wrote:
> 
> [snip]
> 
>>> +fn remote_matches_search_term(remote_name: &str, online: Option<bool>, term: &SearchTerm) -> bool {
>>> +    match term.category.as_deref() {
>>> +        Some("remote" | "name" | "id") => remote_name.contains(&term.value),
>>> +        Some("type") => "remote".contains(&term.value),
>>
>> This is IMO a bit odd, since this would allow you to write something
>> like
>>    
>>    type:e
>>
>> and still get type:remote matches, since e is contained in 'remote'.
>>
>> I think for some of these I would only allow a full match, 'type' and
>> 'status' comes to mind at a quick glance (for status online, on,
>> offline, off) could be allowed values)
>>
> 
> maybe a prefix match is a good compromise? that way one can start typing
> 'type:remo' and get the results early without having to type out the
> full status / type /...

I think that would be a good compromise for now, that should be relatively
easy to grasp and still give some benefits.




More information about the pdm-devel mailing list