Hyperspace Docs
Hyperspace Homepage
  • Getting started
    • Overview
      • Hyperspace Advantages
      • Hyperspace Search
    • Quick Start
  • flows
    • Setting Up
      • Installing the Hyperspace API Client
      • Connecting to the Hyperspace Server
      • Creating a Database Schema Configuration File
        • Vector Similarity Metrics
        • Index Type Methods
      • Creating a Collection
      • Uploading Data to a Collection
      • Building and Running Queries
        • Building a Lexical Search Query
        • Building a Vector Search Query
        • Building a Hybrid Search Query
      • Retrieving Results
    • Data Collections
      • Uploading Data
      • Accessing Data
      • Supported Data Types
    • Queries
      • DSL Query interface
        • Aggregations
        • Bool Query
        • Candidate Generation and Metadata Filtering
        • Scoring and Ranking
  • Reference
    • Hyperspace Query Flow
    • Features and Benefits
    • Search Processing Unit (SPU)
    • Hyperspace Document Prototype
  • API Documentation
    • Hyperspace Client
      • add_batch
      • add_document
      • async_req
      • clear_collection
      • collections_info
      • commit
      • create_collection
      • delete_collection
      • delete_by_query
      • dsl_search
      • get_schema
      • get_document
      • reset_password
      • search
      • update_by_query
      • update_document
    • DSL Query Framework
      • Aggregations
        • Cardinality Aggregation
        • Date Histogram
        • Metric Aggregations
        • Terms Aggregation
      • Bool Queries
        • Free Text Search
        • 'match' Clause
        • 'filter' Clause
        • 'must' Clause
        • 'must_not' Clause
        • 'should' Clause
        • 'should_not' Clause
      • Candidate Generation and Metadata Filtering
        • Geo Coordinates Match
        • Range Match
        • Term Match
      • Scoring and Ranking
        • Boost
        • 'dis_max'
        • Function Score
        • Rarity Score (TF-IDF)
  • Releases
    • 2024 Releases
Powered by GitBook
On this page
  1. API Documentation
  2. DSL Query Framework
  3. Candidate Generation and Metadata Filtering

Range Match

The range query allow you to filter documents based on a specified range of values within a given field. It can be used for numeric and date fields. The Range query uses the following terms:

  • "gte": the document must be greater than or equals to the provided values

  • "gt": the document must be greater than the provided values

  • "lte": the document must be smaller than or equals to the provided values

  • "lt": the document must be smaller than the provided values

Example 1:

{
  "query": {
    "range": {
      "date": {
        "gte": "2023-01-01",
        "lte": "2023-12-31"
      }
    }
  }
}

The above example requires candidates to have a field named "date" with values that are greater than or equal to "2023-01-01" and smaller than or equal to "2023-12-31".

Example 2:

{
  "query": {
    "range": {
      "datetime": {
        "gte": "2023-01-01T08:00:00",
        "lt": "2023-01-01T17:30:00""
      }
    }
  }
}

The above example requires candidates to have a field named "datetime" with values that are greater than or equal to "2023-01-01T08:00:00" and smaller than "2023-01-01T17:30:00"".

Example 3:

{
  "query": {
    "range": {
      "price": {
        "gt": 10,
        "lte": 30
      }
    }
  }
}

The above example requires candidates to have a field named "price" with values that are greater than "10" and smaller or equal to than "30"".

PreviousGeo Coordinates MatchNextTerm Match

Last updated 11 months ago