Package org.elasticsearch.search.sort

Examples of org.elasticsearch.search.sort.FieldSortBuilder.order()


    /* integrate Query Sort */
    String queryText = query.getQueryText();
    if (query.getSortField() != null) {
      FieldSortBuilder sort = SortBuilders.fieldSort(query.getSortField().sortField());
      if (query.isAscendingSort()) {
        sort.order(SortOrder.ASC);
      } else {
        sort.order(SortOrder.DESC);
      }
      esSearch.addSort(sort);
    } else if (queryText != null && !queryText.isEmpty()) {
View Full Code Here


    if (query.getSortField() != null) {
      FieldSortBuilder sort = SortBuilders.fieldSort(query.getSortField().sortField());
      if (query.isAscendingSort()) {
        sort.order(SortOrder.ASC);
      } else {
        sort.order(SortOrder.DESC);
      }
      esSearch.addSort(sort);
    } else if (queryText != null && !queryText.isEmpty()) {
      esSearch.addSort(SortBuilders.scoreSort());
    } else {
View Full Code Here

      Boolean asc = query.asc();
      List<IndexField> fields = toIndexFields(sortField);
      for (IndexField field : fields) {
        FieldSortBuilder sortBuilder = SortBuilders.fieldSort(field.sortField());
        if (asc != null && asc) {
          sortBuilder.order(SortOrder.ASC);
        } else {
          sortBuilder.order(SortOrder.DESC);
        }
        esSearch.addSort(sortBuilder);
      }
View Full Code Here

      for (IndexField field : fields) {
        FieldSortBuilder sortBuilder = SortBuilders.fieldSort(field.sortField());
        if (asc != null && asc) {
          sortBuilder.order(SortOrder.ASC);
        } else {
          sortBuilder.order(SortOrder.DESC);
        }
        esSearch.addSort(sortBuilder);
      }
    } else {
      esSearch.addSort(IssueNormalizer.IssueField.ISSUE_UPDATED_AT.sortField(), SortOrder.DESC);
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.