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.

1.9 KB
Raw Blame

Analyzers — _analyze

Use case doc: analyzers

Inspect tokenization the way ES does.

✅ standard analyzer

curl -s -XPOST "http://localhost:9200/_analyze" \
  -H 'content-type: application/json' \
  -d '{"analyzer":"standard","text":"The Quick, Brown Fox!"}'
{
  "tokens": [
    {
      "end_offset": 3,
      "position": 0,
      "start_offset": 0,
      "token": "the",
      "type": "word"
    },
    {
      "end_offset": 9,
      "position": 1,
      "start_offset": 4,
      "token": "quick",
      "type": "word"
    },
    {
      "end_offset": 16,
      "position": 2,
      "start_offset": 11,
      "token": "brown",
      "type": "word"
    },
    {
      "end_offset": 20,
      "position": 3,
      "start_offset": 17,
      "token": "fox",
      "type": "word"
    }
  ]
}

HTTP 200

✅ keyword analyzer

curl -s -XPOST "http://localhost:9200/_analyze" \
  -H 'content-type: application/json' \
  -d '{"analyzer":"keyword","text":"The Quick, Brown Fox!"}'
{
  "tokens": [
    {
      "end_offset": 21,
      "position": 0,
      "start_offset": 0,
      "token": "The Quick, Brown Fox!",
      "type": "word"
    }
  ]
}

HTTP 200

✅ whitespace analyzer

curl -s -XPOST "http://localhost:9200/_analyze" \
  -H 'content-type: application/json' \
  -d '{"analyzer":"whitespace","text":"The Quick, Brown Fox!"}'
{
  "tokens": [
    {
      "end_offset": 3,
      "position": 0,
      "start_offset": 0,
      "token": "The",
      "type": "word"
    },
    {
      "end_offset": 10,
      "position": 1,
      "start_offset": 4,
      "token": "Quick,",
      "type": "word"
    },
    {
      "end_offset": 16,
      "position": 2,
      "start_offset": 11,
      "token": "Brown",
      "type": "word"
    },
    {
      "end_offset": 21,
      "position": 3,
      "start_offset": 17,
      "token": "Fox!",
      "type": "word"
    }
  ]
}

HTTP 200