com.raritantechnologies.verity
Class DidYouMeanProcessor

java.lang.Object
  extended bycom.raritantechnologies.verity.DidYouMeanProcessor

public class DidYouMeanProcessor
extends java.lang.Object

Provided did-you-mean functionaliy against a Verity K2 server. Intended for use when the primary [verity] search source returned less than some [configurable threshold] number of hits.


Developed by Raritan Technologies .

Author:
Glenn Robitaille

Field Summary
 java.lang.String collectionSeparator
           
 int maxDoc
           
 int NUM_OF_RETRIES
           
 short numSuggestions
           
protected  java.lang.StringBuffer trailerBuffer
           
 
Constructor Summary
DidYouMeanProcessor()
           
DidYouMeanProcessor(java.lang.String searchSourceName)
          construct a DidYouMeanProcessor for a specific search source.
 
Method Summary
 java.lang.String getBeginHighlight()
           
 java.lang.String getEndHighlight()
           
 short getNumSuggestions()
           
 java.lang.String getSuggestedQuery()
          get the suggested query, without highlighting.
 java.lang.String getSuggestedQueryHighlighted()
          get the suggested query, with highlighting.
 void getSuggestion(java.lang.String userName, java.lang.String password, java.lang.String query)
          Get the suggestion using the Verity VSuggest API, using the previously-stored source
 void getSuggestion(java.lang.String k2ServerSpec, java.lang.String userName, java.lang.String password, java.lang.String query, java.lang.String collectionList)
          Get the suggestion using the Verity VSuggest API.
 void setBeginHighlight(java.lang.String s)
           
 void setEndHighlight(java.lang.String s)
           
 void setNumSuggestions(short n)
          not used now.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trailerBuffer

protected java.lang.StringBuffer trailerBuffer

collectionSeparator

public final java.lang.String collectionSeparator
See Also:
Constant Field Values

NUM_OF_RETRIES

public final int NUM_OF_RETRIES
See Also:
Constant Field Values

maxDoc

public int maxDoc

numSuggestions

public short numSuggestions
Constructor Detail

DidYouMeanProcessor

public DidYouMeanProcessor()

DidYouMeanProcessor

public DidYouMeanProcessor(java.lang.String searchSourceName)
construct a DidYouMeanProcessor for a specific search source. Using this constructor frees you from passing k2serverspec and collection when invoking getSuggestion();

Method Detail

getSuggestedQuery

public java.lang.String getSuggestedQuery()
get the suggested query, without highlighting. This must be called after getSuggestion() method is invoked.


getSuggestedQueryHighlighted

public java.lang.String getSuggestedQueryHighlighted()
get the suggested query, with highlighting. This must be called after getSuggestion() method is invoked. The begin/end highlighting strings can be set using the setBeginHighlight() and setEndHighlight() methods.


getSuggestion

public void getSuggestion(java.lang.String k2ServerSpec,
                          java.lang.String userName,
                          java.lang.String password,
                          java.lang.String query,
                          java.lang.String collectionList)
Get the suggestion using the Verity VSuggest API. This saves the query and highlighted query to instance varaiables, which can be retrieved through get methods.


getSuggestion

public void getSuggestion(java.lang.String userName,
                          java.lang.String password,
                          java.lang.String query)
Get the suggestion using the Verity VSuggest API, using the previously-stored source


setBeginHighlight

public void setBeginHighlight(java.lang.String s)

getBeginHighlight

public java.lang.String getBeginHighlight()

setEndHighlight

public void setEndHighlight(java.lang.String s)

getEndHighlight

public java.lang.String getEndHighlight()

setNumSuggestions

public void setNumSuggestions(short n)
not used now. This will be used if this object is extended to return individual keywords from the VSuggest object.


getNumSuggestions

public short getNumSuggestions()