com.atlassian.confluence.search.v2.lucene.boosting
Class BoostPreferredSpaceStrategy

java.lang.Object
  extended by com.atlassian.confluence.search.v2.lucene.boosting.BoostPreferredSpaceStrategy
All Implemented Interfaces:
BoostingStrategy

public class BoostPreferredSpaceStrategy
extends java.lang.Object
implements BoostingStrategy

A BoostingStrategy that boost the scores based on the space of scored document. Documents created in the provided space are given a higher score.


Field Summary
static java.lang.String PREFERRED_SPACE_KEY
           
 
Constructor Summary
BoostPreferredSpaceStrategy()
           
 
Method Summary
 float boost(org.apache.lucene.index.IndexReader reader, int doc, float score)
          Apply a relevant boost to the specified document with the specified score.
 float boost(org.apache.lucene.index.IndexReader reader, java.util.Map<java.lang.String,java.lang.Object> params, int doc, float score)
          Apply a relevant boost to the specified document with the specified score.
 float boost(org.apache.lucene.index.IndexReader reader, SearchQueryParameters searchQueryParameters, int doc, float score)
          Apply a relevant boost to the specified document with the specified score.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFERRED_SPACE_KEY

public static final java.lang.String PREFERRED_SPACE_KEY
See Also:
Constant Field Values
Constructor Detail

BoostPreferredSpaceStrategy

public BoostPreferredSpaceStrategy()
Method Detail

boost

public float boost(org.apache.lucene.index.IndexReader reader,
                   int doc,
                   float score)
            throws java.io.IOException
Description copied from interface: BoostingStrategy

Apply a relevant boost to the specified document with the specified score. Returning a score of 0 will remove the document from the results.

Warning: This method needs to return extremely fast, so any I/O like using the index reader to load the actual document is discouraged. If you need access to a documents field values you should rather consider using a FieldCache instead.

Specified by:
boost in interface BoostingStrategy
Parameters:
reader - a reader instance associated with the current scoring process
doc - the doc id
score - the original score for the document specified by doc
Returns:
the boosted score, 0 to remove the document from the results, or score to make no change to the score
Throws:
java.io.IOException

boost

public float boost(org.apache.lucene.index.IndexReader reader,
                   java.util.Map<java.lang.String,java.lang.Object> params,
                   int doc,
                   float score)
            throws java.io.IOException
Description copied from interface: BoostingStrategy

Apply a relevant boost to the specified document with the specified score. Returning a score of 0 will remove the document from the results.

Warning: This method needs to return extremely fast, so any I/O like using the index reader to load the actual document is discouraged. If you need access to a documents field values you should rather consider using a FieldCache instead.

Specified by:
boost in interface BoostingStrategy
Parameters:
reader - a reader instance associated with the current scoring process
params - extra state information used by more complex boosting strategies
doc - the doc id
score - the original score for the document specified by doc
Returns:
the boosted score, 0 to remove the document from the results, or score to make no change to the score
Throws:
java.io.IOException

boost

public float boost(org.apache.lucene.index.IndexReader reader,
                   SearchQueryParameters searchQueryParameters,
                   int doc,
                   float score)
            throws java.io.IOException
Description copied from interface: BoostingStrategy

Apply a relevant boost to the specified document with the specified score. Returning a score of 0 will remove the document from the results.

Warning: This method needs to return extremely fast, so any I/O like using the index reader to load the actual document is discouraged. If you need access to a documents field values you should rather consider using a FieldCache instead.

If you are implementing this method but do not use the searchQueryParameters, it is safe to delegate directly to the boost(IndexReader, int, float) method.

Specified by:
boost in interface BoostingStrategy
Parameters:
reader - a reader instance associated with the current scoring process
searchQueryParameters - extra state information used by more complex boosting strategies
doc - the doc id
score - the original score for the document specified by doc, or score to make no change to the score
Returns:
the boosted score or 0 to remove the document from the results
Throws:
java.io.IOException


Copyright © 2003-2013 Atlassian. All Rights Reserved.