diff --git a/core/src/main/groovy/com/muwire/core/Constants.groovy b/core/src/main/groovy/com/muwire/core/Constants.groovy index 07724708..d09f572b 100644 --- a/core/src/main/groovy/com/muwire/core/Constants.groovy +++ b/core/src/main/groovy/com/muwire/core/Constants.groovy @@ -11,5 +11,5 @@ class Constants { public static final float DOWNLOAD_SEQUENTIAL_RATIO = 0.8f - public static final String SPLIT_PATTERN = "[\\+-,\\.:;\\(\\)=_/\\\\\\!\\\"\\\'\\\$%\\|]" + public static final String SPLIT_PATTERN = "[\\+\\-,\\.:;\\(\\)=_/\\\\\\!\\\"\\\'\\\$%\\|]" } diff --git a/core/src/test/groovy/com/muwire/core/search/SearchIndexTest.groovy b/core/src/test/groovy/com/muwire/core/search/SearchIndexTest.groovy index 1363f9af..3fef0800 100644 --- a/core/src/test/groovy/com/muwire/core/search/SearchIndexTest.groovy +++ b/core/src/test/groovy/com/muwire/core/search/SearchIndexTest.groovy @@ -83,4 +83,11 @@ class SearchIndexTest { assert found.size() == 1 assert found.contains("b c.d") } + + @Test + void testDuplicateTerm() { + initIndex(["MuWire-0.3.3.jar"]) + def found = index.search(["muwire", "0", "3", "jar"]) + assert found.size() == 1 + } }