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.5 KB
Raw Blame
setup:
  - requires:
      test_runner_features: [ capabilities ]
      capabilities:
        - method: PUT
          path: /{index}
          capabilities: [ disable_sequence_numbers ]
      reason: "requires support for disabling sequence numbers"

  - do:
      indices.create:
        index: test
        body:
          settings:
            index.disable_sequence_numbers: true
            index.number_of_shards: 1

  - do:
      index:
        index: test
        id: "1"
        body: { foo: bar }

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

---
"term query on _seq_no is rejected":
  - do:
      catch: bad_request
      search:
        index: test
        body:
          query:
            term:
              _seq_no: 0
  - match: { error.root_cause.0.type: "query_shard_exception" }
  - match: { error.root_cause.0.reason: "failed to create query: Cannot query field [_seq_no]: _seq_no cannot be queried when [index.disable_sequence_numbers] is [true]" }

---
"range query on _seq_no is rejected":
  - do:
      catch: bad_request
      search:
        index: test
        body:
          query:
            range:
              _seq_no:
                gte: 0
  - match: { error.root_cause.0.type: "query_shard_exception" }
  - match: { error.root_cause.0.reason: "failed to create query: Cannot query field [_seq_no]: _seq_no cannot be queried when [index.disable_sequence_numbers] is [true]" }

---
"sort by _seq_no is rejected":
  - do:
      catch: bad_request
      search:
        index: test
        body:
          sort: [{ _seq_no: asc }]
  - match: { error.root_cause.0.type: "illegal_argument_exception" }
  - match: { error.root_cause.0.reason: "Cannot query field [_seq_no]: _seq_no cannot be queried when [index.disable_sequence_numbers] is [true]" }

---
"bulk response returns unassigned _seq_no and _primary_term":
  - do:
      bulk:
        refresh: true
        body:
          - index:
              _index: test
              _id: "2"
          - foo: baz
          - index:
              _index: test
              _id: "3"
          - foo: qux
  - match: { errors: false }
  - match: { items.0.index._seq_no: -2 }
  - match: { items.0.index._primary_term: 0 }
  - match: { items.1.index._seq_no: -2 }
  - match: { items.1.index._primary_term: 0 }

---
"seq_no_primary_term returns sentinel values":
  - do:
      search:
        index: test
        body:
          seq_no_primary_term: true
  - match: { hits.total.value: 1 }
  - match: { hits.hits.0._seq_no: -2 }
  - match: { hits.hits.0._primary_term: 0 }