Table of Contents

Class DateTimeType

Namespace
Examine.Lucene.Indexing
Assembly
Examine.Lucene.dll

Represents a DateTime IndexFieldRangeValueType<T>

public class DateTimeType : IndexFieldRangeValueType<DateTime>, IIndexFieldValueType, IIndexRangeValueType<DateTime>, IIndexRangeValueType, IIndexFacetValueType
Inheritance
DateTimeType
Implements
Inherited Members

Constructors

DateTimeType(string, ILoggerFactory, DateResolution, bool)

[Obsolete("To be removed in Examine V5")]
public DateTimeType(string fieldName, ILoggerFactory logger, DateResolution resolution, bool store = true)

Parameters

fieldName string
logger ILoggerFactory
resolution DateResolution
store bool

DateTimeType(string, bool, bool, bool, ILoggerFactory, DateResolution)

public DateTimeType(string fieldName, bool store, bool isFacetable, bool taxonomyIndex, ILoggerFactory logger, DateResolution resolution)

Parameters

fieldName string
store bool
isFacetable bool
taxonomyIndex bool
logger ILoggerFactory
resolution DateResolution

Properties

IsTaxonomyFaceted

Whether the Field is indexed in the Taxonomy Index

public bool IsTaxonomyFaceted { get; }

Property Value

bool

Resolution

Specifies date granularity

public DateResolution Resolution { get; }

Property Value

DateResolution

SortableFieldName

Can be sorted by the normal field name

public override string SortableFieldName { get; }

Property Value

string

Methods

AddSingleValue(Document, object)

Adds a single value to the document

protected override void AddSingleValue(Document doc, object value)

Parameters

doc Document
value object

AddValue(Document, object?)

Adds a value to the document

public override void AddValue(Document doc, object? value)

Parameters

doc Document
value object

DateToLong(DateTime)

Returns the ticks to be indexed, then use NumericRangeQuery to query against it

protected long DateToLong(DateTime date)

Parameters

date DateTime

Returns

long

ExtractFacets(IFacetExtractionContext, IFacetField)

Extracts the facets from the field

public virtual IEnumerable<KeyValuePair<string, IFacetResult>> ExtractFacets(IFacetExtractionContext facetExtractionContext, IFacetField field)

Parameters

facetExtractionContext IFacetExtractionContext
field IFacetField

Returns

IEnumerable<KeyValuePair<string, IFacetResult>>

A dictionary of facets for this field

GetQuery(DateTime?, DateTime?, bool, bool)

Gets a query as Lucene.Net.Search.Query

public override Query GetQuery(DateTime? lower, DateTime? upper, bool lowerInclusive = true, bool upperInclusive = true)

Parameters

lower DateTime?
upper DateTime?
lowerInclusive bool
upperInclusive bool

Returns

Query

GetQuery(string)

By default returns a Lucene.Net.Search.TermQuery

public override Query? GetQuery(string query)

Parameters

query string

Returns

Query