public class LuceneUtils extends Object
| Constructor and Description |
|---|
LuceneUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
extractLanguageOrNullFrom(String fieldName)
Extracts a language code from the specified field name if one is there to be found or
null otherwise. |
static String |
extractLanguageOrNullFromStatement(String statement)
Extracts the language code that might be available in the form of a
jcr:language constraint from the given query statement. |
static String |
getFullTextFieldName(String siteName,
String language)
Retrieves the name used for full text fields for the specified site name and language.
|
public static final String DASH
public static String getFullTextFieldName(String siteName, String language)
siteName - language - public static String extractLanguageOrNullFrom(String fieldName)
null otherwise. Note that
the way how field names are currently encoded might result in false positives.fieldName - public static String extractLanguageOrNullFromStatement(String statement)
jcr:language constraint from the given query statement.
More specifically, the following cases should be properly handled:
jcr:language = 'en' (in that case analyzer should be English)jcr:language = "en" (in that case analyzer should be English)jcr:language is null (in that case analyzer cannot be determined by query language - take the default)jcr:language is null and jcr:language = 'en' (in that case the query language specific analyzer should be English, but it is set only on the second
jcr:language constraint)jcr:language <> 'en' (in that case analyzer cannot be determined by query language - take the default)jcr:language = 'fr' or jcr:language='en' (in that case analyzer can also not be determined by query language - take the default)([jcr:language] = "en" or [jcr:language] is null) and [someOtherProperty] = "test" statement - the query statement from which to extract a potential language codenull otherwise.Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.