Class ToParentBlockJoinSortField
A special sort field that allows sorting parent docs based on nested / child level fields. Based on the sort order it either takes the document with the lowest or highest field value into account.
Note
This API is experimental and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Search.Join
Assembly: Lucene.Net.Join.dll
Syntax
public class ToParentBlockJoinSortField : SortField
Constructors
ToParentBlockJoinSortField(string, SortFieldType, bool, Filter, Filter)
Create ToParentBlockJoinSortField. The parent document ordering is based on child document ordering (reverse).
Declaration
public ToParentBlockJoinSortField(string field, SortFieldType type, bool reverse, Filter parentFilter, Filter childFilter)
Parameters
Type | Name | Description |
---|---|---|
string | field | The sort field on the nested / child level. |
SortFieldType | type | The sort type on the nested / child level. |
bool | reverse | Whether natural order should be reversed on the nested / child level. |
Filter | parentFilter | Lucene.Net.Search.Filter that identifies the parent documents. |
Filter | childFilter | Lucene.Net.Search.Filter that defines which child documents participates in sorting. |
ToParentBlockJoinSortField(string, SortFieldType, bool, bool, Filter, Filter)
Create ToParentBlockJoinSortField.
Declaration
public ToParentBlockJoinSortField(string field, SortFieldType type, bool reverse, bool order, Filter parentFilter, Filter childFilter)
Parameters
Type | Name | Description |
---|---|---|
string | field | The sort field on the nested / child level. |
SortFieldType | type | The sort type on the nested / child level. |
bool | reverse | Whether natural order should be reversed on the nested / child document level. |
bool | order | Whether natural order should be reversed on the parent level. |
Filter | parentFilter | Lucene.Net.Search.Filter that identifies the parent documents. |
Filter | childFilter | Lucene.Net.Search.Filter that defines which child documents participates in sorting. |
Methods
GetComparer(int, int)
Returns the Lucene.Net.Search.FieldComparer to use for sorting.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public override FieldComparer GetComparer(int numHits, int sortPos)
Parameters
Type | Name | Description |
---|---|---|
int | numHits | Number of top hits the queue will store |
int | sortPos | Position of this Lucene.Net.Search.SortField within Lucene.Net.Search.Sort. The comparer is primary if sortPos==0, secondary if sortPos==1, etc. Some comparers can optimize themselves when they are the primary sort. |
Returns
Type | Description |
---|---|
FieldComparer | Lucene.Net.Search.FieldComparer to use when sorting |