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

Search API response on error should be structured for UI to display

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 7.6.4
    • 7.6.2
    • fts
    • None
    • dev
    • Untriaged
    • 0
    • Unknown

    Description

      This is to track BE API update request on Search

      It should be better structured for UI as UI cannot have validations for all possible scenarios.
      example below

      1. When Bucket name is passed wrong from UI
      "error": "rest_create_index: error creating index: highlight, err: manager_api: CreateIndex, Prepare failed, err: collection_utils: collection: 'airline1' doesn't belong to scope: 'inventory' in bucket: 'travel-sample'",

      2. When request body is for Vector index, but CB version yet not support it.
      "error": "rest_auth: preparePerms, err: unmarshalerDecoder: field mapping contains invalid keys: [similarity vector_index_optimized_for dims], error found in #10 byte of ...|xt\"}]}}}}}|..., bigger context ...|ue,\"name\":\"text\",\"store\":true,\"type\":\"text\"}]}}}}}|...",

      It would be helpful if we return user-readable messages for UI to display

      API
      https://api.dev.nonprod-project-avengers.com/v2/databases/275abac0-f979-494e-b821-ecdc4bf21ae5/proxy/_p/fts/api/index/pdf_search

      RESPONSE

      { "error": "rest_auth: preparePerms, err: unmarshalerDecoder: field mapping contains invalid keys: [similarity vector_index_optimized_for dims], error found in #10 byte of ...|xt\"}

      ]}}}}}|..., bigger context ...|ue,\"name\":\"text\",\"store\":true,\"type\":\"text\"}]}}}}}|...",
      "request": {
      "name": "pdf_search",
      "params": {
      "doc_config":

      { "docid_prefix_delim": "", "docid_regexp": "", "mode": "scope.collection.type_field", "type_field": "type" }

      ,
      "mapping": {
      "default_analyzer": "standard",
      "default_datetime_parser": "dateTimeOptional",
      "default_field": "_all",
      "default_mapping":

      { "dynamic": true, "enabled": false }

      ,
      "default_type": "_default",
      "docvalues_dynamic": false,
      "index_dynamic": true,
      "store_dynamic": false,
      "type_field": "_type",
      "types": {
      "inventory.airline123": {
      "dynamic": true,
      "enabled": true,
      "properties": {
      "embedding": {
      "dynamic": false,
      "enabled": true,
      "fields": [

      { "dims": 1536, "index": true, "name": "embedding", "similarity": "dot_product", "type": "vector", "vector_index_optimized_for": "recall" }

      ]
      },
      "text": {
      "dynamic": false,
      "enabled": true,
      "fields": [

      { "index": true, "name": "text", "store": true, "type": "text" }

      ]
      }
      }
      }
      }
      },
      "store":

      { "indexType": "scorch", "segmentVersion": 16 }

      },
      "planParams":

      { "indexPartitions": 16, "maxPartitionsPerPIndex": 64, "numReplicas": 0 }

      ,
      "sourceName": "travel-sample",
      "sourceParams": {},
      "sourceType": "couchbase",
      "type": "fulltext-index"
      },
      "status": "fail"
      }

      Attachments

        Issue Links

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

          Activity

            People

              Pramada.Kolichala Pramada Kolichala
              aashish.kumar Aashish Kumar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty