如何在Vespa中存储日期字段?

时间:2018-09-13 15:07:07

标签: vespa

我想存储一个文档,其中包含一个包含日期的字段。代表它的最佳方式是什么?在“搜索定义”中应使用哪种类型? 我在文档(https://docs.vespa.ai/documentation/reference/search-definitions-reference.html#field_types)中寻找了“日期”类型,但没有找到。

1 个答案:

答案 0 :(得分:4)

在Vespa中表示日期的最佳方法是使用unix时间戳。

搜索定义中的字段定义可以定义为:

# Creation date
field createdate type long {
    indexing: summary | attribute
    attribute: fast-search
}

请注意,“属性”将使值可搜索,“属性:快速搜索”将提高搜索性能

相关问题