1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 18:45:42 -04:00

update factoid search

This commit is contained in:
Ryan Voots 2020-09-10 20:40:45 -04:00
parent 5d8ed2ae4a
commit 8b0b267585
2 changed files with 3 additions and 3 deletions

View file

@ -108,7 +108,7 @@ sub handle_request {
host => '*special', #TODO fix this to be an actual hostname! host => '*special', #TODO fix this to be an actual hostname!
# Make sure it isn't messed up by the alias feature.. # Make sure it isn't messed up by the alias feature..
server => $data->{server} // '*special', server => $data->{server} // '*special',
nolearn => 1, # nolearn => 1,
}; };
# Avoid passing around the full reference # Avoid passing around the full reference

View file

@ -679,11 +679,11 @@ get_factoid_search (depth, factoid_id, subject, copula, predicate, author, modif
WHERE NOT deleted WHERE NOT deleted
ORDER BY original_subject ASC, depth ASC, factoid_id DESC ORDER BY original_subject ASC, depth ASC, factoid_id DESC
) )
SELECT ts_rank(full_document_tsvector, websearch_to_tsquery(?)) AS rank, * FROM get_factoid_search ORDER BY 1 DESC LIMIT 10 SELECT ts_rank(full_document_tsvector, websearch_to_tsquery('factoid', ?)) AS rank, * FROM get_factoid_search WHERE ts_rank(full_document_tsvector, websearch_to_tsquery('factoid', ?)) > 0.01 ORDER BY 1 DESC, factoid_id DESC LIMIT 10
", ",
{ Slice => {} }, { Slice => {} },
$namespace, $server, $namespace, $server,
$body, $body, $body
); );
if ($results and @$results) { if ($results and @$results) {