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:
                my_date:
                  type: date
                  ignore_malformed: true
                  store: true
                my_ip:
                  type: ip
                  ignore_malformed: true

  - do:
      index:
        index:  test
        id:     "1"
        body:   { "my_date": "2018-05-11", "my_ip": ":::1" }

  - do:
      index:
        index:  test
        id:     "2"
        body:   { "my_date": "bar", "my_ip": "192.168.1.42" }

  - do:
      index:
        index:  test
        id:     "3"
        body:   { "my_date": "bar", "my_ip": "quux" }

  - do:
      indices.refresh: {}

---
"Exists on _ignored":

  - do:
      search:
        rest_total_hits_as_int: true
        body: { query: { exists: { "field": "_ignored" } } }

  - length:   { hits.hits: 3  }

---
"Search on _ignored with term":

  - do:
      search:
        rest_total_hits_as_int: true
        body: { query: { term: { "_ignored": "my_date" } } }

  - length:   { hits.hits: 2  }

---
"Search on _ignored with terms":

  - do:
      search:
        rest_total_hits_as_int: true
        body: { query: { terms: { "_ignored": [ "my_date", "my_ip" ] } } }

  - length:   { hits.hits: 3  }

---
"_ignored is returned by default":

  - do:
      search:
        rest_total_hits_as_int: true
        body: { query: { ids: { "values": [ "3" ] } } }

  - length:   { hits.hits: 1  }
  - length:   { hits.hits.0._ignored: 2}

---
"_ignored is still returned with explicit list of stored fields":

  - do:
      search:
        rest_total_hits_as_int: true
        stored_fields: [ "my_date" ]
        body: { query: { ids: { "values": [ "3" ] } } }

  - length:   { hits.hits: 1  }
  - is_true:  hits.hits.0._ignored


---
"ignored_field_values is returned by default":
  - requires:
      cluster_features: ["gte_v8.0.0"]
      reason: ignored_field_values was added in 8.0

  - do:
      search:
        rest_total_hits_as_int: true
        body: { query: { ids: { "values": [ "3" ] } },"_source":false, "fields":["my*"]}

  - length:   { hits.hits: 1  }
  - length:   { hits.hits.0._ignored: 2}
  - length:   { hits.hits.0.ignored_field_values.my_date: 1}
  - length:   { hits.hits.0.ignored_field_values.my_ip: 1}