Back to mnoGoSearch site


mnoGoSearch 3.3.12 reference manual: Full-featured search engine software
PrevNext

UserSiteScore

Name

UserSiteScore -- specifies an SQL query to calculate user defined score for certain sites.

search.htm

Synopsis

UserSiteScore {name} {sql-query}

Description

The UserSiteScore command allows to configure user defined scores for some or all servers in the database. The score value calculated by mnoGoSearch is mixed with the user defined site value, so you can affect the final rank for the desired sites.

It is possible to configure multiple UserSiteScore commands, however only one of them can be used during search time. The name argument should be unique in every UserSiteScore command. search.cgi detects which UserSiteScore command to use taking its name from the ss=name1 HTML form parameter. If no ss parameter is given, or ss's value is empty, non of the UserSiteScore commands are applied.

The second argument must represent an SQL query returning a result set consisting of two columns. The first column in every record should correspond to an ID of a site whose score should be modified.

Note: The site IDs are stored in the site_id column of the url table of the mnoGoSearch database. To know an ID of a certain site you can run this SQL query in the database:


SELECT site_id FROM url WHERE url LIKE 'http://hostname/%';
    

The second column stands for a user defined score value for this site, returned as a signed integer in the range -255..+255. The original score value calculated by mnoGoSearch is mixed with the user defined site value as follows:

Examples


# Give higher scores to certain sites using IDs:
UserSiteScore list1 "SELECT site_id, 255 FROM url WHERE site_id IN (101,210,400)"

# Give higher scores to a certain site using URL pattens:
UserSiteScore list2 "SELECT site_id, 255 FROM url WHERE url LIKE 'http://mysite/%' LIMIT 1"
    

See also

UserScore, UserScoreFactor, the Section called Search parameters in Chapter 10.