Esri Geoportal Server
1.0

com.esri.gpt.catalog.lucene
Class LongField

java.lang.Object
  extended by com.esri.gpt.catalog.lucene.DatastoreField
      extended by com.esri.gpt.catalog.lucene.LongField

public class LongField
extends DatastoreField

A non-tokenized field that allows for Long value comparison.


Constructor Summary
protected LongField(String name)
          Constructs with a supplied name.
 
Method Summary
protected static Long longFromIndexableString(String value)
          Reverts an indexable String back to a long value.
protected static String longToIndexableString(Long value)
          Converts a long value to a String that can be indexed for search.
protected  Fieldable makeFieldable(Object value)
          Makes the fieldable to index.
protected  Query makeRangeQuery(String literalLowerValue, String literalUpperValue, boolean lowerBoundaryIsInclusive, boolean upperBoundaryIsInclusive)
          Makes a range query.
protected  String makeValueToQuery(String value, boolean isLowerBoundary, boolean isUpperBoundary)
          Makes the value to query.
protected  Object makeValueToReturn(String storedValue)
          Makes the value to return in the query result.
protected  int sortFieldType()
          Returns the sort field type.
 
Methods inherited from class com.esri.gpt.catalog.lucene.DatastoreField
appendForWrite, getIndexingOption, getName, getStorageOption, getTermVectorOption, setIndexingOption, setName, setStorageOption, setTermVectorOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongField

protected LongField(String name)
Constructs with a supplied name.

Parameters:
name - the field name
Method Detail

longFromIndexableString

protected static Long longFromIndexableString(String value)
Reverts an indexable String back to a long value.

Parameters:
value - the indexable string to revert
Returns:
the long value

longToIndexableString

protected static String longToIndexableString(Long value)
Converts a long value to a String that can be indexed for search.

Parameters:
value - the value to convert
Returns:
the indexable string

makeFieldable

protected Fieldable makeFieldable(Object value)
Makes the fieldable to index.

Overrides:
makeFieldable in class DatastoreField
Parameters:
value - the value
Returns:
the fieldable

makeRangeQuery

protected Query makeRangeQuery(String literalLowerValue,
                               String literalUpperValue,
                               boolean lowerBoundaryIsInclusive,
                               boolean upperBoundaryIsInclusive)
                        throws DiscoveryException
Makes a range query.

Overrides:
makeRangeQuery in class DatastoreField
Parameters:
literalLowerValue - the literal lower boundary value
literalUpperValue - the literal upper boundary value
lowerBoundaryIsInclusive - (>= versus >)
upperBoundaryIsInclusive - (<= versus <)
Returns:
the value to query
Throws:
DiscoveryException - if a supplied value cannot be converted

makeValueToQuery

protected String makeValueToQuery(String value,
                                  boolean isLowerBoundary,
                                  boolean isUpperBoundary)
                           throws DiscoveryException
Makes the value to query.
The value to query is derived from NumericUtils.longToPrefixCoded().

Overrides:
makeValueToQuery in class DatastoreField
Parameters:
value - to input query value
isLowerBoundary - true if this is a lower boundary of a range query
isUpperBoundary - true if this is a upper boundary of a range query
Returns:
the value to query
Throws:
DiscoveryException - if the supplied value cannot be converted

makeValueToReturn

protected Object makeValueToReturn(String storedValue)
Makes the value to return in the query result.

Overrides:
makeValueToReturn in class DatastoreField
Parameters:
storedValue - the value stored within the Lucene document
Returns:
the associated object value

sortFieldType

protected int sortFieldType()
Returns the sort field type.

Overrides:
sortFieldType in class DatastoreField
Returns:
the sort field type (SortField.LONG)

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.