Skip to content

Commit

Permalink
refactor: update examples in README for search result types
Browse files Browse the repository at this point in the history
Updated README examples to use correct SearchResult and SearchResultPaginated types for clarity and accuracy.
  • Loading branch information
samuele ruffino committed Feb 21, 2025
1 parent ffd4be0 commit f01b153
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,10 @@ All the supported options are described in the [search parameters](https://www.m

```java
import com.meilisearch.sdk.SearchRequest;
import com.meilisearch.sdk.Searchable;

// ...

Searchable results = (SearchResult) orderIndex.search(
SearchResult results = (SearchResult) orderIndex.search(
new SearchRequest("of")
.setShowMatchesPosition(true)
.setAttributesToHighlight(new String[]{"title"})
Expand Down Expand Up @@ -220,7 +219,11 @@ index.search(
#### Custom Search With Pagination <!-- omit in toc -->

```java
index.search(
import com.meilisearch.sdk.Searchable;

// ...

SearchResultPaginated results = (SearchResultPaginated) index.search(
new SearchRequest("wonder")
.setPage(1)
.setHitsPerPage(20)
Expand Down

0 comments on commit f01b153

Please sign in to comment.