org.eaglei.search.provider
Class SearchResultRankMerger

java.lang.Object
  extended by org.eaglei.search.provider.SearchResultRankMerger
All Implemented Interfaces:
org.eaglei.search.provider.SearchProvider

public class SearchResultRankMerger
extends java.lang.Object
implements org.eaglei.search.provider.SearchProvider

Trivial implementation of SearchResultMerger that uses result rank. Also trims the results sets to the specified range. NOTE: the rank across result sets is not in most cases comparable.

Author:
rfrost

Field Summary
static java.lang.String DEFAULT_TRIM_TO_RANGE_PROP
          Default value of the trim to range property.
static float POSITION_DECREMENT
          Amount that the result rank is decremented for each position in the order.
static java.lang.String TRIM_TO_RANGE_PROP
          System property that controls whether the merger trims results to the paginated range.
 
Constructor Summary
SearchResultRankMerger(org.eaglei.search.provider.MultiNodeSearchProvider nestedProvider)
           
 
Method Summary
 org.eaglei.search.provider.SearchCounts count(org.eaglei.search.provider.SearchCountRequest request)
           
 org.eaglei.search.provider.ClassCountResult getProviderTypeCount(org.eaglei.search.provider.SearchRequest request)
           
 org.eaglei.search.provider.ClassCountResult getResourceCount(org.eaglei.search.provider.SearchRequest request)
           
 boolean getTrimToRange()
           
 void init()
           
 org.eaglei.search.provider.SearchResultSet query(org.eaglei.search.provider.SearchRequest request)
           
 void setTrimToRange(boolean trimToRange)
          Sets the flag that controls whether the returned SearchResultSet is trimmed to the range specified in the SearchRequest or whether all merged results are returned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRIM_TO_RANGE_PROP

public static final java.lang.String TRIM_TO_RANGE_PROP
System property that controls whether the merger trims results to the paginated range.

See Also:
Constant Field Values

DEFAULT_TRIM_TO_RANGE_PROP

public static final java.lang.String DEFAULT_TRIM_TO_RANGE_PROP
Default value of the trim to range property.

See Also:
Constant Field Values

POSITION_DECREMENT

public static final float POSITION_DECREMENT
Amount that the result rank is decremented for each position in the order.

See Also:
Constant Field Values
Constructor Detail

SearchResultRankMerger

public SearchResultRankMerger(org.eaglei.search.provider.MultiNodeSearchProvider nestedProvider)
Method Detail

setTrimToRange

public void setTrimToRange(boolean trimToRange)
Sets the flag that controls whether the returned SearchResultSet is trimmed to the range specified in the SearchRequest or whether all merged results are returned. In both cases, the SearchRequest range is used when calling the nested SearchProvider.

Parameters:
trimToRange - True to trim merged results.

getTrimToRange

public boolean getTrimToRange()
See Also:
setTrimToRange(boolean)

init

public void init()
          throws java.io.IOException
Specified by:
init in interface org.eaglei.search.provider.SearchProvider
Throws:
java.io.IOException

count

public org.eaglei.search.provider.SearchCounts count(org.eaglei.search.provider.SearchCountRequest request)
                                              throws java.io.IOException
Specified by:
count in interface org.eaglei.search.provider.SearchProvider
Throws:
java.io.IOException

query

public org.eaglei.search.provider.SearchResultSet query(org.eaglei.search.provider.SearchRequest request)
                                                 throws java.io.IOException
Specified by:
query in interface org.eaglei.search.provider.SearchProvider
Throws:
java.io.IOException

getResourceCount

public org.eaglei.search.provider.ClassCountResult getResourceCount(org.eaglei.search.provider.SearchRequest request)
Specified by:
getResourceCount in interface org.eaglei.search.provider.SearchProvider

getProviderTypeCount

public org.eaglei.search.provider.ClassCountResult getProviderTypeCount(org.eaglei.search.provider.SearchRequest request)
Specified by:
getProviderTypeCount in interface org.eaglei.search.provider.SearchProvider


Copyright © 2009-2011 Eagle-I. All Rights Reserved.