Module elastic_types::string
[−]
[src]
Implementation of the Elasticsearch keyword
and text
types.
Keyword fields are stored as a raw string of tokens, and aren't analysed when querying. They're useful for data that only has meaning when considered as a whole, like an id or single word.
Text fields are stored as a sequence of tokens, constructed based on the given analyzer
.
They're useful for blobs of content that can be sliced in various ways, like prose.
As far as serialisation is concerned, keyword
and text
are equivalent.
Examples
For defining your own string mapping, see:
Map with a default string
(follows the semantics for legacy string
mapping):
struct MyType { pub field: String }
Map a keyword
:
struct MyType { pub field: Keyword<DefaultKeywordMapping> }
Map text
:
struct MyType { pub field: Text<DefaultTextMapping> }
Links
Modules
keyword |
Implementation of the Elasticsearch |
mapping |
Common mapping for the Elasticsearch |
prelude |
Includes all types for the |
text |
Implementation of the Elasticsearch |
Structs
Keyword |
An Elasticsearch |
Text |
An Elasticsearch |