Skip to content

Commit

Permalink
Changed ranking mode to SPH04 - boosts the matches for exact query. C…
Browse files Browse the repository at this point in the history
…hanged field weights.
  • Loading branch information
MartinMikita committed May 25, 2016
1 parent e378a26 commit 948977a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web/websearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ def process_query(index, query, query_filter, start=0, count=0):
cl.SetConnectTimeout(5.0) # float seconds
cl.SetLimits(start, count) #offset, limit, maxmatches=0, cutoff=0
# cl.SetSortMode( SPH_SORT_ATTR_DESC, 'date')
cl.SetMatchMode(SPH_MATCH_EXTENDED2)
# cl.SetMatchMode(SPH_MATCH_EXTENDED2)
cl.SetRankingMode(SPH_RANK_SPH04)
cl.SetFieldWeights({
'title': 30,
'title': 500,
'content': 1,
'tags': 15,
'tags': 20,
})

# Prepare filter for query, except tags
Expand Down

0 comments on commit 948977a

Please sign in to comment.