• Couchbase
  • Couchbase Documentation Couchbase Documentation
  • Server
  • Mobile
  • SDKs
Downloads Start Free Trial
Navigation
Server
  • Couchbase Server
    • Introduction
      • Why Couchbase?
      • What’s New?
      • Developer Preview Mode
    • Get Started
      • Start Here!
      • Do a Quick Install
      • Explore the Server Configuration
      • Run Your First N1QL Query
      • Choose Your Next Steps
    • Learn
      • Overview
        • Glossary
        • List of Architecture Diagrams
      • Data
        • Data Model
        • N1QL versus SQL
        • Extended Attributes
        • Scopes and Collections
        • Indexes
        • Durability
        • Expiration
        • Transactions
      • Buckets, Memory, and Storage
        • Buckets
          • vBuckets
          • Compression
        • Memory and Storage
          • Memory
          • Storage
      • Services
        • Data Service
        • Query Service
        • Index Service
        • Search Service
        • Analytics Service
        • Eventing Service
        • Backup Service
      • Clusters and Availability
        • Cluster Manager
        • Metadata Management
        • Connectivity
        • Size Limits
        • Nodes
          • Rebalance
          • Removal
          • Failover
            • Graceful
            • Hard
            • Automatic
          • Recovery
          • Node-to-Node Encryption
        • Availability
          • Intra-Cluster Replication
          • Cross Data Center Replication (XDCR)
            • XDCR Advanced Filtering
            • XDCR Conflict Resolution
            • XDCR with Scopes and Collections
          • Server Group Awareness
      • Security
        • Authentication
          • Understanding Authentication
          • Usernames and Passwords
          • Authentication Domains
          • Certificates
        • Authorization
          • Roles
          • Upgrading to RBAC
        • On-the-Wire Security
        • Auditing
        • Encryption
    • Manage
      • Overview
        • Couchbase Web Console
      • Manage Nodes and Clusters
        • Initialize a Node
        • Create a Cluster
        • Add a Node and Rebalance
        • Join a Cluster and Rebalance
        • List Cluster Nodes
        • Remove a Node and Rebalance
        • Fail a Node Over and Rebalance
          • Graceful
          • Hard
        • Recover a Node and Rebalance
        • Manage Node-to-Node Encryption
        • Manage Address Families
      • Manage Buckets
        • Create a Bucket
        • Edit a Bucket
        • Flush a Bucket
        • Drop a Bucket
      • Manage Scopes and Collections
      • Manage Logging
      • Manage Settings
        • General
        • Auto-Compaction
        • Email Alerts
        • Sample Buckets
      • Manage Server Groups
      • Manage XDCR
        • Prepare for XDCR
        • Create a Reference
        • Create a Replication
        • Pause a Replication
        • Resume a Replication
        • Delete a Replication
        • Delete a Reference
        • Secure a Replication
          • Half-Secure
          • Fully Secure
        • Replicate Using Scopes and Collections
        • Filter a Replication
        • Recover Data with XDCR
      • Manage Security
        • Manage Security Settings
        • Manage Users, Groups, and Roles
        • Manage Authentication
          • Configure LDAP
          • Configure saslauthd
          • Configure PAM
          • Manage Certificates
            • Configure Server Certificates
            • Configure Client Certificates
            • Enable Client-Certificate Handling
            • Certificate Rotation
            • Certificate Error Handling
        • Manage On-the-Wire Security
        • Manage Auditing
        • Manage Sessions
        • Manage Console Access
        • Manage System Secrets
        • Manage Connections and Disks
      • Manage Statistics
      • Manage Indexes
      • Import Documents
      • Manage Backup and Restore
        • cbbackupmgr
          • Strategies
          • Tutorial
          • Cloud Backup
          • Archive Layout
          • Network Filesystems
      • Monitor
        • Monitor Queries
        • Monitor Indexes
        • Monitor Clock Drift
      • Troubleshoot
        • Common Errors
        • Core Files
    • Develop
      • Developer’s Intro
      • SDKs
        • Distributed ACID Transactions
        • Field Level Encryption
        • Response Time Observability
      • Starter Kits
      • Query
        • Running Queries
          • N1QL Queries and Results
          • Getting System Information
          • N1QL Error Codes
        • Tutorials
        • Query Tools
          • cbq: The Command Line Shell for N1QL
          • Query Workbench
          • Query Monitoring
          • N1QL Auditing
          • Backfill Support for N1QL
        • Settings and Parameters
        • Using Indexes
          • Index Lifecycle
          • Indexing and Query Performance
          • Covering Indexes
          • Index Scans
          • Index Pushdowns
          • Grouping and Aggregate Pushdown
          • Index Availability
          • Storage Settings
        • Advanced Features
          • Flex Indexes
          • Cost-Based Optimizer
          • N1QL Support for Couchbase Transactions
        • N1QL Language Reference
          • Conventions
          • Reserved Words
          • Data Types
          • Literals
          • Identifiers
          • Operators
            • Arithmetic Operators
            • Collection Operators
            • Comparison Operators
            • Conditional Operators
            • Construction Operators
            • Logical Operators
            • Nested Operators and Expressions
            • String Operators
          • Functions
            • Aggregate Functions
            • Array Functions
            • Bitwise Functions
            • Comparison Functions
            • Conditional Functions for Unknowns
            • Conditional Functions for Numbers
            • Date Functions
            • JSON Functions
            • Miscellaneous Utility Functions
              • ADVISOR Function
              • CURL Function
            • Number Functions
            • Object Functions
            • Pattern-Matching Functions
            • Search Functions
            • String Functions
            • Token Functions
            • Type Functions
            • User-Defined Functions
            • Window Functions
          • Subqueries
            • Correlated Subqueries
            • Examples
          • Boolean Logic
          • Statements
            • ADVISE
            • ALTER INDEX
            • BEGIN TRANSACTION
            • BUILD INDEX
            • COMMIT TRANSACTION
            • CREATE COLLECTION
            • CREATE FUNCTION
            • CREATE INDEX
              • Array Indexing
              • Adaptive Index
              • Indexing Metadata Information
              • Index Partitioning
            • CREATE PRIMARY INDEX
            • CREATE SCOPE
            • DELETE
            • DROP COLLECTION
            • DROP FUNCTION
            • DROP INDEX
            • DROP PRIMARY INDEX
            • DROP SCOPE
            • EXECUTE
            • EXECUTE FUNCTION
            • EXPLAIN
            • GRANT
            • INFER
            • INSERT
            • MERGE
            • PREPARE
            • REVOKE
            • ROLLBACK TRANSACTION
            • SAVEPOINT
            • SELECT
              • SELECT Syntax
              • SELECT Clause
              • WITH Clause
              • FROM Clause
              • USE Clause
              • JOIN Clause
              • NEST Clause
              • UNNEST Clause
              • LET Clause
              • WHERE Clause
              • GROUP BY Clause
              • WINDOW Clause
              • UNION, INTERSECT, and EXCEPT
              • ORDER BY Clause
              • LIMIT Clause
              • OFFSET Clause
            • SET TRANSACTION
            • UPDATE
            • UPDATE STATISTICS
              • Update Statistics for Index Expressions
              • Update Statistics for a Single Index
              • Update Statistics for Multiple Indexes
              • Delete Statistics
            • UPSERT
      • Full Text Search (FTS)
        • FTS Architecture
          • Scatter gather operation
          • Search Service Metrics (REST, gRPC)
          • Ports used by FTS
        • Full Text Indexes
          • Quick Index
          • Type Identifiers
          • Type Mappings
            • Specifying fields for Type Mapping
            • Add a Child Mapping
            • Add a Child Field
              • Field Name
              • Field Type
              • Field Searchable As
              • Analyzer
              • Index
              • Store
              • Include in _all field
              • Include term vectors
              • docvalues
          • Understanding Analyzers
          • Custom filters
          • Date/Time Parsers
          • Advanced
          • Index Replicas
          • Index Type
          • Index Partitioning
          • Creating Index from UI
            • Classic Editor
            • Quick Editor
            • Classic Editor vs Quick Editor
        • Editing/Cloning Full Text Indexes
        • Creating Full Text Aliases
        • Search Full Text Indexes/Aliases
        • Supported Queries
          • Match
          • Match Phrase
          • Term
          • Numeric Range
          • Phrase
          • Geo Spatial
        • Pagination
        • Sorting
        • Scoring
        • Consistency
        • Search Facets
        • Highlighting
        • Searching from UI
          • Query String Syntax
          • Boosting
          • Date Range
          • Escaping
          • Field Scoping
          • Match Phrase
          • Match Query Syntax
          • Numeric Range
        • Searching with CURL/HTTP Requests
          • JSON structure
          • Queries with CURL/HTTP requests
        • Searching with SDK
        • Search Responses
          • Error Information
          • Array Positions
          • Facets
          • Hits
          • Index Partitions
          • Took
          • Search Status Expect
        • Cluster Operations
          • CBFT_ENV_OPTIONS
          • bleveMaxResultWindow
          • bleveMaxClauseCount
          • maxFeedsPerDCPAgent
          • maxConcurrentPartitionMovesPerNode
          • enableVerboseLogging
          • ftsMemoryQuota
          • maxReplicasAllowed
          • slowQueryLogTimeout
      • Eventing
        • Terminology
        • Language Constructs
          • Advanced Bucket Accessors
          • Timers
          • cURL
        • Eventing Lifecycle
        • Buckets vs Collections
        • Examples: Using the Eventing Service
          • Data Enrichment
          • Cascade Delete
          • Document Expiry
          • Delete v Expiry
          • Document Archival
          • Cancel or Overwrite Timer
          • Recurring Timer
          • External REST via cURL GET
          • Risk Assessment
        • Examples: Terse Scriptlets
          • Basic KV Handlers
            • basicBucketOps
            • basicCurlGet
            • basicCurlPost
            • simpleTimer
            • cascadeKvDeleteWithDoc
            • redactSharedData
            • simpleFlatten
            • fixEmailDomains
            • keepLastN
            • docControlledSelfExpiry
            • shippingNotifier
            • ConvertBucketToCollections
          • Basic N1QL Handlers
            • basicN1qlSelectStmt
            • basicN1qlPreparedSelectStmt
          • Generic Manipulation Handlers
            • dateToEpochConversion
            • deepCloneAndModify
            • removeObjectStubs
            • removeNullsAndEmptys
            • genericRename
            • genericFlatten
            • convertXMLtoJSON
            • convertAdvXMLtoJSON
          • Advanced Accessor Handlers
            • advancedGetOp
            • advancedInsertOp
            • advancedUpsertOp
            • advancedReplaceOp
            • advancedDeleteOp
            • advancedIncrementOp
            • advancedDecrementOp
            • advancedKeepLastN
            • advanced-DocControlledSelfExpiry
          • Binary Document Support
            • basicBinaryKV
            • advancedBinaryKV
          • Performance Handlers
            • fasterToLocalString
        • Debugging and Diagnosability
        • Statistics
        • Troubleshooting and Best Practices
        • Frequently Asked Questions
    • Install & Upgrade
      • Deployment Options
      • System Requirements
        • Supported Operating Systems
        • System Resource Requirements
        • Additional Requirements
        • Couchbase Server Ports
      • Deployment Guidelines
        • Sizing Guidelines
        • Clock Synchronization Requirements
        • Disable THP
        • Configure Kernel Swappiness
        • Security Considerations
        • Couchbase Server Process List
        • VM and Container Guidelines
        • About Clusters with Fewer Than 3 Nodes
      • Installation
        • Install on Linux
          • Red Hat & CentOS
          • Ubuntu & Debian
          • SUSE Enterprise
          • Oracle Enterprise
          • Amazon Linux 2
          • Non-Root Install and Upgrade
          • Install Multiple Instances
        • Install on Windows
        • Install on macOS
        • Verify the Installation
        • Startup and Shutdown
        • Uninstall
      • Cloud and Container Deployment
        • AWS
          • Deploy with AWS Marketplace
          • Deploy with Terraform
        • Azure
          • Deploy with Azure Marketplace
        • GCP
          • Deploy with GCP Marketplace
        • Kubernetes & OpenShift
          • Deploy with Autonomous Operator
        • Docker
          • Install with Docker
        • Couchbase Containers FAQ
      • Upgrade
        • Upgrade-Procedure Selection
        • Upgrade Procedures
          • Cluster Offline
          • Cluster Online
            • At Reduced Capacity
            • At Full Capacity
          • IPv6 Cluster-Upgrade
        • Feature Availability During Upgrade
      • Migration
        • Migrating Data
        • Enabling Timestamp-based Conflict Resolution for Migrated Data
    • Integrate
      • Connector Guides
      • Elasticsearch Plug-in
      • Kafka Connector
      • Spark Connector
      • Couchbase ODBC and JDBC Drivers
    • Reference
      • CLI Reference
        • cbanalyze-core
        • cbbackup
          • Guide
        • cbbackupwrapper
        • cbcollect_info
        • cbdocloader
        • cbepctl
          • set checkpoint_param
          • set flush_param
          • set tap_param
        • cbft-bleve
          • cbft-bleve: Moss Indexes
          • cbft-bleve: Scorch Indexes
          • cbft-bleve: Zap Files
        • cblogredaction
        • cbq
        • cbrecovery
        • cbrestore
          • Guide
          • rehash=1
        • cbrestorewrapper
        • cbstats
          • all
          • allocator
          • checkpoint
          • collections
          • collections-details
          • config
          • dcp
          • dcpagg
          • dcp-vbtakeover
          • diskinfo
          • dispatcher
          • durability-monitor
          • failovers
          • hash
          • items
          • key
          • kvstore
          • kvtimings
          • memory
          • prev-vbucket
          • raw
          • reset
          • responses
          • runtimes
          • scheduler
          • scopes
          • scopes-details
          • slabs
          • tap-vbtakeover
          • tasks
          • timings
          • uuid
          • vbucket
          • vbucket-details
          • vbucket-seqno
          • vkey
          • warmup
          • workload
        • cbsummary
        • cbtransfer
        • cbworkloadgen
        • couchbase-server
        • mctimings
      • REST API Reference
        • REST API endpoint list
          • Cluster API
            • Creating a new cluster
            • Retrieving Cluster Information
            • Viewing Cluster Details
            • Identifying the Orchestrator Node
            • Adding Nodes to Clusters
            • Joining Nodes into Clusters
            • Removing Nodes from Clusters
            • Rebalance API
              • Rebalancing the Cluster
              • Getting Rebalance Progress
              • Configuring Rebalance Retries
              • Getting Rebalance-Retry Status
              • Canceling Rebalance Retries
              • Limiting Concurrent vBucket Moves
            • Managing Internal Settings
            • Managing Cluster Connections
            • Getting Cluster Tasks
            • Getting Cluster Statistics
              • Getting a Single Statistic
              • Getting Multiple Statistics
            • Managing Auto-Failover
              • Retrieving Auto-Failover Settings
              • Enabling and Disabling Auto-Failover
              • Resetting Auto-Failover
            • Disabling Consistent View Query Results on Rebalance
            • Setting Email Notifications
            • Cluster Query Settings API
          • Nodes API
            • Getting Information on Nodes
            • Enabling Couchbase Server Services
            • Performing Hard Failover
            • Setting Recovery Type
            • Performing Graceful Failover
            • Setting Hostnames
            • Setting Usernames and Passwords
            • Setting Memory Quota
            • Setting Thread Allocations
            • Setting Storage Paths
            • Getting Storage Information
            • Listing Node Services
            • Managing Alternate Addresses
          • Server Groups API
            • Getting Group Information
            • Creating Groups
            • Adding Nodes to Groups
            • Renaming Groups
            • Updating Group Membership
            • Deleting Groups
          • Buckets API
            • Creating and Editing Buckets
            • Getting Bucket Information
            • Listing Nodes by Bucket
            • Getting Bucket Statistics
            • Getting Bucket Streaming URI
            • Deleting Buckets
            • Flushing Buckets
            • Managing Sample Buckets
          • Scopes and Collections API
            • Creating a Scope
            • Creating a Collection
            • Listing Scopes and Collections
            • Dropping a Collection
            • Dropping a Scope
          • Compaction API
            • Performing Compaction Manually
            • Auto-Compaction: Global
            • Auto-Compaction: Per Bucket
          • Query Service API
            • Examples
              • Successful request
              • Request with positional parameters
              • Request with Named Parameters
              • Request Timeout
              • Request error
              • Service error
              • N1QL error
              • Unsupported HTTP method
              • Request with authentication - HTTP header
              • Request with authentication - request parameter
            • Admin REST API
            • Functions REST API
          • Index Service API
            • Retrieve GSI Settings
            • Set GSI Settings
            • Index Statistics API
          • Backup Service API
            • Create and Edit Plans
            • Create a Repository
            • Get Information on Repositories
            • Get Information on Plans
            • Get Information on Tasks
            • Pause and Resume Tasks
            • Examine Backed-Up Data
            • Perform an Immediate Backup
            • Perform an Immediate Merge
            • Restore Data
            • Delete a Backup
            • Archive a Repository
            • Import a Repository
            • Delete a Repository
            • Delete a Plan
            • Get Information on the Cluster
            • Manage Backup Configuration
          • Search Service API
            • Node Configuration
            • Indexes
            • Advanced
            • Getting Search Statistics
          • Eventing Service API
          • Analytics Service API
            • Analytics Service REST API
            • Analytics Admin REST API
            • Analytics Config REST API
            • Analytics Links REST API
            • Analytics Library REST API
          • XDCR API
            • Creating XDCR Replications
            • Getting a Destination Cluster Reference
            • Setting Destination Cluster References
            • Deleting a Destination Cluster Reference
            • Managing XDCR Data Encryption
            • Deleting XDCR Replications
            • Managing Advanced XDCR Settings
            • Pausing XDCR Replication Streams
            • Getting XDCR Stats
          • Logs API
            • Retrieving Log Information
            • Creating Client Logs
          • Security API
            • Who Am I?
            • Configure Auditing
            • Authentication API
              • Configure LDAP
              • Configure saslauthd
              • Set Password Policy
              • Certificate Management API
                • Upload and Retrieve the Root Certificate
                • Upload and Retrieve a Node Certificate
                • Regenerate All Certificates
            • Authorization API
              • Role-Based Access Control (RBAC)
            • Configure On-the-Wire Security
            • Secret Management API
      • XDCR Reference
        • Advanced Settings
        • Filtering
          • Regular Expressions
          • Filtering Expressions
          • Data-Type Conversion
      • Audit Event Reference
      • Rebalance Reference
      • Metrics Reference
        • Data Service Metrics
        • Query Service Metrics
        • Index Service Metrics
        • Search Service Metrics
        • Eventing Service Metrics
        • Analytics Service Metrics
        • Backup Service Metrics
        • Cluster Manager Metrics
        • XDCR Metrics
        • Metrics for All Services
      • Views Reference
        • View Concepts
          • Stream-based Views
          • View Operations
          • Views and Stored Data
          • Development Views
          • Production Views
        • MapReduce Views
          • Writing MapReduce Views
            • Views Best Practices
            • Map Function
            • Reduce Function
            • Built-in Utility Functions
            • Built-in _count Function
            • Built-in _sum Function
            • Built-in _stats Function
            • Re-writing Built-in Reduce Functions
            • Custom Reduce Functions
            • Re-reduce Argument
            • Views for Non-JSON Objects
            • Translating SQL to MapReduce
            • Views in a Schema-less Database
          • Querying MapReduce Views
            • View and Query Examples
        • Views API
          • Getting Design Doc Information
          • Creating Design Documents
          • Deleting Design Documents
          • Getting Views Information
          • Limiting Views Requests
    • Release Notes & Licenses
      • Release Notes
      • Licenses for Third-Party Components
    • Contribute
      • Contribute to the Documentation
  • Edit on GitHub

Is this page helpful?

Yes No
Leave Additional Feedback?
Skip

Please use the form below to provide your feedback. Because your feedback is valuable to us, the information you submit in this form is recorded in our issue tracking system (JIRA), which is publicly available. You can track the status of your feedback using the ticket number displayed in the dialog once you submit the form.

  • Couchbase Server
  • Develop
  • Full Text Search (FTS)
  • Searching from UI
  • Query String Syntax

Query String Syntax

    +
    Query strings enable you to describe complex queries using a simple syntax.

    Using the query string syntax, the following query types can be performed:

    • Boosting

    • Date Range

    • Escaping

    • Field Scoping

    • Match Phrase

    • Match Query Syntax

    • Numeric Range

    Couchbase
    • Documentation
    • Forums
    • Support
    • Developer Portal
    • Blog
    • Resources
    • Get Started
    • Downloads
    • Training
    • Twitter
    • Linkedin
    • Facebook
    © 2022 Couchbase, Inc. Couchbase, Couchbase Lite and the Couchbase logo are registered trademarks of Couchbase, Inc.
    Terms of Use Privacy Policy Cookie Policy Support Policy Marketing Preference Center