Exemplo n.º 1
0
 public static String getSolrLukeURI(String collection) {
   HashMap<String, String> urlParams =
       new HashMap<String, String>() {
         {
           put("wt", "json");
         }
       };
   String uri = getSolrServerURI(collection);
   return uri != null ? constructAddress(uri, Arrays.asList(LUKE_ENDPOINT), urlParams) : null;
 }
Exemplo n.º 2
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;
  }
Exemplo n.º 3
0
  public static String getSolrSchemaURI(String collection) {
    HashMap<String, String> urlParams =
        new HashMap<String, String>() {
          {
            put(CONTENT_TYPE_HEADER, XML_CONTENT_TYPE);
            put(CHARSET_ENC_KEY, UTF8);
            put(FILE, SOLR_SCHEMA_FILE);
          }
        };

    String uri = getSolrServerURI(collection);
    return uri != null
        ? constructAddress(uri, Arrays.asList(collection, "admin", "file"), urlParams)
        : null;
  }
Exemplo n.º 4
0
 public static List<SolrQuery.SortClause> createSortClauseList(
     String sortField, SolrQuery.ORDER sortOrder) {
   sortField = returnIfNotNull(sortField, SORT_FIELD_DEFAULT);
   sortOrder = returnIfNotNull(sortOrder, SORT_ORDER);
   return Arrays.asList(new SolrQuery.SortClause(sortField, sortOrder));
 }
Exemplo n.º 5
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)) + "]";
 }