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

[FTS] Impossible to do a Boolean field search

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.0.0
    • 4.5.0, 4.5.1
    • fts
    • Untriaged
    • Unknown

    Description

      This was originally asked on the forums:
      https://forums.couchbase.com/t/fts-boolean-field-query-json-api/10030

      It's apparently not possible to perform a Boolean field query today. I verified this on 4.5.0 (build 2601), and I believe Marty checked it on Spock. Once we fix this, it will need a new functional test case.

      To reproduce, see the sample index mapping below that uses the travel-sample bucket.

      This query string query shows that the index works:

      {
        "explain": false,
        "fields": [
          "*"
        ],
        "highlight": {},
        "query": {
          “query": "inn"
        }
      }
      

      This is what the Boolean field query should look like, but I get a syntax error (whether or not I make 'true' a string):

      {
        "explain": false,
        "fields": [
          "vacancy"
        ],
        "highlight": {},
        "query": {
          "bool": true,
          "field": "vacancy",
          "boost": 1.0
        }
      }
      

      Here’s the text index mapping I used for the queries above, which indexes the travel-sample bucket:

      curl -XPUT -H "Content-Type: application/json" \
      http://127.0.0.1:8094/api/index/vacancy \
      -d '{
        "type": "fulltext-index",
        "name": "vacancy",
        "uuid": "1ca69467e262211b",
        "sourceType": "couchbase",
        "sourceName": "travel-sample",
        "sourceUUID": "85812d30ca3e2154bba401c7f794e073",
        "planParams": {
          "maxPartitionsPerPIndex": 32,
          "numReplicas": 0,
          "hierarchyRules": null,
          "nodePlanParams": null,
          "pindexWeights": null,
          "planFrozen": false
        },
        "params": {
          "mapping": {
            "byte_array_converter": "json",
            "default_analyzer": "standard",
            "default_datetime_parser": "dateTimeOptional",
            "default_field": "_all",
            "default_mapping": {
              "display_order": "1",
              "dynamic": true,
              "enabled": false
            },
            "default_type": "_default",
            "index_dynamic": true,
            "store_dynamic": false,
            "type_field": "type",
            "types": {
              "hotel": {
                "display_order": "0",
                "dynamic": false,
                "enabled": true,
                "properties": {
                  "name": {
                    "dynamic": false,
                    "enabled": true,
                    "fields": [
                      {
                        "analyzer": "",
                        "display_order": "0",
                        "include_in_all": true,
                        "include_term_vectors": true,
                        "index": true,
                        "name": "name",
                        "store": true,
                        "type": "text"
                      }
                    ]
                  },
                  "vacancy": {
                    "dynamic": false,
                    "enabled": true,
                    "fields": [
                      {
                        "analyzer": "",
                        "display_order": "1",
                        "include_in_all": true,
                        "include_term_vectors": true,
                        "index": true,
                        "name": "vacancy",
                        "store": true,
                        "type": "boolean"
                      }
                    ]
                  }
                }
              }
            }
          },
          "store": {
            "kvStoreName": "forestdb"
          }
        },
        "sourceParams": {
          "clusterManagerBackoffFactor": 0,
          "clusterManagerSleepInitMS": 0,
          "clusterManagerSleepMaxMS": 2000,
          "dataManagerBackoffFactor": 0,
          "dataManagerSleepInitMS": 0,
          "dataManagerSleepMaxMS": 2000,
          "feedBufferAckThreshold": 0,
          "feedBufferSizeBytes": 0
        }
      }'
      

      Attachments

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

        Activity

          People

            apiravi Aruna Piravi (Inactive)
            will.gardella Will Gardella (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty