Calculate the weight field value for the words in the list.
Declaration Syntax
C# | Visual Basic |
protected virtual void CalculateWordRelevancies( WordCollection wordsList )
Protected Overridable Sub CalculateWordRelevancies ( wordsList As WordCollection )
Parameters
- wordsList (WordCollection)
- WordCollection of Word objects, with inBody, in Title, inURL fields filled
Remarks
This method defines the relationship between the occurrences (hits) in the document
and the weight of the words in the document.
Eg.
A document contains 4 words;
"this", "is", "this", "example".
The document's title is;
"example"
The document's URL is;
http://localhost/example.html
If phrase matching is enabled, when the build is performed the wordsList parameter will contain
Word objects with the following data:
If phrase matching is disabled, when the build is performed the wordsList parameter will contain
Word objects with the following data:
This method is then called to calculate the Weight property in the Word objects (by default it uses the weight coefficients).
This method can therefore be overridden with custom rules for weighting.
Copy | |
---|---|
wordsList[0] = "this", inUri=0, inTitle=0, inBody=1 wordsList[1] = "is", inUri=0, inTitle=0, inBody=1 wordsList[2] = "this", inUri=0, inTitle=0, inBody=1 wordsList[3] = "example", inUri=1, inTitle=1, inBody=1 |
Copy | |
---|---|
wordsList[0] = "this", inUri=0, inTitle=0, inBody=2 wordsList[1] = "is", inUri=0, inTitle=0, inBody=1 wordsList[2] = "example", inUri=1, inTitle=1, inBody=1 |
Assembly: Keyoti4.SearchEngine.Core (Module: Keyoti4.SearchEngine.Core.dll) Version: 2022.8.22.610