
querqy.rewrite.SearchEngineRequestAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of querqy-core Show documentation
Show all versions of querqy-core Show documentation
Querqy library for query rewriting: Querqy Core
package querqy.rewrite;
import querqy.infologging.InfoLoggingContext;
import java.util.Map;
import java.util.Optional;
/**
* A SearchEngineRequestAdapter is mainly used to pass context-specific information to
* {@link querqy.rewrite.QueryRewriter}s while hiding search engine specifics from Querqy core.
*
* @see querqy.rewrite.ContextAwareQueryRewriter
*
*/
public interface SearchEngineRequestAdapter {
/**
* Get the rewrite chain to be applied to the user query.
*
* @return The rewrite chain.
*/
RewriteChain getRewriteChain();
/**
* Get a map to hold context information while rewriting the query.
*
* @see querqy.rewrite.ContextAwareQueryRewriter
* @return A non-null context map.
*/
Map getContext();
/**
* Get request parameter as String
*
* @param name the parameter name
* @return the optional parameter value
*/
Optional getRequestParam(String name);
/**
* Get request parameter as an array of Strings
*
* @param name the parameter name
* @return the parameter value String array (String[0] if not set)
*/
String[] getRequestParams(String name);
/**
* Get request parameter as Boolean
*
* @param name the parameter name
* @return the optional parameter value
*/
Optional getBooleanRequestParam(String name);
/**
* Get request parameter as Integer
*
* @param name the parameter name
* @return the optional parameter value
*/
Optional getIntegerRequestParam(String name);
/**
* Get request parameter as Float
*
* @param name the parameter name
* @return the optional parameter value
*/
Optional getFloatRequestParam(String name);
/**
* Get request parameter as Double
*
* @param name the parameter name
* @return the optional parameter value
*/
Optional getDoubleRequestParam(String name);
/**
* Get the per-request info logging. Return an empty option if logging hasn't been configured or was disabled
* for this request.
*
* @return the InfoLoggingContext object
*/
Optional getInfoLoggingContext();
/**
* Should debug information be collected while rewriting the query?
* Debug information will be kept in the context map under the
* {@link querqy.rewrite.ContextAwareQueryRewriter#CONTEXT_KEY_DEBUG_DATA} key.
*
* @see #getContext()
*
* @return true if debug information shall be collected, false otherwise
*/
boolean isDebugQuery();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy