Skip navigation links


com.fatwire.search.util
Class SearchUtils

java.lang.Object
  extended by com.fatwire.search.util.SearchUtils


public final class SearchUtils
extends java.lang.Object

This class is a general purpose factory class for building instances of several interfaces of Search API.


Field Summary
static java.lang.String ALL_OF_THESE_WORDS
           
static java.lang.String ANY
           
static java.lang.String ANY_OF_THESE_WORDS
           
static java.lang.String CUSTOM_RANGE
           
static java.lang.String PAST_24_HOURS
           
static java.lang.String PAST_MONTH
           
static java.lang.String PAST_WEEK
           
static java.lang.String PAST_YEAR
           

 

Constructor Summary
SearchUtils()
           

 

Method Summary
static SearchCriteria buildSearchCriteriaFromJson(java.lang.String jsonString, long siteId)
           
static IndexSourceConfig getIndexSourceConfig()
          Retrieves an instance of IndexSourceConfig from Content Server.
static SearchEngineConfig getSearchEngineConfig()
          Retrieves a SearchEngineConfig instance from Content Server; A SearchEngineConfig instance is used to retrieve the configure information for a search engine that is specified in Content Server search integration.
static QueryExpression newQuery(java.lang.String stringValue)
          Creates a QueryExpression from a String
static QueryExpression newQuery(java.lang.String fieldName, Operation op, java.util.List values)
          Creates a QueryExpression with a field name, an oprator, and a list of value
static QueryExpression newQuery(java.lang.String fieldName, Operation op, java.util.List values, boolean negate)
          Creates a QueryExpression with a field name, an oprator, and a list of values
static QueryExpression newQuery(java.lang.String fieldName, Operation op, java.lang.Object value)
          Creates a QueryExpression with a field name, an oprator, and a value
static QueryExpression newQuery(java.lang.String fieldName, Operation op, java.lang.Object value, boolean negate)
          Creates a QueryExpression with a field name, an oprator, and value
static java.lang.String replaceSingleQuote(java.lang.String text)
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

ANY

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

ANY_OF_THESE_WORDS

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

ALL_OF_THESE_WORDS

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

PAST_YEAR

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

PAST_MONTH

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

PAST_WEEK

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

PAST_24_HOURS

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

CUSTOM_RANGE

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

Constructor Detail

SearchUtils

public SearchUtils()

Method Detail

getSearchEngineConfig

public static SearchEngineConfig getSearchEngineConfig()
                                                throws SearchEngineException
Retrieves a SearchEngineConfig instance from Content Server; A SearchEngineConfig instance is used to retrieve the configure information for a search engine that is specified in Content Server search integration.
Returns:
a default implementation of SearchEngineconfig
Throws:
SearchEngineException - if error occurs when getting the configuration class

getIndexSourceConfig

public static IndexSourceConfig getIndexSourceConfig()
                                              throws SearchEngineException
Retrieves an instance of IndexSourceConfig from Content Server. IndexSourceConfig is used to retrieve the information for Content Server index source configuration information.
Returns:
a default implemenation of IndexSourceConfig
Throws:
SearchEngineException - if error met in getting the default implementation of IndexSourceConfig

newQuery

public static QueryExpression newQuery(java.lang.String stringValue)
Creates a QueryExpression from a String
Parameters:
stringValue - the string format of a query expression
Returns:
a QueryExpression that represents the same query specified by the stringValue

newQuery

public static QueryExpression newQuery(java.lang.String fieldName,
                                       Operation op,
                                       java.lang.Object value)
Creates a QueryExpression with a field name, an oprator, and a value
Parameters:
fieldName - the attribute name to query
op - the operator
value - the value for the query condition
Returns:
a QueryExpression basing on the attribute name, operator and value passed in

newQuery

public static QueryExpression newQuery(java.lang.String fieldName,
                                       Operation op,
                                       java.util.List values)
Creates a QueryExpression with a field name, an oprator, and a list of value
Parameters:
fieldName - the attribute name to query
op - the operator
values - the list of values for the query condition
Returns:
a QueryExpression basing on the attribute name, operator and values passed in

newQuery

public static QueryExpression newQuery(java.lang.String fieldName,
                                       Operation op,
                                       java.lang.Object value,
                                       boolean negate)
Creates a QueryExpression with a field name, an oprator, and value
Parameters:
fieldName - the attribute name to query
op - the operator
value - value for the query condition
negate - the boolean indicator which indicates whether the query should is positive or negative; if negate is true, it would mean the query expression condition is "not" what specified. Otherwise, it would mean the query condition is what specified. Default to be false.
Returns:
a QueryExpression basing on the attribute name, operator and value passed in

newQuery

public static QueryExpression newQuery(java.lang.String fieldName,
                                       Operation op,
                                       java.util.List values,
                                       boolean negate)
Creates a QueryExpression with a field name, an oprator, and a list of values
Parameters:
fieldName - the attribute name to query
op - the operator
values - a list of values for the query condition
negate - the boolean indicator which indicates whether the query should is positive or negative; if negate is true, it would mean the query expression condition is "not" what specified. Otherwise, it would mean the query condition is what specified. Default to be false.
Returns:
a QueryExpression basing on the attribute name, operator and a list of values passed in

buildSearchCriteriaFromJson

public static SearchCriteria buildSearchCriteriaFromJson(java.lang.String jsonString,
                                                         long siteId)

replaceSingleQuote

public static java.lang.String replaceSingleQuote(java.lang.String text)

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.