Package com.tibco.patterns.qbp

## Class CognateQueryDef

- java.lang.Object
- - com.tibco.patterns.qbp.QueryDef
  - - com.tibco.patterns.qbp.TextQueryDef
    - - com.tibco.patterns.qbp.CognateQueryDef

-     public class CognateQueryDef
      extends TextQueryDef

  Definition of a Simple query. Holds all parameters to create a Cognate NetricsQuery object.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CognateQueryDef​(java.util.List<ANetricsQueryBuilderBuilderBase.CognateQueryField> fields)` | Creates a Cognate query definition.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `CognateQueryDef` | `emptyFieldPenalty​(java.lang.Double emptyFieldPenalty)` |
    `java.util.Optional<java.lang.Double>` | `getEmptyFieldPenalty()` |
    `java.util.List<ANetricsQueryBuilderBuilderBase.CognateQueryField>` | `getFields()` |
    `java.util.Optional<java.lang.Double>` | `getNonCogWeight()` |
    `CognateQueryDef` | `nonCogWeight​(java.lang.Double nonCogWeight)` |

    - ### Methods inherited from class com.tibco.patterns.qbp.TextQueryDef

      `emptyScore, getEmptyScore, getScoreType, getThesaurusName, getThesaurusWeight, isMatchEmpty, matchEmpty, scoreType, thesaurus`

    - ### Methods inherited from class com.tibco.patterns.qbp.QueryDef

      `getGroupName, getQueryName, groupName, queryName`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CognateQueryDef

          public CognateQueryDef​(java.util.List<ANetricsQueryBuilderBuilderBase.CognateQueryField> fields)

      Creates a Cognate query definition.
      Parameters:
        `fields` - - the fields the cognate query is to query. Not null. The field names are the default output field names. This contains the data specification for each field.
      Throws:
        `java.lang.IllegalArgumentException` - if fields is null or zero length or contains nulls.

  - ### Method Detail

    - #### getFields

          public java.util.List<ANetricsQueryBuilderBuilderBase.CognateQueryField> getFields()

      Returns:
        a copy of the fields list.

    - #### nonCogWeight

          public CognateQueryDef nonCogWeight​(java.lang.Double nonCogWeight)

      Parameters:
        `nonCogWeight` - the non-cognate penalty factor for this cognate query. If null or not specified this must default to 1.0.
      Throws:
        `java.lang.IllegalArgumentException` - if non cognate weight is given and not between 0.0 and 1.0.

    - #### getNonCogWeight

          public java.util.Optional<java.lang.Double> getNonCogWeight()

      Returns:
        the non-cognate penalty factor, or empty Optional if the default is used.

    - #### emptyFieldPenalty

          public CognateQueryDef emptyFieldPenalty​(java.lang.Double emptyFieldPenalty)

      Parameters:
        `emptyFieldPenalty` - - the empty field penalty factor. If null or not specified the full penalty is applied.
      Throws:
        `java.lang.IllegalArgumentException` - if empty field penalty is given and not between 0.0 and 1.0.

    - #### getEmptyFieldPenalty

          public java.util.Optional<java.lang.Double> getEmptyFieldPenalty()

      Returns:
        the the empty field penalty, or empty Optional if the default 1.0 should be used.