Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

2.2 KB
Raw Blame
setup:
  - requires:
      cluster_features: ["gte_v7.2.0"]
      reason:  "Implemented in 7.2"

  - do:
      indices.create:
        index: index1
        body:
          mappings:
            properties:
              my_date:
                type: date
              my_date_nanos:
                type: date_nanos
              my_geo:
                type: geo_point

  - do:
      bulk:
        refresh: true
        body:
        - '{ "index" : { "_index" : "index1", "_id" : "1" } }'
        - '{ "my_date": "2018-02-01T10:00:00Z", "my_date_nanos": "2018-02-01T00:00:00.223456789Z", "my_geo": [-71.34, 41.13] }'
        - '{ "index" : { "_index" : "index1", "_id" : "2" } }'
        - '{ "my_date": "2018-02-01T11:00:00Z", "my_date_nanos": "2018-02-01T00:00:00.123456789Z", "my_geo": [-71.34, 41.14] }'
        - '{ "index" : { "_index" : "index1", "_id" : "3" } }'
        - '{ "my_date": "2018-02-01T09:00:00Z", "my_date_nanos": "2018-02-01T00:00:00.323456789Z", "my_geo": [-71.34, 41.12] }'

---
"test distance_feature query on date type":

- do:
    search:
      rest_total_hits_as_int: true
      index: index1
      body:
        query:
          distance_feature:
            field: my_date
            pivot: 1h
            origin: 2018-02-01T08:00:30Z

- length: { hits.hits: 3 }
- match: { hits.hits.0._id: "3" }
- match: { hits.hits.1._id: "1" }
- match: { hits.hits.2._id: "2" }

---
"test distance_feature query on date_nanos type":

- do:
    search:
      rest_total_hits_as_int: true
      index: index1
      body:
        query:
          distance_feature:
            field: my_date_nanos
            pivot: 100000000nanos
            origin: 2018-02-01T00:00:00.323456789Z

- length: { hits.hits: 3 }
- match: { hits.hits.0._id: "3" }
- match: { hits.hits.1._id: "1" }
- match: { hits.hits.2._id: "2" }

---
"test distance_feature query on geo_point type":

- do:
    search:
      rest_total_hits_as_int: true
      index: index1
      body:
        query:
          distance_feature:
            field: my_geo
            pivot: 1km
            origin: [-71.35, 41.12]

- length: { hits.hits: 3 }
- match: { hits.hits.0._id: "3" }
- match: { hits.hits.1._id: "1" }
- match: { hits.hits.2._id: "2" }