Examples of ScoreSort


Examples of com.flaptor.hounder.searcher.sort.ScoreSort

  private ASort generateSingleSort(final Vector vec, final ASort subSort) {
    String name = (String) vec.elementAt(0);
    ASort sort;
    if (name.equals("SORT-BY-RELEVANCE")) {
      if (null == subSort) {
        sort = new ScoreSort();
      } else {
        sort = new ScoreSort(subSort);
      }
    } else {
      String reverse = (String) vec.elementAt(1);
      String typeStr = (String) vec.elementAt(2);
      FieldSort.OrderType type = FieldSort.OrderType.STRING;
View Full Code Here

Examples of com.flaptor.hounder.searcher.sort.ScoreSort

        // orderBy param
        ASort sort = null;
        String orderByParam = getParameter(params,"orderBy");
        if ((orderByParam != null) && !"".equals(orderByParam)) {
            String[] sortingCriteria = orderByParam.split(",");
            sort = new ScoreSort();
            for (int i = (sortingCriteria.length-1); i >= 0; i--) {
                String sortingCriterion = sortingCriteria[i];
                String parts[] = sortingCriterion.split(":");
                String sortField = parts[0];
                FieldSort.OrderType orderType = FieldSort.OrderType.STRING;
                boolean reverse = false;
                for (int p = 1; p < parts.length; p++) {
                  String part = parts[p].toLowerCase();
                  if ("reverse".equals(part) || "reversed".equals(part)) {
                    reverse = true;
                    continue;
                  }
                  if ("int".equals(part)) {
                    orderType = FieldSort.OrderType.INT;
                    continue;
                  }
                  if ("long".equals(part)) {
                    orderType = FieldSort.OrderType.LONG;
                    continue;
                  }
                    if ("float".equals(part)) {
                    orderType = FieldSort.OrderType.FLOAT;
                    continue;
                  }
                }
                if ("score".equals(sortField)) {
                    sort = new ScoreSort();
                } else {
                    sort = new FieldSort(reverse, sortField, orderType, sort);
                }
            }
        }
View Full Code Here

Examples of com.flaptor.hounder.searcher.sort.ScoreSort

        // orderBy param
        ASort sort = null;
        String orderByParam = getParameter(params,"orderBy");
        if ((orderByParam != null) && !"".equals(orderByParam)) {
            String[] sortingCriteria = orderByParam.split(",");
            sort = new ScoreSort();
            for (int i = (sortingCriteria.length-1); i >= 0; i--) {
                String sortingCriterion = sortingCriteria[i];
                String parts[] = sortingCriterion.toLowerCase().split(":");
                String sortField = parts[0];
                FieldSort.OrderType orderType = FieldSort.OrderType.STRING;
                boolean reverse = false;
                for (int p = 1; p < parts.length; p++) {
                  String part = parts[p];
                  if ("reverse".equals(part) || "reversed".equals(part)) {
                    reverse = true;
                    continue;
                  }
                  if ("int".equals(part)) {
                    orderType = FieldSort.OrderType.INT;
                    continue;
                  }
                  if ("long".equals(part)) {
                    orderType = FieldSort.OrderType.LONG;
                    continue;
                  }
                    if ("float".equals(part)) {
                    orderType = FieldSort.OrderType.FLOAT;
                    continue;
                  }
                }
                if ("score".equals(sortField)) {
                    sort = new ScoreSort();
                } else {
                    sort = new FieldSort(reverse, sortField, orderType, sort);
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.