1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-02-23 14:51:01 +00:00

TorrentSyndikat: Do not filter query, remove wildcard operator. (#5489)

TS removes too short terms automatically. Wildcard causes problems with not indexed terms such as "how" (as in "how to sell drugs online fast").
This commit is contained in:
julakali 2019-06-14 21:35:06 +02:00 committed by garfield69
parent 919bf4d99a
commit 756161f1e7

View file

@ -151,9 +151,7 @@ namespace Jackett.Common.Indexers
{
// use AND+wildcard operator to avoid getting to many useless results
var searchStringArray = Regex.Split(searchString.Trim(), "[ _.-]+", RegexOptions.Compiled).ToList();
searchStringArray = searchStringArray.Where(x => x.Length >= 3).ToList(); // remove words with less than 3 characters
searchStringArray = searchStringArray.Where(x => !new string[] { "der", "die", "das", "the" }.Contains(x.ToLower())).ToList(); // remove words with less than 3 characters
searchStringArray = searchStringArray.Select(x => "+" + x + "*").ToList(); // add AND operators+wildcards
searchStringArray = searchStringArray.Select(x => "+" + x).ToList(); // add AND operators
var searchStringFinal = String.Join(" ", searchStringArray);
queryCollection.Add("search", searchStringFinal);
}