org.apache.solr.client.solrj
public static class SolrQuery.SortClause extends Object implements Serializable
The item specified can be "anything sortable" by solr; some examples
include a simple field name, the constant string score
, and functions
such as sum(x_f, y_f)
.
A SortClause can be created through different mechanisms:
new SortClause("product", SolrQuery.ORDER.asc);
new SortClause("product", "asc");
SortClause.asc("product");
SortClause.desc("product");
Constructor and Description |
---|
SolrQuery.SortClause(String item,
SolrQuery.ORDER order)
Creates a SortClause based on item and order
|
SolrQuery.SortClause(String item,
String order)
Creates a SortClause based on item and order
|
Modifier and Type | Method and Description |
---|---|
static SolrQuery.SortClause |
asc(String item)
Creates an ascending SortClause for an item
|
static SolrQuery.SortClause |
create(String item,
SolrQuery.ORDER order)
Creates an ascending SortClause for an item
|
static SolrQuery.SortClause |
create(String item,
String order)
Creates a SortClause based on item and order
|
static SolrQuery.SortClause |
desc(String item)
Creates a decending SortClause for an item
|
boolean |
equals(Object other) |
String |
getItem()
Gets the item to sort, typically a function or a fieldname
|
SolrQuery.ORDER |
getOrder()
Gets the order to sort
|
int |
hashCode() |
String |
toString()
Gets a human readable description of the sort clause.
|
public SolrQuery.SortClause(String item, SolrQuery.ORDER order)
item
- item to sort onorder
- direction to sortpublic static SolrQuery.SortClause create(String item, SolrQuery.ORDER order)
item
- item to sort onpublic static SolrQuery.SortClause create(String item, String order)
item
- item to sort onorder
- string value for direction to sortpublic static SolrQuery.SortClause asc(String item)
item
- item to sort onpublic static SolrQuery.SortClause desc(String item)
item
- item to sort onpublic String getItem()
public SolrQuery.ORDER getOrder()
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.