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.3 KB
Raw Blame
---
setup:
  - do:
        indices.create:
          index: test
          body:
              mappings:
                properties:
                  keyword:
                    type: keyword
                  date:
                    type: date

  - do:
      index:
        index: test
        id:    "1"
        body:  { "date": "2014-03-03T00:00:00", "keyword": "dgx" }

  - do:
      index:
        index: test
        id:    "2"
        body:  { "date": "2015-03-03T00:00:00", "keyword": "dfs" }

  - do:
      index:
        index: test
        id:    "3"
        body:  { "date": "2016-03-03T00:00:00", "keyword": "foobar" }

  - do:
      index:
        index: test
        id:    "4"
        body:  { "date": "2017-03-03T00:00:00", "keyword": "foo" }

  - do:
      index:
        index: test
        id:    "5"
        body:  { "date": "2018-03-03T00:00:00", "keyword": "bar" }

  - do:
      index:
        index: test
        id:    "6"
        body:  { "date": "2019-03-03T00:00:00", "keyword": "baz" }

  - do:
      index:
        index: test
        id:    "7"
        body:  { "date": "2020-03-03T00:00:00", "keyword": "qux" }

  - do:
      index:
        index: test
        id:    "8"
        body:  { "date": "2021-03-03T00:00:00", "keyword": "quux" }


  - do:
      indices.refresh:
        index: [test]

---
 teardown:

  - do:
      cluster.put_settings:
        body:
          persistent:
            search.max_buckets: null

---
"Max bucket":

  - do:
      cluster.put_settings:
        body:
          persistent:
            search.max_buckets: 3

  - do:
      catch: /.*Trying to create too many buckets.*/
      search:
        rest_total_hits_as_int: true
        allow_partial_search_results: false
        index: test
        body:
          aggregations:
            test:
              terms:
                field: keyword

  - do:
      cluster.put_settings:
        body:
          persistent:
            search.max_buckets: 6

  - do:
      catch: /.*Trying to create too many buckets.*/
      search:
        rest_total_hits_as_int: true
        allow_partial_search_results: false
        index: test
        body:
          aggregations:
            test:
              terms:
                field: keyword
              aggs:
                2:
                  terms:
                    field: date