mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-07 17:05:43 -04:00
making the search "smarter"
This commit is contained in:
parent
27c523d12b
commit
862ad247c7
1 changed files with 4 additions and 4 deletions
|
@ -365,11 +365,11 @@ sub get_fact_search {
|
||||||
#XXX: need to also search contents of factoids TODO
|
#XXX: need to also search contents of factoids TODO
|
||||||
my $results = $self->dbh->selectall_arrayref(
|
my $results = $self->dbh->selectall_arrayref(
|
||||||
"SELECT subject,copula,predicate
|
"SELECT subject,copula,predicate
|
||||||
FROM factoid
|
FROM (SELECT factoid_id,subject,predicate FROM factoid GROUP BY original_subject) as subquery
|
||||||
WHERE subject like ?
|
WHERE subject like ? OR predicate like ?
|
||||||
GROUP BY subject", # Group by magically returns the right row first. I dunno.
|
GROUP BY original_subject", # using a subquery so that i can do this properly
|
||||||
{Slice => {}},
|
{Slice => {}},
|
||||||
"%$body%",
|
"%$body%", "%$body%",
|
||||||
);
|
);
|
||||||
|
|
||||||
if( $results and @$results ) {
|
if( $results and @$results ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue