com.primus.searchcommon.constraint
Class KeywordConstraint

java.lang.Object
  extended by com.primus.searchcommon.constraint.BaseConstraint
      extended by com.primus.searchcommon.constraint.KeywordConstraint
All Implemented Interfaces:
DocumentSetConstraint, java.io.Serializable

public class KeywordConstraint
extends BaseConstraint

This constraint is used for keyword constraints on the query. There are three types of keywords constraints and corresponding constants are as follows.

  1. ALL - All keywords must be present
  2. ANY - Any one of the keywords must be present
  3. NOTANY - None of the keywords must be present

The keywords should be delimited by space.

See Also:
Serialized Form

Field Summary
static java.lang.String ALL
           
static java.lang.String ANY
           
static java.lang.String CLASS_VERSION
           
static java.lang.String NOTANY
           
 
Constructor Summary
KeywordConstraint(java.lang.String pMode, java.lang.String pValue)
           
 
Method Summary
 java.lang.String getMode()
           
 java.lang.String getValue()
           
 java.lang.String toXml()
          Converts this constraint to the XML representation that can be sent in the ES Query.
 
Methods inherited from class com.primus.searchcommon.constraint.BaseConstraint
escapeToXml, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

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

ALL

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

ANY

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

NOTANY

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

KeywordConstraint

public KeywordConstraint(java.lang.String pMode,
                         java.lang.String pValue)
Parameters:
pMode - The mode (ALL/ANY/NOTANY) for this constraint. Use the constants.
pValue - The keywords separated by space.
Method Detail

getMode

public java.lang.String getMode()
Returns:
Returns the mode.

getValue

public java.lang.String getValue()
Returns:
Returns the value.

toXml

public java.lang.String toXml()
Description copied from interface: DocumentSetConstraint
Converts this constraint to the XML representation that can be sent in the ES Query.

Returns: