Comments (3)
This is not a bug. When you search with Meilisearch's client it will return the SearchResults
wrapper around whatever document model you are using for your documents (in this case, you are using crate::models::Posting
).
SearchResults is just the response object with the details for the search result (i.e. how many hits or results were returned, in what page you are in case that you are using pagination, etc.) and it's obviously not meant to be exposed to the user, hence why I guess it doesn't implement Serialize. It's the API telling you that you are doing something wrong.
In your case, I would just extract the hits from it and send the response to the consumer of the /search-test
endpoint.
from meilisearch-rust.
What is the solutions for this case?
from meilisearch-rust.
What is the solutions for this case?
The solution is entirely dependent on what you WANT the API to return.
Example:
- do you want the formatted or unformatted resutlt?
- do you want where the search matches
- What other statisitcs (facets, paging, ) do you want?
I would say that adding your own struct for these return types is better because then you will get notified earlier (via compilation errors) of any changes you will need to migrate around.
from meilisearch-rust.
Related Issues (20)
- Ensure the error handling are following the best practice HOT 1
- Add CodeCov HOT 2
- Quotation marks in primary silently fails entire `index.add_document` call. HOT 3
- [v1.4] Support text-separator customization
- [v1.4] Support user-dictionary loading HOT 1
- Library seems unusable on MacOS 14.0 HOT 1
- Index::add_documents_csv panics when File streaming HOT 2
- [v1.5] Add a new method for creating snapshots
- [v1.6] Support `proximityPrecision` setting
- [v1.6] support `embedders` setting HOT 3
- The X-MEILI-API-KEY header is missing. Please update the SDK HOT 1
- [v.1.7] Able to use `showRankingScoreDetails` parameter at search
- Streaming in wasm doesn’t work
- Performances: Stop initializing large vector that we’re not going to read
- Updated meilisearch_sdk::errors::Error is no longer Send HOT 3
- Unwrap causes panic instead of handling the Result HOT 2
- Implement `std::marker::Send` for SearchResults HOT 4
- http panic in wasm due to capitalized header name HOT 2
- [v1.8] Support `searchCutoffMs` setting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meilisearch-rust.