From 63baa5cc4709694b15be165b597a2a3200b425c0 Mon Sep 17 00:00:00 2001 From: Patrick Schmitz Date: Sat, 3 Dec 2011 00:29:30 +0000 Subject: [PATCH] CSPACE-4302 Add support for booleans (AND, OR, NOT) and phrase search (latter waiting for update from nuxeo). --- .../query/nuxeo/QueryManagerNuxeoImpl.java | 79 ++++++++++++++++++- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/services/common/src/main/java/org/collectionspace/services/common/query/nuxeo/QueryManagerNuxeoImpl.java b/services/common/src/main/java/org/collectionspace/services/common/query/nuxeo/QueryManagerNuxeoImpl.java index 242f715b3..151f745fb 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/query/nuxeo/QueryManagerNuxeoImpl.java +++ b/services/common/src/main/java/org/collectionspace/services/common/query/nuxeo/QueryManagerNuxeoImpl.java @@ -29,6 +29,7 @@ package org.collectionspace.services.common.query.nuxeo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.regex.Matcher; import java.util.regex.Pattern; import org.nuxeo.ecm.core.api.DocumentModel; @@ -61,10 +62,10 @@ public class QueryManagerNuxeoImpl implements IQueryManager { // words private static Pattern nonWordChars = Pattern .compile("[^\\p{L}\\p{M}\\p{N}_']"); + private static Pattern kwdTokenizer = Pattern.compile("(?:(['\"])(.*?)(?\\\\\\\\)*\\1|([^ ]+))"); private static Pattern unescapedDblQuotes = Pattern.compile("(?