DocumentWeightingRules

DocumentWeightingRules

is an option for TextSearch and related functions that allows the specification of weights for documents based on the values of fields in the search index.

Details

  • DocumentWeightingRules -> <|"field1" -> <|val11 -> weight11, val12 -> weight12, |>, "field2" -> <||>, |> means that a document with value valij for field "fieldi" will have its score multiplied by weightij.
  • The fields used for DocumentWeightingRules need to have the "Stored" or "BulkRetrievalOptimized" option set to True in ContentFieldOptions.
  • For performance purposes, "BulkRetrievalOptimized" is to be preferred to "Stored".

Examples

open allclose all

Basic Examples  (1)

Weight documents according to the value of a "Quality" field:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Possible Issues  (2)

See Also

TextSearch  CreateSearchIndex  ContentFieldOptions

Introduced in 2017
(11.1)