Skip to content
This repository has been archived by the owner on May 29, 2018. It is now read-only.

Add fields needed for search pagination #68

Merged
merged 6 commits into from
Oct 6, 2015
Merged

Conversation

renfredxh
Copy link
Contributor

This commit adds a few fields and methods that will make pagination for search easier:

  • "Total" field on the ListResponse struct.This is an optional field that specifies the total number of results in the list that the list response represents. This can be used to determine the total number of pages as well.
  • "ListResponse" field in DefList. This embeds ListResponse in DefList, so it can use it's fields for pagination. RefList already does this in the same way.
  • "List Response" field in VCSSearchResultsList, for the same reasons above.
  • New methods "SearchTokens" and "SearchText", made with the intention of breaking up the now-deprecated monolithic "Search" method for flexibility and simplicity.

@dmitshur
Copy link
Contributor

dmitshur commented Oct 1, 2015

Changes LGTM. We'll want to review this in a higher level context as well.

This is the beginning of a multi-step plan to breakup the monolithic
Search.Search method. There will be a specific search method for each
result type that is accessible though Search.Search, and as a result Search.Search is now deprecated and will be removed when it is no longer needed. There is also a specific options type for each Search method, but they may be unified in the future if appropriate.
@@ -2481,12 +2498,28 @@ service RepoTree {
// API.
service Search {
// Search searches the full index.
// This method is deprecated (use one of the more specific
// search methods below)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[hound-mode] Spaces vs. tabs issue here. [/hound-mode] :P

@@ -2481,12 +2498,28 @@ service RepoTree {
// API.
service Search {
// Search searches the full index.
// This method is deprecated (use one of the more specific
// search methods below)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the Go style for deprecation. Make the first word of the sentence "Deprecated". E.g.:

// Deprecated: use one of the more specific search methods below.

@dmitshur
Copy link
Contributor

dmitshur commented Oct 3, 2015

One comment about deprecation convention. Otherwise LGTM.

renfredxh added a commit that referenced this pull request Oct 6, 2015
Add fields needed for search pagination
@renfredxh renfredxh merged commit 96d5770 into nodb Oct 6, 2015
@renfredxh renfredxh deleted the nodb-def-pagination branch October 6, 2015 02:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants