Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-37816

FTS - Adapt the From/Size checks to benefit from the search_after/before paginations

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Not a Bug
    • 6.5.1, 6.6.0
    • 7.0.0
    • fts

    Description

      With the rigid checks around From and Size, we aren't reaping the benefits of exposing the search_after/search_before deeper pagination features. 

      Whenever the search_after/before sort keys are passed in, bleveMaxResultWindow needs to be checked only against the `Size/Limit` as the `From/Offset` part is already skipped under the hood to result in lower memory requirements.

      PR: https://github.com/blevesearch/bleve/pull/1182

      The new SearchRequest ..

        type SearchRequest struct {
      	Q                json.RawMessage         `json:"query"`
      	Size             *int                    `json:"size"`
      	From             *int                    `json:"from"`
      	Highlight        *bleve.HighlightRequest `json:"highlight"`
      	Fields           []string                `json:"fields"`
      	Facets           bleve.FacetsRequest     `json:"facets"`
      	Explain          bool                    `json:"explain"`
      	Sort             []json.RawMessage       `json:"sort"`
      	IncludeLocations bool                    `json:"includeLocations"`
      	Score            string                  `json:"score,omitempty"`
      	SearchAfter      []string                `json:"search_after,omitempty"`
      	SearchBefore     []string                `json:"search_before,omitempty"`
      	Limit            *int                    `json:"limit,omitempty"`
      	Offset           *int                    `json:"offset,omitempty"`
      	Collections      []string                `json:"collections,omitempty"`
      }

      More details in the description here: https://issues.couchbase.com/browse/CBD-3580

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          Build couchbase-server-7.0.0-2941 contains cbft commit 6c5eb4a with commit message:
          MB-37816 - Fix bleveMaxResultWindow checks with keyset pagination

          build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-2941 contains cbft commit 6c5eb4a with commit message: MB-37816 - Fix bleveMaxResultWindow checks with keyset pagination
          keshav Keshav Murthy added a comment - FYI:  spec:  https://docs.google.com/document/d/1mhcUDdeC6jzPXBBKzxTruqNcDnmjLp3n7VpcX51c2_0/edit?usp=sharing

          People

            Sreekanth Sivasankaran Sreekanth Sivasankaran
            Sreekanth Sivasankaran Sreekanth Sivasankaran
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty