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

LIKE matches each embedded line in the text against the pattern

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • None
    • 7.0.5
    • fts, query
    • 7.0.5-7658
    • Untriaged
    • 0
    • Unknown

    Description

      I have 3 nodes(though I think one node is sufficient to see this behavior):
      1 kv
      1 fts
      1 kv,n1ql,fts,index

      create a default bucket
      load the data from backup
      create default fts index with keyword analyzer - default_index

      {
        "type": "fulltext-index",
        "name": "default_index",
        "uuid": "7787eb19257228b6",
        "sourceType": "gocbcore",
        "sourceName": "default",
        "sourceUUID": "df99dd5c8749c3ecc48d62c0d127374c",
        "planParams": {
          "maxPartitionsPerPIndex": 171,
          "numReplicas": 1
        },
        "params": {
          "doc_config": {
            "docid_prefix_delim": "",
            "docid_regexp": "",
            "mode": "type_field",
            "type_field": "type"
          },
          "mapping": {
            "analysis": {},
            "default_analyzer": "keyword",
            "default_datetime_parser": "dateTimeOptional",
            "default_field": "_all",
            "default_mapping": {
              "default_analyzer": "keyword",
              "dynamic": true,
              "enabled": true
            },
            "default_type": "_default",
            "docvalues_dynamic": true,
            "index_dynamic": true,
            "store_dynamic": false,
            "type_field": "type"
          },
          "store": {
            "indexType": "scorch",
            "mossStoreOptions": {},
            "segmentVersion": 15
          }
        },
        "sourceParams": {}
      }
      

      create a primary index
      CREATE PRIMARY INDEX `primary_gsi_index` ON `default`

      run this query
      select meta().id from default USE INDEX (USING FTS, USING GSI) where ( revision.text.`#text` like "H%")
      gets 0 results

      run the same query with no hint
      select meta().id from default where ( revision.text.`#text` like "H%")
      gets 38 results

      explain for flex query

      {
          "#operator": "Sequence",
          "~children": [
              {
                  "#operator": "IndexFtsSearch",
                  "index": "default_index",
                  "index_id": "7787eb19257228b6",
                  "keyspace": "default",
                  "namespace": "default",
                  "search_info": {
                      "field": "\"\"",
                      "options": "{\"index\": \"default_index\"}",
                      "outname": "out",
                      "query": "{\"query\": {\"field\": \"revision.text.#text\", \"inclusive_max\": false, \"inclusive_min\": true, \"max\": \"I\", \"min\": \"H\"}, \"score\": \"none\"}"
                  },
                  "using": "fts"
              },
              {
                  "#operator": "Fetch",
                  "keyspace": "default",
                  "namespace": "default"
              },
              {
                  "#operator": "Parallel",
                  "~child": {
                      "#operator": "Sequence",
                      "~children": [
                          {
                              "#operator": "Filter",
                              "condition": "((((`default`.`revision`).`text`).`#text`) like \"H%\")"
                          },
                          {
                              "#operator": "InitialProject",
                              "result_terms": [
                                  {
                                      "expr": "(meta(`default`).`id`)"
                                  }
                              ]
                          }
                      ]
                  }
              }
          ]
      }
      

      explain for query with no hint

      {
          "#operator": "Sequence",
          "~children": [
              {
                  "#operator": "PrimaryScan3",
                  "index": "primary_gsi_index",
                  "index_projection": {
                      "primary_key": true
                  },
                  "keyspace": "default",
                  "namespace": "default",
                  "using": "gsi"
              },
              {
                  "#operator": "Fetch",
                  "keyspace": "default",
                  "namespace": "default"
              },
              {
                  "#operator": "Parallel",
                  "~child": {
                      "#operator": "Sequence",
                      "~children": [
                          {
                              "#operator": "Filter",
                              "condition": "((((`default`.`revision`).`text`).`#text`) like \"H%\")"
                          },
                          {
                              "#operator": "InitialProject",
                              "result_terms": [
                                  {
                                      "expr": "(meta(`default`).`id`)"
                                  }
                              ]
                          }
                      ]
                  }
              }
          ]
      }
      

      not quite sure whether or not this is a regression because job does not run the same queries every single time. Also this could not be queries fault but some problem in fts, please take an initial look

      Attachments

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

        Activity

          People

            ajay.bhullar Ajay Bhullar
            ajay.bhullar Ajay Bhullar
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty