Lucene.Net.QueryParsers.QueryParser.getDateResolution C# (CSharp) Method

getDateResolution() public method

Returns the date resolution that is used by RangeQueries for the given field. Returns null, if no default or field specific date resolution has been set for the given field.
public getDateResolution ( String fieldName ) : Lucene.Net.Documents.DateTools.Resolution
fieldName String
return Lucene.Net.Documents.DateTools.Resolution
        public virtual DateTools.Resolution getDateResolution(String fieldName)
        {
            if (fieldName == null)
            {
                throw new ArgumentException("Field cannot be null.");
            }

            if (fieldToDateResolution == null)
            {
                // no field specific date resolutions set; return default date resolution instead
                return this.dateResolution;
            }

            DateTools.Resolution resolution = fieldToDateResolution[fieldName];
            if (resolution == null)
            {
                // no date resolutions set for the given field; return default date resolution instead
                resolution = this.dateResolution;
            }

            return resolution;
        }