I want to store a document which would have a field containing a date. What would be the best way to represent it and which type should I use in its "search definition" ? I have looked for a "date" type in the documentation (https://docs.vespa.ai/documentation/reference/search-definitions-reference.html#field_types) but haven't found one.
Asked
Active
Viewed 224 times
1 Answers
4
The best way to represent a date in Vespa is to use a unix timestamp.
The field definition in the search definition can be defined as:
# Creation date
field createdate type long {
indexing: summary | attribute
attribute: fast-search
}
Note that 'attribute' will make the value searchable, and 'attribute: fast-search' will improve the search performance

Bjørn Meland
- 81
- 3