Skip to content

Commit

Permalink
Remove refs to pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
frascuchon committed May 31, 2023
1 parent da9d842 commit 791d036
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/argilla/server/search_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class SearchResponseItem:
@dataclasses.dataclass
class SearchResponses:
items: List[SearchResponseItem]
next_page_token: Any


@dataclasses.dataclass
Expand Down Expand Up @@ -158,7 +157,6 @@ async def search(
query: Union[Query, str],
user_response_status_filter: Optional[UserResponseStatusFilter] = None,
limit: int = 100,
next_page_token: Optional[str] = None,
) -> SearchResponses:
# See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html

Expand Down Expand Up @@ -198,7 +196,8 @@ async def search(
"query": {"bool": bool_query},
"sort": ["_score", {"id": "asc"}],
}

# TODO: Work on search pagination after endpoint integration
next_page_token = None
if next_page_token:
# See https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html
body["search_after"] = next_page_token
Expand All @@ -212,7 +211,7 @@ async def search(
# See https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html
next_page_token = hit.get("_sort")

return SearchResponses(items=items, next_page_token=next_page_token)
return SearchResponses(items=items)

def _field_mapping_for_question(self, question: Question):
settings = question.parsed_settings
Expand Down

0 comments on commit 791d036

Please sign in to comment.