Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section about the new MeiliDocumentContainer<T> class in readme #356

Closed
ahmednfwela opened this issue Sep 14, 2023 · 0 comments · Fixed by #380
Closed

Add section about the new MeiliDocumentContainer<T> class in readme #356

ahmednfwela opened this issue Sep 14, 2023 · 0 comments · Fixed by #380
Labels
documentation Improvements or additions to documentation

Comments

@ahmednfwela
Copy link
Collaborator

ahmednfwela commented Sep 14, 2023

this PR #350 added MeiliDocumentContainer<T> but its usage is optional.
we need to document to users how to use it, and use it more in the code samples.

to opt-in for it, users need to call mapToContainer() extension methods on search results.

relevant test:

test('vector search', () async {
final vector = [0, 1, 2];
final res = await index
.search(
null,
SearchQuery(
vector: vector,
),
)
.asSearchResult()
.mapToContainer();
expect(res.vector, vector);
expect(
res.hits,
everyElement(
isA<MeiliDocumentContainer<Map<String, dynamic>>>()
.having(
(p0) => p0.vectors,
'vectors',
isNotNull,
)
.having(
(p0) => p0.semanticScore,
'semanticScore',
isNotNull,
),
),
);
});

@brunoocasali brunoocasali added the documentation Improvements or additions to documentation label Sep 14, 2023
@meili-bors meili-bors bot closed this as completed in b8ef30d Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants