Skip to content

[Feature]: Implement a total number of results cursor when using structured search. #1344

@pboers1988

Description

@pboers1988

Contact Details

No response

What should we build?

In the case of structured search we should be able to calculate a total number of pages and documents. Please add this to the api endpoints.

DO NOT calculate results if the "query" parameter is passed to the api call

  • What value for query if no results?
  • What value for query if not structured search

Relevant pseudo code

{
  "filters": {
    "children": [
      {
        "condition": {
          "op": "eq",
          "value": "active"
        },
        "path": "subscription.status"
      },
      {
        "condition": {
          "op": "gt",
          "value": "2021-01-01"
        },
        "path": "subscription.start_date"
      }
    ],
    "description": "Simple filters",
    "op": "AND"
  },
  "query": "string",  <---- do not calculate the results if len(s) > 0
  "limit": 10,
  "order_by": {
      "element": "subscription.product.type",
      "direction": "ASC/DESC"
   }
}

Add the following to the response object

"cursor": {
    "total_items": 100,
    "start_cursor": 10,
    "end_cursor": 50
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    SURFfeatureRequest for new featuretriageIssue that need to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions