* @throws ParseException
* @throws QueryNodeException
*/
public static Query getCswServiceSpecificConstraintQuery(String cswServiceSpecificConstraint, LuceneConfig _luceneConfig) throws ParseException, QueryNodeException {
// MultiFieldQueryParser parser = new MultiFieldQueryParser(Geonet.LUCENE_VERSION, fields , SearchManager.getAnalyzer());
StandardQueryParser parser = new StandardQueryParser(SearchManager.getAnalyzer());
Map<String, NumericConfig> numericMap = new HashMap<String, NumericConfig>();
for (LuceneConfigNumericField field : _luceneConfig.getNumericFields().values()) {
String name = field.getName();
int precisionStep = field.getPrecisionStep();
NumberFormat format = NumberFormat.getNumberInstance();
NumericType type = NumericType.valueOf(field.getType().toUpperCase());
NumericConfig config = new NumericConfig(precisionStep, format, type);
numericMap.put(name, config);
}
parser.setNumericConfigMap(numericMap);
Query q = parser.parse(cswServiceSpecificConstraint, "title");
// List of lucene fields which MUST not be control by user, to be removed from the CSW service specific constraint
List<String> SECURITY_FIELDS = Arrays.asList(
LuceneIndexField.OWNER,
LuceneIndexField.GROUP_OWNER);