Examples of SortField


Examples of org.apache.lucene.search.SortField

    public TopDocs getRecentCategoryDocuments(String category, int maxDocument) throws EventSearchServiceException, IllegalArgumentException {
        if (!EventCategory.isValidCategoryName(category)) {
            throw new IllegalArgumentException("Unknown category");
        }
        Query query = new TermQuery(new Term("CATEGORY", category));
        Sort sort = new Sort(new SortField("CREATED-AT", SortField.STRING, true));
        try {
            return indexSearcher.search(query, null, maxDocument, sort);
        } catch (IOException e) {
            throw new EventSearchServiceException(e);
        }
View Full Code Here

Examples of org.apache.lucene.search.SortField

            // TODO: このへんの定数なんとかするべき。いろんなところに散らばっていて使いにくい。

            Sort sort;
            if ("score".equals(sortOrder)) {
                sort = new Sort(SortField.FIELD_SCORE, new SortField("BEGIN-TIME", SortField.STRING));
            } else if ("createdAt".equals(sortOrder)) {
                sort = new Sort(new SortField("CREATED-AT", SortField.STRING, true));
            } else if ("deadline".equals(sortOrder)) {
                sort = new Sort(new SortField("DEADLINE-TIME", SortField.STRING));
            } else if ("deadline-r".equals(sortOrder)) {
                sort = new Sort(new SortField("DEADLINE-TIME", SortField.STRING, true));
            } else if ("beginDate".equals(sortOrder)) {
                sort = new Sort(new SortField("BEGIN-TIME", SortField.STRING));
            } else if ("beginDate-r".equals(sortOrder)) {
                sort = new Sort(new SortField("BEGIN-TIME", SortField.STRING, true));
            } else {
                // 決まってない場合は、score 順にする。
                sort = new Sort(SortField.FIELD_SCORE, new SortField("BEGIN-TIME", SortField.STRING));
            }

            return indexSearcher.search(query, filter, maxDocument, sort);
        } catch (IOException e) {
            throw new EventSearchServiceException(e);
View Full Code Here

Examples of org.mybatis.pagination.dto.datatables.SortField

            sSortDir = httpRequest.getParameter(S_SORT_DIR + colCount);
            sColName = httpRequest.getParameter(S_DATA_PROP + sSortCol);
            sColName = humpSplit
                    ? CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sColName)
                    : sColName;
            sortFields.add(new SortField(sColName, sSortDir));
        }
        return sortFields;
    }
View Full Code Here

Examples of org.richfaces.model.SortField

    SortField[] sortFields = sortOrder.getFields();
   
    expressions = new Expression[sortFields.length];
                                
    for (int i = 0; i < sortFields.length; i++) {
      final SortField field = sortFields[i];
      final String name = field.getName();
     
      if (ELUtils.isValueReference(name)) {
       
        expressions[i] = new ValueBindingExpression(context, name, var);
       
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.