Esri Geoportal Server
1.0

com.esri.gpt.catalog.lucene
Class SpatialRankingValueSource

java.lang.Object
  extended by org.apache.lucene.search.function.ValueSource
      extended by com.esri.gpt.catalog.lucene.SpatialRankingValueSource
All Implemented Interfaces:
Serializable

public class SpatialRankingValueSource
extends ValueSource

An implementation of the Lucene ValueSource model to support spatial relevance ranking.

The algorithm is implemented as envelope on envelope overlays rather than complex polygon on complex polygon overlays.

Spatial relevance scoring algorithm:
queryArea = the area of the input query envelope
targetArea = the area of the target envelope (per Lucene document)
intersectionArea = the area of the intersection for the query/target envelopes
queryPower = the weighting power associated with the query envelope (default = 1.0)
targetPower = the weighting power associated with the target envelope (default = 1.0)
queryPower and targetPower are initialized from gpt.xml configuration parameters:
/gptConfig/catalog/parameter@key="spatialRelevance.queryPower" and
/gptConfig/catalog/parameter@key="spatialRelevance.queryPower"
queryRatio = intersectionArea / queryArea;
targetRatio = intersectionArea / targetArea;
queryFactor = Math.pow(queryRatio,queryPower);
targetFactor = Math.pow(targetRatio,targetPower);
score = queryFactor * targetFactor;

See Also:
Serialized Form

Constructor Summary
SpatialRankingValueSource(Envelope queryEnvelope, double queryPower, double targetPower)
          Constructor.
 
Method Summary
 String description()
          Returns the ValueSource description.
 boolean equals(Object o)
          Determines if this ValueSource is equal to another.
 String getDelimiterQueryParameters()
          Returns the delimited query parameters.
 DocValues getValues(IndexReader reader)
          Returns the DocValues used by the function query.
 int hashCode()
          Returns the ValueSource hash code.
 
Methods inherited from class org.apache.lucene.search.function.ValueSource
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpatialRankingValueSource

public SpatialRankingValueSource(Envelope queryEnvelope,
                                 double queryPower,
                                 double targetPower)
Constructor.

Parameters:
queryEnvelope - the query envelope
queryPower - the query power (scoring algorithm)
targetPower - the target power (scoring algorithm)
Method Detail

description

public String description()
Returns the ValueSource description.

Specified by:
description in class ValueSource
Returns:
the description

equals

public boolean equals(Object o)
Determines if this ValueSource is equal to another.

Specified by:
equals in class ValueSource
Parameters:
o - the ValueSource to compare
Returns:
true if the two objects are based upon the same query envelope

getDelimiterQueryParameters

public String getDelimiterQueryParameters()
Returns the delimited query parameters.
Applies to ValueSource.equals and ValueSource.hashCode.

Returns:
the delimited parameters

getValues

public DocValues getValues(IndexReader reader)
                    throws IOException
Returns the DocValues used by the function query.

Specified by:
getValues in class ValueSource
Parameters:
reader - the index reader
Returns:
the values
Throws:
IOException

hashCode

public int hashCode()
Returns the ValueSource hash code.

Specified by:
hashCode in class ValueSource
Returns:
the hash code

Esri Geoportal Server
1.0

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