Add flexible threshold, bump up max_distance a bit.
This commit is contained in:
parent
0a4bae4b43
commit
4d578c156d
|
@ -106,7 +106,8 @@ class Feature(models.Model):
|
||||||
return ''
|
return ''
|
||||||
time_end.short_description = "End Date"
|
time_end.short_description = "End Date"
|
||||||
|
|
||||||
def similar_features(self, max_distance=15000, scale_factor=2000, limit=20):
|
def similar_features(self, max_distance=30000, scale_factor=2000, threshold=0.35, limit=20):
|
||||||
|
type(self).search.set_threshold(threshold)
|
||||||
sql = """
|
sql = """
|
||||||
SELECT *, %s * similarity / (distance + 1.0) AS score FROM (
|
SELECT *, %s * similarity / (distance + 1.0) AS score FROM (
|
||||||
SELECT f.*, r.feature1_id, r.feature2_id, r.relationship_type,
|
SELECT f.*, r.feature1_id, r.feature2_id, r.relationship_type,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user