public abstract class DocProperty extends Object implements ResultProperty<DocResult>
Modifier and Type | Field and Description |
---|---|
protected static org.apache.logging.log4j.Logger |
logger |
protected boolean |
reverse
Reverse comparison result or not?
|
Modifier | Constructor and Description |
---|---|
protected |
DocProperty() |
protected |
DocProperty(DocProperty prop,
boolean invert) |
Modifier and Type | Method and Description |
---|---|
boolean |
canConstructQuery(BlackLabIndex index,
PropertyValue value)
Can we create a query matching the specified value for our property?
|
int |
compare(DocResult a,
DocResult b)
Compares two docs on this property
|
static DocProperty |
deserialize(BlackLabIndex index,
String serialized) |
boolean |
equals(Object obj) |
abstract PropertyValue |
get(DocResult result)
Get the desired grouping/sorting property from the DocResult object
|
static void |
getFacetsUrlParam(Map<String,String> param,
List<DocProperty> facets) |
int |
hashCode() |
boolean |
isReverse()
Is the comparison reversed?
|
abstract String |
name()
Get the name of the property
|
abstract org.apache.lucene.search.Query |
query(BlackLabIndex index,
PropertyValue value)
Generate a query matching the specified value for our property.
|
abstract DocProperty |
reverse()
Reverse the comparison.
|
abstract String |
serialize()
Serialize this HitProperty so we can deserialize it later (to pass it via
URL, for example)
|
String |
serializeReverse()
Used by subclasses to add a dash for reverse when serializing
|
protected boolean |
sortDescendingByDefault()
Is the default for this property to sort descending?
This is usually a good default for "group size" or "number of hits".
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
ignoreSensitivity, isCompound, propNames, props
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
protected static final org.apache.logging.log4j.Logger logger
protected boolean reverse
protected DocProperty(DocProperty prop, boolean invert)
protected DocProperty()
protected boolean sortDescendingByDefault()
public abstract PropertyValue get(DocResult result)
get
in interface ResultProperty<DocResult>
result
- the result to get the grouping property forpublic int compare(DocResult a, DocResult b)
compare
in interface Comparator<DocResult>
compare
in interface ResultProperty<DocResult>
a
- first docb
- second docpublic abstract String name()
ResultProperty
name
in interface ResultProperty<DocResult>
public abstract String serialize()
ResultProperty
serialize
in interface ResultProperty<DocResult>
public String serializeReverse()
serializeReverse
in interface ResultProperty<DocResult>
public static DocProperty deserialize(BlackLabIndex index, String serialized)
public boolean isReverse()
isReverse
in interface ResultProperty<DocResult>
public abstract DocProperty reverse()
reverse
in interface ResultProperty<DocResult>
public String toString()
toString
in interface ResultProperty<DocResult>
toString
in class Object
public static void getFacetsUrlParam(Map<String,String> param, List<DocProperty> facets)
public int hashCode()
hashCode
in interface ResultProperty<DocResult>
hashCode
in class Object
public boolean equals(Object obj)
equals
in interface Comparator<DocResult>
equals
in interface ResultProperty<DocResult>
equals
in class Object
public abstract org.apache.lucene.search.Query query(BlackLabIndex index, PropertyValue value)
index
- our index (for finding field properties such as tokenized or not, analyzer, unknown value)value
- value to matchpublic boolean canConstructQuery(BlackLabIndex index, PropertyValue value)
index
- our index (for finding field properties such as tokenized or not, analyzer, unknown value)value
- value to matchCopyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.