Exemple #1
0
  public static List<String> getValidFieldNamesSubset(Collection<String> fieldNames) {
    List<String> fieldNamesSubset = new ArrayList<String>();

    for (String fieldName : fieldNames) {
      if (!ignoreFieldName(fieldName, Arrays.asList(ID))) {
        fieldNamesSubset.add(fieldName);
      }
    }
    Collections.sort(fieldNamesSubset);
    return fieldNamesSubset;
  }
Exemple #2
0
 public static List<SolrQuery.SortClause> getSortClauses(String sortInfo, String sortOrder) {
   if (sortInfo == null) {
     return null;
   }
   if (sortOrder == null || sortInfo.contains(SORT_FIELD_REQ_DELIM)) {
     return getSortClauses(sortInfo);
   }
   List<SolrQuery.SortClause> sortClauses = new ArrayList<SolrQuery.SortClause>();
   sortClauses.add(new SolrQuery.SortClause(sortInfo, sortOrder));
   return sortClauses;
 }
Exemple #3
0
  public static List<SolrQuery.SortClause> getSortClauses(String sortInfo) {
    List<SolrQuery.SortClause> sortClauses = new ArrayList<SolrQuery.SortClause>();

    if (sortInfo == null) {
      sortClauses.add(SORT_CLAUSE);
    } else {
      for (String sortClauseData : sortInfo.split(SORT_FIELD_REQ_DELIM)) {
        if (nullOrEmpty(sortClauseData)) continue;

        Matcher m = SORT_PATTERN.matcher(sortClauseData);
        if (m.matches()) {
          sortClauses.add(new SolrQuery.SortClause(m.group(1), getSortOrder(m.group(2))));
        }
      }
    }
    return sortClauses;
  }
Exemple #4
0
 private static String getFQDateString(String dateString) {
   List<String> dates = Arrays.asList(dateString.split(FACET_DATE_RANGE_REQ_DELIM));
   return "[" + getFQDate(dates.get(0)) + " TO " + getFQDate(dates.get(1)) + "]";
 }