Commit 9522559
committed
feat: add generic search client traits and adapters
Introduce a family of search client traits with blanket implementations
and adapter utilities to reduce boilerplate across backends.
New traits
----------
- ItemsClient: single-page item search (search required); defaults: item, items
- StreamItemsClient: streaming items across pages (search_stream required);
defaults: collect_items, item_count, items_stream
- CollectionsClient: fetch all collections (collections required);
default: collection point-lookup
- PagedCollectionsClient: cursor-paginated collections (collections_page required)
for future backends that support paginated /collections
- StreamCollectionsClient: streaming collections (collections_stream required);
default: collect_collections
- ArrowItemsClient (geoarrow feature): Arrow record batch output
(search_to_arrow required); default: items_to_arrow
- TransactionClient: write operations
Blanket implementations
-----------------------
- CollectionsClient + Clone + Sync -> StreamCollectionsClient (eager fetch)
- ArrowItemsClient + Sync -> ItemsClient + StreamItemsClient (geoarrow feature)
Adapter utilities
-----------------
- PagedItemsStream<T>: wraps ItemsClient to provide StreamItemsClient via
token/skip pagination using ItemCollection::next
- stream_pages_generic: free function driving the pagination loop
- stream_pages_collections_generic: collections equivalent for
PagedCollectionsClient backends
- RecordBatchReaderAdapter<I> (geoarrow feature): bridges any
Iterator<Item = Result<RecordBatch, E>> to arrow_array::RecordBatchReader
Documentation
-------------
Add docs/search-clients.md covering the trait family, blanket impls, adapter
conversion chart, pagination mechanics, and performance notes.1 parent 6442b7e commit 9522559
17 files changed
Lines changed: 1355 additions & 121 deletions
File tree
- crates
- core
- src/api
- duckdb
- src
- io/src
- pgstac/src
- server
- src
- backend
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| |||
0 commit comments