Package org.mycore.solr.search
Class MCRConditionTransformer
java.lang.Object
org.mycore.solr.search.MCRConditionTransformer
- Author:
- Thomas Scheffler (yagee), Jens Kupferschmidt
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.solr.client.solrj.SolrQuery
applySortOptions
(org.apache.solr.client.solrj.SolrQuery q, List<MCRSortBy> sortBy) static org.apache.solr.client.solrj.SolrQuery
buildMergedSolrQuery
(List<MCRSortBy> sortBy, boolean not, boolean and, HashMap<String, List<MCRCondition>> table, int maxHits, List<String> returnFields) Builds SOLR query.protected static MCRCondition
buildSubCondition
(List<MCRCondition> conditions, boolean and, boolean not) Builds a new condition for all fields from one single indexstatic boolean
static StringBuilder
getGTEQuery
(String field, String value) static StringBuilder
getGTQuery
(String field, String value) static String
static StringBuilder
getLTEQuery
(String field, String value) static StringBuilder
getLTQuery
(String field, String value) static StringBuilder
getPhraseQuery
(String field, String value) static String
getQueryString
(MCRCondition condition) static org.apache.solr.client.solrj.SolrQuery
getSolrQuery
(MCRCondition condition, List<MCRSortBy> sortBy, int maxResults, List<String> returnFields) static StringBuilder
getTermQuery
(String field, String value) static HashMap<String,
List<MCRCondition>> Build a table from index ID to a List of conditions referencing this indexstatic String
toSolrQueryString
(MCRCondition condition, Set<String> usedFields)
-
Field Details
-
MIXED
If a condition references fields from multiple indexes, this constant is returned- See Also:
-
-
Constructor Details
-
MCRConditionTransformer
public MCRConditionTransformer()
-
-
Method Details
-
toSolrQueryString
-
explicitAndOrMapping
public static boolean explicitAndOrMapping() -
getLTQuery
-
getLTEQuery
-
getGTQuery
-
getGTEQuery
-
getTermQuery
-
getPhraseQuery
-
getSolrQuery
public static org.apache.solr.client.solrj.SolrQuery getSolrQuery(MCRCondition condition, List<MCRSortBy> sortBy, int maxResults, List<String> returnFields) -
getQueryString
-
applySortOptions
-
buildMergedSolrQuery
public static org.apache.solr.client.solrj.SolrQuery buildMergedSolrQuery(List<MCRSortBy> sortBy, boolean not, boolean and, HashMap<String, List<MCRCondition>> table, int maxHits, List<String> returnFields) Builds SOLR query. Automatically builds JOIN-Query if content search fields are used in query.- Parameters:
sortBy
- sort criterianot
- true, if all conditions should be negatedand
- AND or OR connective between conditionstable
- conditions per "content" or "metadata"maxHits
- maximum hits
-
buildSubCondition
protected static MCRCondition buildSubCondition(List<MCRCondition> conditions, boolean and, boolean not) Builds a new condition for all fields from one single index -
groupConditionsByIndex
Build a table from index ID to a List of conditions referencing this index -
getIndex
-