mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merge V1.2.0 BRANCH to HEAD
svn merge -r 2519:2565 svn://www.alfresco.org/alfresco/BRANCHES/V1.2.0/root HEAD/root git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2566 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -49,6 +49,16 @@ public class SearchLanguageConversion
|
||||
* Lucene syntax summary: {@link QueryParser#escape(String) Lucene Query Parser}
|
||||
*/
|
||||
public static LanguageDefinition DEF_LUCENE = new LuceneLanguageDef();
|
||||
/**
|
||||
* CIFS name patch query language summary:
|
||||
* <ul>
|
||||
* <li>Escape: \ (but not used)</li>
|
||||
* <li>Single char search: ?</li>
|
||||
* <li>Multiple char search: *</li>
|
||||
* <li>Reserved: "*\<>?/:|£%&+;</li>
|
||||
* </ul>
|
||||
*/
|
||||
public static LanguageDefinition DEF_CIFS = new SimpleLanguageDef('\\', "*", "?", "\"*\\<>?/:|£%&+;");
|
||||
|
||||
/**
|
||||
* Escape a string according to the <b>XPath</b> like function syntax.
|
||||
@@ -128,6 +138,18 @@ public class SearchLanguageConversion
|
||||
return convert(DEF_XPATH_LIKE, DEF_LUCENE, xpathLikeClause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a <b>CIFS</b> name path into the equivalent <b>Lucene</b> query.
|
||||
*
|
||||
* @param cifsNamePath the CIFS named path
|
||||
* @return Returns a valid <b>Lucene</b> expression that is equivalent to the
|
||||
* given CIFS name path
|
||||
*/
|
||||
public static String convertCifsToLucene(String cifsNamePath)
|
||||
{
|
||||
return convert(DEF_CIFS, DEF_LUCENE, cifsNamePath);
|
||||
}
|
||||
|
||||
public static String convert(LanguageDefinition from, LanguageDefinition to, String query)
|
||||
{
|
||||
char[] chars = query.toCharArray();
|
||||
|
Reference in New Issue
Block a user