bounds
This commit is contained in:
parent
43daa3a5ad
commit
024c84cbff
@ -35,9 +35,11 @@ func NewSimilar() *ffcli.Command {
|
||||
}
|
||||
|
||||
for _, e := range *resp {
|
||||
fmt.Printf("%s\t%s\n",
|
||||
fmt.Printf("%f : %s\n\t%s\n",
|
||||
e.Similarity,
|
||||
e.Title,
|
||||
e.Headline)
|
||||
fmt.Printf("-----------------------------------\n")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -301,7 +301,8 @@ SELECT entry_id, similarity(body, $2) as similarity,
|
||||
title from entries,
|
||||
to_tsquery($2) q
|
||||
WHERE user_id = $1 and
|
||||
similarity(body, $2) > 0.0
|
||||
similarity(body, $2) > 0.0 and
|
||||
similarity(body, $2) < 1.0
|
||||
order by similarity DESC
|
||||
LIMIT 10
|
||||
`
|
||||
|
@ -32,7 +32,8 @@ SELECT entry_id, similarity(body, $2) as similarity,
|
||||
title from entries,
|
||||
to_tsquery($2) q
|
||||
WHERE user_id = $1 and
|
||||
similarity(body, $2) > 0.0
|
||||
similarity(body, $2) > 0.0 and
|
||||
similarity(body, $2) < 1.0
|
||||
order by similarity DESC
|
||||
LIMIT 10;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user