Add search factors inspired by FI_IS_WIKI and FI_NUM_SLASHES
gargisheguri2023-09-14 09:40
Add the following search factors:
- Bonus factor if the URL is a Wikipedia page
- Bonus factor inversely proportional to the number of slashes in the URL trailing the hostname (based on the assumption that the greater the number of slashes, the further it is from the root page of the site)
- Added a bonus factor WIKI_BONUS that adds 0.5 to the doc_rank if the url contains "wikipedia" in the hostname
- Added a bonus factor NUM_SLASHES that adds (0.5 / x) to the doc_rank, where x represents the number of slashes trailing the hostname in the url:
- x = 1 (slashes count between 0 and 1)
- x = 2 (slashes count between 2 and 4)
- x = 3 (slashes count between 5 and 6)
- x = 4 (slashes count > 6)
- The letter_code (part of docid) now has the following format:
- 8th bit: represents whether cld or not
- bits 4/5/6/7: represent letter code (doc type)
- 3rd bit: represents whether wikipedia page or not
- bits 1/2: represent number of slashes
- Letter code is a char mapped to the corresponding int value (i.e. the 9 possible values of letter_code are mapped between bytes 4-7 as values 0-8)
Add the following search factors: - Bonus factor if the URL is a Wikipedia page - Bonus factor inversely proportional to the number of slashes in the URL trailing the hostname (based on the assumption that the greater the number of slashes, the further it is from the root page of the site)
0001-Adds-new-search-factors-for-wiki-bonus-and-num_slash.patch
- Added a bonus factor WIKI_BONUS that adds 0.5 to the doc_rank if the url contains "wikipedia" in the hostname - Added a bonus factor NUM_SLASHES that adds (0.5 / x) to the doc_rank, where x represents the number of slashes trailing the hostname in the url:
- x = 1 (slashes count between 0 and 1) - x = 2 (slashes count between 2 and 4) - x = 3 (slashes count between 5 and 6) - x = 4 (slashes count > 6)- The letter_code (part of docid) now has the following format:
- Letter code is a char mapped to the corresponding int value (i.e. the 9 possible values of letter_code are mapped between bytes 4-7 as values 0-8)
bonus.patch
istype.patch
Thanks for the patch. Fixed with commit 0b24ec8bf8