DocumentWeightingRules

DocumentWeightingRules

TextSearch 及相关函数的一个选项,允许根据搜索索引中字段的值来指定文档的权重.

更多信息

  • DocumentWeightingRules -> <|"field1" -> <|val11 -> weight11, val12 -> weight12, |>, "field2" -> <||>, |> 意味着字段 "fieldi" 值为 valij 的文档的分数要乘以 weightij.
  • 对于用于 DocumentWeightingRules 的字段,需要把 ContentFieldOptions 中的 "Stored""BulkRetrievalOptimized" 选项设置为 True.
  • 出于提高性能的目的,"BulkRetrievalOptimized" 最好是设置为 "Stored".

范例

打开所有单元关闭所有单元

基本范例  (1)

根据 "Quality" 字段的值对文档进行加权:

没有加权,结果得分相同:

可能存在的问题  (2)

只有在对索引进行搜索时才进行文档加权,对文件进行搜索时则不需要:

用于文档加权的字段必须在索引的 ContentFieldOptions 中把 "Stored""BulkRetrievalOptimized" 设置为 True

Wolfram Research (2017),DocumentWeightingRules,Wolfram 语言函数,https://reference.wolfram.com/language/ref/DocumentWeightingRules.html.

文本

Wolfram Research (2017),DocumentWeightingRules,Wolfram 语言函数,https://reference.wolfram.com/language/ref/DocumentWeightingRules.html.

CMS

Wolfram 语言. 2017. "DocumentWeightingRules." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/DocumentWeightingRules.html.

APA

Wolfram 语言. (2017). DocumentWeightingRules. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/DocumentWeightingRules.html 年

BibTeX

@misc{reference.wolfram_2024_documentweightingrules, author="Wolfram Research", title="{DocumentWeightingRules}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/DocumentWeightingRules.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_documentweightingrules, organization={Wolfram Research}, title={DocumentWeightingRules}, year={2017}, url={https://reference.wolfram.com/language/ref/DocumentWeightingRules.html}, note=[Accessed: 22-November-2024 ]}