Tokenization in Weaviate: What It Changes and How to Choose a Method

How Weaviate tokenization splits text properties for keyword search and filtering, what each method changes, and how to pick one for your data.

In Weaviate, tokenization is a per-property setting that controls how a text value is broken into tokens for the inverted index. That index powers keyword (BM25) search, the keyword half of hybrid search, and filters on text properties. Choosing a method is a text transformation decision. The stored value stays the same, but the units that search and filters can match change with each method. This review covers what each method does, where each one fits, and where the available evidence runs out.

Is a given tokenization method suitable for your use?

For most natural-language text, such as article bodies, descriptions and comments, the default word tokenization is a reasonable starting point. It lowercases text and splits on anything that is not a letter or digit, so a search for "hello" matches "Hello," and "hello!" alike. The cost is that punctuation, case and internal structure are discarded. As a result, values like product codes, email-style identifiers, file paths or hyphenated terms are broken into fragments that can match more than intended.

Prefer field tokenization when a property holds a value that should be treated as a single unit, such as an SKU, a status label, a URL-like string or an exact name. In those cases the whole trimmed value is one token, and matching behaves much more like an exact comparison. Prefer whitespace tokenization when case and punctuation carry meaning, such as code identifiers. Prefer lowercase tokenization when case should be ignored but punctuation should stay attached, for example tags that begin with a symbol.

If your application relies mainly on vector (semantic) search, the choice matters less. Tokenization does not change what the vectorizer or embedding model receives. Embedding models apply their own tokenization, separate from this setting. The setting becomes decisive when you depend on BM25 ranking, hybrid search or text filters.

What tokenization actually changes

Tokenization does not reverse, mirror, restyle or substitute characters in your data. The object you insert is stored and returned as written. The change happens only in the index: Weaviate derives a set of tokens from each text value, and keyword search and filters compare query tokens against those index tokens. Queries are tokenized the same way as the property they target, which is why the same search string can match differently on two properties with different settings.

Weaviate's documentation illustrates the core methods with the input "Why, hello there!". The outputs below follow the documented rules for each method.

Method | Rule | Tokens from "Why, hello there!"
word (default) | Keep alphanumeric characters, split on everything else, lowercase | why, hello, there
lowercase | Lowercase, split on whitespace, keep punctuation | why, | hello | there!
whitespace | Split on whitespace, keep case and punctuation | Why, | hello | there!
field | Trim surrounding whitespace, keep the whole value as one token | Why, hello there!

In the lowercase and whitespace rows, the tokens are "why," or "Why," with the comma attached, then "hello", then "there!" with the exclamation mark attached. These methods split only on spaces, so punctuation stays part of the token, and a query for "there" will not match the token "there!".

Weaviate also documents additional methods for specific needs. These include trigram tokenization, which splits text into overlapping three-character sequences and is useful for partial or fuzzy matching. They also include language-specific tokenizers for Chinese, Japanese and Korean, where words are not separated by spaces and word tokenization would produce poor units. The language-specific tokenizers must be enabled in the server configuration before use. Check which ones are available in your deployment and version before relying on them.

Because tokenization operates on characters, Unicode details still matter. Accented letters, combining marks, full-width forms and emoji are handled according to each method's character rules rather than by meaning. No supplied evidence describes how a specific Weaviate version treats these cases. If your data includes them, test representative values directly instead of assuming the behavior.

Setting tokenization on a property

Tokenization is defined per text property when the collection is created. A minimal example with the Python client (v4) might look like this:

from weaviate.classes.config import Property, DataType, Tokenization

client.collections.create(
    "Article",
    properties=[
        Property(name="body", data_type=DataType.TEXT, tokenization=Tokenization.WORD),
        Property(name="sku", data_type=DataType.TEXT, tokenization=Tokenization.FIELD),
    ],
)

Plan the setting before importing data. According to Weaviate's documentation, a property's tokenization cannot be changed after the property is created. Switching methods generally means creating a new property or collection and reimporting the data.

Will results stay readable and usable after copying or sharing?

Yes, as far as the text itself goes. Tokenization never alters stored values, so returned objects can be copied, displayed, read by assistive technology and edited exactly as they were inserted. Concerns that apply to mirrored or styled Unicode text, such as broken screen reader output or scrambled reading order, do not arise from this setting.

The usability risks are in retrieval, not in display:

  • Over-matching: word tokenization can make a filter on a code such as "AB-100" also match other values containing the tokens "ab" and "100".
  • Under-matching: whitespace and lowercase tokenization leave punctuation attached, so a query without the punctuation may miss the value.
  • Filter semantics: filters on text properties compare tokens, so an equality filter is not a whole-string comparison unless the property uses field tokenization.
  • Stopwords: the stopword settings in the inverted index configuration also affect which tokens count in keyword search. Review them alongside tokenization.

When exact matching and flexible keyword search are both needed for the same content, a common approach is to store the value in two properties: one tokenized as field for exact lookups and one tokenized as word for keyword search. This uses more storage, but it avoids forcing one method to serve both purposes.

Evidence gaps

This review is based on Weaviate's documented tokenization rules and general principles of inverted indexing. No measurements, benchmarks or version-specific tests were available. Ranking effects on BM25 scores, performance differences between methods, handling of specific Unicode edge cases, and the exact list of tokenizers available in a given release should all be confirmed against your Weaviate version's documentation and tested with a sample of your own data.