Example usage for org.apache.lucene.search SortField hashCode

List of usage examples for org.apache.lucene.search SortField hashCode

Introduction

In this page you can find the example usage for org.apache.lucene.search SortField hashCode.

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns a hash code for this SortField instance.

Usage

From source file:org.apache.solr.search.join.TestNestedDocsSort.java

License:Apache License

private void assertEq(SortField sortField, SortField sortField2) {
    assertEquals(sortField, sortField2);
    assertEquals(sortField.hashCode(), sortField2.hashCode());
}

From source file:org.apache.solr.search.QueryResultKey.java

License:Apache License

public QueryResultKey(Query query, List<Query> filters, Sort sort, int nc_flags) {
    this.query = query;
    this.sort = sort;
    this.filters = filters;
    this.nc_flags = nc_flags;

    int h = query.hashCode();

    if (filters != null) {
        for (Query filt : filters)
            h += filt.hashCode();//from w w  w  .j a v a2 s .co  m
    }

    sfields = (this.sort != null) ? this.sort.getSort() : defaultSort;
    for (SortField sf : sfields) {
        h = h * 29 + sf.hashCode();
    }

    hc = h;
}