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

[FTS] Document mapping's analyzer not inherited by child fields

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Unknown

    Description

      Build : 7.0.0-1834

      On the travel-sample dataset, created an FTS index with default mapping and analyzer=keyword. This index was on 3 fields - city, name and type - all strings with analyzer inherited. The Overall default analyzer for the index is Standard. So expecting the fields would have keyword analyzer as that is the one it would inherit. The index definition is attached.

      Now running a query like the below one doesnt return any results even though the above index is used. See the plan as well.

      select name from `travel-sample` use index(using fts) where city="San Jose" and name="San Jose Municipal Rose Garden";
       
      {
        "#operator": "Authorize",
        "#stats": {
          "#phaseSwitches": 4,
          "execTime": "8.377µs",
          "servTime": "4.914979ms"
        },
        "privileges": {
          "List": [
            {
              "Target": "default:travel-sample",
              "Priv": 7
            }
          ]
        },
        "~child": {
          "#operator": "Sequence",
          "#stats": {
            "#phaseSwitches": 1,
            "execTime": "8.293µs"
          },
          "~children": [
            {
              "#operator": "IndexFtsSearch",
              "#stats": {
                "#phaseSwitches": 3,
                "execTime": "26.715µs",
                "servTime": "3.13043ms"
              },
              "index": "def_city_name_type",
              "index_id": "1b27030adce0e0b3",
              "keyspace": "travel-sample",
              "namespace": "default",
              "search_info": {
                "field": "\"\"",
                "options": "{\"index\": \"def_city_name_type\"}",
                "outname": "out",
                "query": "{\"query\": {\"conjuncts\": [{\"field\": \"city\", \"term\": \"San Jose\"}, {\"field\": \"name\", \"term\": \"San Jose Municipal Rose Garden\"}]}, \"score\": \"none\"}"
              },
              "using": "fts",
              "#time_normal": "00:00.003",
              "#time_absolute": 0.003157145
            },
            {
              "#operator": "Fetch",
              "#stats": {
                "#phaseSwitches": 4,
                "execTime": "20.125µs",
                "kernTime": "3.16398ms"
              },
              "keyspace": "travel-sample",
              "namespace": "default",
              "#time_normal": "00:00.000",
              "#time_absolute": 0.000020125
            },
            {
              "#operator": "Sequence",
              "#stats": {
                "#phaseSwitches": 1,
                "execTime": "4.759µs"
              },
              "~children": [
                {
                  "#operator": "Filter",
                  "#stats": {
                    "#phaseSwitches": 4,
                    "execTime": "26.132µs",
                    "kernTime": "3.192025ms"
                  },
                  "condition": "(((`travel-sample`.`city`) = \"San Jose\") and ((`travel-sample`.`name`) = \"San Jose Municipal Rose Garden\"))",
                  "#time_normal": "00:00.000",
                  "#time_absolute": 0.000026132
                },
                {
                  "#operator": "InitialProject",
                  "#stats": {
                    "#phaseSwitches": 4,
                    "execTime": "5.497µs",
                    "kernTime": "3.226259ms"
                  },
                  "result_terms": [
                    {
                      "expr": "(`travel-sample`.`name`)"
                    }
                  ],
                  "#time_normal": "00:00.000",
                  "#time_absolute": 0.000005497
                }
              ],
              "#time_normal": "00:00.000",
              "#time_absolute": 0.0000047590000000000005
            },
            {
              "#operator": "Stream",
              "#stats": {
                "#phaseSwitches": 4,
                "execTime": "6.202µs",
                "kernTime": "3.241149ms"
              },
              "#time_normal": "00:00.000",
              "#time_absolute": 0.000006202
            }
          ],
          "#time_normal": "00:00.000",
          "#time_absolute": 0.000008293
        },
        "~versions": [
          "7.0.0-N1QL",
          "7.0.0-1834-enterprise"
        ],
        "#time_normal": "00:00.004",
        "#time_absolute": 0.004923356
      }
      

      The same query with GSI primary index returns one result -

      select name from `travel-sample`  where city="San Jose" and name="San Jose Municipal Rose Garden";
       
      [
        {
          "name": "San Jose Municipal Rose Garden"
        }
      ]
      

      Attachments

        Issue Links

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

          Activity

            People

              abhinav Abhi Dangeti
              mihir.kamdar Mihir Kamdar (Inactive)
              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