From f95d2cc5067463642e395a435a13a72b7abd8185 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 29 Apr 2013 21:29:04 -0400 Subject: added more movie filters --- .../Library/LuceneSearchEngine.cs | 38 ++++++++-------------- 1 file changed, 14 insertions(+), 24 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Library') diff --git a/MediaBrowser.Server.Implementations/Library/LuceneSearchEngine.cs b/MediaBrowser.Server.Implementations/Library/LuceneSearchEngine.cs index 2dc4ecbb8..ef9662d0b 100644 --- a/MediaBrowser.Server.Implementations/Library/LuceneSearchEngine.cs +++ b/MediaBrowser.Server.Implementations/Library/LuceneSearchEngine.cs @@ -241,20 +241,15 @@ namespace MediaBrowser.Server.Implementations.Library return new Tuple(searchInput, 0); } - var match = Regex.Match(input, searchInput, RegexOptions.IgnoreCase); + var index = input.IndexOf(searchInput, StringComparison.OrdinalIgnoreCase); - if (match.Success) + if (index == 0) { - var index = match.Index; - - if (index == 0) - { - return new Tuple(searchInput, 1); - } - if (index > 0) - { - return new Tuple(searchInput, 2); - } + return new Tuple(searchInput, 1); + } + if (index > 0) + { + return new Tuple(searchInput, 2); } var items = GetWords(input); @@ -272,20 +267,15 @@ namespace MediaBrowser.Server.Implementations.Library return new Tuple(searchTerm, 3 + (i + 1) * (j + 1)); } - match = Regex.Match(item, searchTerm, RegexOptions.IgnoreCase); + index = item.IndexOf(searchTerm, StringComparison.OrdinalIgnoreCase); - if (match.Success) + if (index == 0) { - var index = match.Index; - - if (index == 0) - { - return new Tuple(searchTerm, 4 + (i + 1) * (j + 1)); - } - if (index > 0) - { - return new Tuple(searchTerm, 5 + (i + 1) * (j + 1)); - } + return new Tuple(searchTerm, 4 + (i + 1) * (j + 1)); + } + if (index > 0) + { + return new Tuple(searchTerm, 5 + (i + 1) * (j + 1)); } } } -- cgit v1.2.3