Feat/Jaccard Similarity (#5)

* new: feat: add sorting and filtering by similarity

* chg: fix: imdb link retrieval

* chg: fix: do not filter when queryis empty
This commit is contained in:
2024-03-10 14:58:15 -03:00
committed by GitHub
parent 322bb34ebb
commit 268ece5650
6 changed files with 69 additions and 4 deletions

View File

@@ -39,6 +39,7 @@ type IndexedTorrent struct {
Size string `json:"size"`
LeechCount int `json:"leech_count"`
SeedCount int `json:"seed_count"`
Similarity float32 `json:"similarity"`
}
func NewIndexers(redis *cache.Redis, metrics *monitoring.Metrics) *Indexer {
@@ -59,14 +60,16 @@ func HandlerIndex(w http.ResponseWriter, r *http.Request) {
"method": "GET",
"description": "Indexer for comando torrents",
"query_params": map[string]string{
"q": "search query",
"q": "search query",
"filter_results": "if results with similarity equals to zero should be filtered (true/false)",
},
},
"/indexers/bludv": map[string]interface{}{
"method": "GET",
"description": "Indexer for bludv",
"query_params": map[string]string{
"q": "search query",
"q": "search query",
"filter_results": "if results with similarity equals to zero should be filtered (true/false)",
},
},
},