org.modeshape.jcr.query.lucene

## Class CompareNameQuery

- java.lang.Object
- - org.apache.lucene.search.Query
  - - org.modeshape.jcr.query.lucene.CompareQuery<Path.Segment>
    - - org.modeshape.jcr.query.lucene.CompareNameQuery

- All Implemented Interfaces:
    Serializable, Cloneable

      public class CompareNameQuery
      extends CompareQuery<Path.Segment>

  A Lucene `Query` implementation that is used to apply a `Comparison` constraint against the name of nodes. This query implementation works by using the weight and `scorer` of the wrapped query to score (and return) only those documents that correspond to nodes with Names that satisfy the constraint.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.modeshape.jcr.query.lucene.CompareQuery

      `CompareQuery.CompareScorer, CompareQuery.CompareWeight, CompareQuery.Evaluator<ValueType>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static CompareQuery.Evaluator<Path.Segment>` | `EQUAL_TO`
    `protected static CompareQuery.Evaluator<Path.Segment>` | `EQUAL_TO_NO_SNS`
    `protected static CompareQuery.Evaluator<Path.Segment>` | `IS_GREATER_THAN`
    `protected static CompareQuery.Evaluator<Path.Segment>` | `IS_GREATER_THAN_NO_SNS`
    `protected static CompareQuery.Evaluator<Path.Segment>` | `IS_GREATER_THAN_OR_EQUAL_TO`
    `protected static CompareQuery.Evaluator<Path.Segment>` | `IS_GREATER_THAN_OR_EQUAL_TO_NO_SNS`
    `protected static CompareQuery.Evaluator<Path.Segment>` | `IS_LESS_THAN`
    `protected static CompareQuery.Evaluator<Path.Segment>` | `IS_LESS_THAN_NO_SNS`
    `protected static CompareQuery.Evaluator<Path.Segment>` | `IS_LESS_THAN_OR_EQUAL_TO`
    `protected static CompareQuery.Evaluator<Path.Segment>` | `IS_LESS_THAN_OR_EQUAL_TO_NO_SNS`

    - ### Fields inherited from class org.modeshape.jcr.query.lucene.CompareQuery

      `constraintValue, evaluator, fieldName, fieldSelector, stringFactory, valueTypeFactory`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `CompareNameQuery(String localNameField, String snsIndexFieldName, Path.Segment constraintValue, PathFactory pathFactory, ValueFactory<String> stringFactory, ValueFactory<Long> longFactory, CompareQuery.Evaluator<Path.Segment> evaluator, CaseOperations.CaseOperation caseOperation)` Construct a `Query` implementation that scores nodes according to the supplied comparator.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `clone()`
    `static org.apache.lucene.search.Query` | `createQueryForNodesWithNameEqualTo(Path.Segment constraintValue, String localNameField, String snsIndexFieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation, boolean includeSns)` Construct a `Query` implementation that scores documents such that the node represented by the document has a name that is greater than the supplied constraint name.
    `static CompareNameQuery` | `createQueryForNodesWithNameGreaterThan(Path.Segment constraintValue, String localNameField, String snsIndexFieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation, boolean includeSns)` Construct a `Query` implementation that scores documents such that the node represented by the document has a name that is greater than the supplied constraint name.
    `static CompareNameQuery` | `createQueryForNodesWithNameGreaterThanOrEqualTo(Path.Segment constraintValue, String localNameField, String snsIndexFieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation, boolean includeSns)` Construct a `Query` implementation that scores documents such that the node represented by the document has a name that is greater than or equal to the supplied constraint name.
    `static CompareNameQuery` | `createQueryForNodesWithNameLessThan(Path.Segment constraintValue, String localNameField, String snsIndexFieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation, boolean includeSns)` Construct a `Query` implementation that scores documents such that the node represented by the document has a name that is less than the supplied constraint name.
    `static CompareNameQuery` | `createQueryForNodesWithNameLessThanOrEqualTo(Path.Segment constraintValue, String localNameField, String snsIndexFieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation, boolean includeSns)` Construct a `Query` implementation that scores documents such that the node represented by the document has a name that is less than or equal to the supplied constraint name.
    `protected Path.Segment` | `readFromDocument(org.apache.lucene.index.IndexReader reader, int docId)`

    - ### Methods inherited from class org.modeshape.jcr.query.lucene.CompareQuery

      `createWeight, toString`

    - ### Methods inherited from class org.apache.lucene.search.Query

      `combine, equals, extractTerms, getBoost, getSimilarity, hashCode, mergeBooleanQueries, rewrite, setBoost, toString, weight`

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

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### EQUAL_TO

          protected static final CompareQuery.Evaluator<Path.Segment> EQUAL_TO

    - #### IS_LESS_THAN

          protected static final CompareQuery.Evaluator<Path.Segment> IS_LESS_THAN

    - #### IS_LESS_THAN_OR_EQUAL_TO

          protected static final CompareQuery.Evaluator<Path.Segment> IS_LESS_THAN_OR_EQUAL_TO

    - #### IS_GREATER_THAN

          protected static final CompareQuery.Evaluator<Path.Segment> IS_GREATER_THAN

    - #### IS_GREATER_THAN_OR_EQUAL_TO

          protected static final CompareQuery.Evaluator<Path.Segment> IS_GREATER_THAN_OR_EQUAL_TO

    - #### EQUAL_TO_NO_SNS

          protected static final CompareQuery.Evaluator<Path.Segment> EQUAL_TO_NO_SNS

    - #### IS_LESS_THAN_NO_SNS

          protected static final CompareQuery.Evaluator<Path.Segment> IS_LESS_THAN_NO_SNS

    - #### IS_LESS_THAN_OR_EQUAL_TO_NO_SNS

          protected static final CompareQuery.Evaluator<Path.Segment> IS_LESS_THAN_OR_EQUAL_TO_NO_SNS

    - #### IS_GREATER_THAN_NO_SNS

          protected static final CompareQuery.Evaluator<Path.Segment> IS_GREATER_THAN_NO_SNS

    - #### IS_GREATER_THAN_OR_EQUAL_TO_NO_SNS

          protected static final CompareQuery.Evaluator<Path.Segment> IS_GREATER_THAN_OR_EQUAL_TO_NO_SNS

  - ### Constructor Detail

    - #### CompareNameQuery

          protected CompareNameQuery(String localNameField,
                          String snsIndexFieldName,
                          Path.Segment constraintValue,
                          PathFactory pathFactory,
                          ValueFactory<String> stringFactory,
                          ValueFactory<Long> longFactory,
                          CompareQuery.Evaluator<Path.Segment> evaluator,
                          CaseOperations.CaseOperation caseOperation)

      Construct a `Query` implementation that scores nodes according to the supplied comparator.
      Parameters:
        `localNameField` - the name of the document field containing the local name value; may not be null
        `snsIndexFieldName` - the name of the document field containing the same-name-sibling index; may not be null
        `constraintValue` - the constraint path; may not be null
        `pathFactory` - the path factory that can be used during the scoring; may not be null
        `stringFactory` - the string factory that can be used during the scoring; may not be null
        `longFactory` - the long factory that can be used during the scoring; may not be null
        `evaluator` - the `CompareQuery.Evaluator` implementation that returns whether the node path satisfies the constraint; may not be null
        `caseOperation` - the operation that should be performed on the indexed values before the constraint value is being evaluated; may not be null

  - ### Method Detail

    - #### createQueryForNodesWithNameEqualTo

          public static org.apache.lucene.search.Query createQueryForNodesWithNameEqualTo(Path.Segment constraintValue,
                                                                          String localNameField,
                                                                          String snsIndexFieldName,
                                                                          ValueFactories factories,
                                                                          CaseOperations.CaseOperation caseOperation,
                                                                          boolean includeSns)

      Construct a `Query` implementation that scores documents such that the node represented by the document has a name that is greater than the supplied constraint name.
      Parameters:
        `constraintValue` - the constraint value; may not be null
        `localNameField` - the name of the document field containing the local name value; may not be null
        `snsIndexFieldName` - the name of the document field containing the same-name-sibling index; may not be null
        `factories` - the value factories that can be used during the scoring; may not be null
        `caseOperation` - the operation that should be performed on the indexed values before the constraint value is being evaluated; may not be null
        `includeSns` - true if the SNS index should be considered, or false if the SNS value should be ignored
      Returns:
        the query; never null

    - #### createQueryForNodesWithNameGreaterThan

          public static CompareNameQuery createQueryForNodesWithNameGreaterThan(Path.Segment constraintValue,
                                                                String localNameField,
                                                                String snsIndexFieldName,
                                                                ValueFactories factories,
                                                                CaseOperations.CaseOperation caseOperation,
                                                                boolean includeSns)

      Construct a `Query` implementation that scores documents such that the node represented by the document has a name that is greater than the supplied constraint name.
      Parameters:
        `constraintValue` - the constraint value; may not be null
        `localNameField` - the name of the document field containing the local name value; may not be null
        `snsIndexFieldName` - the name of the document field containing the same-name-sibling index; may not be null
        `factories` - the value factories that can be used during the scoring; may not be null
        `caseOperation` - the operation that should be performed on the indexed values before the constraint value is being evaluated; may not be null
        `includeSns` - true if the SNS index should be considered, or false if the SNS value should be ignored
      Returns:
        the query; never null

    - #### createQueryForNodesWithNameGreaterThanOrEqualTo

          public static CompareNameQuery createQueryForNodesWithNameGreaterThanOrEqualTo(Path.Segment constraintValue,
                                                                         String localNameField,
                                                                         String snsIndexFieldName,
                                                                         ValueFactories factories,
                                                                         CaseOperations.CaseOperation caseOperation,
                                                                         boolean includeSns)

      Construct a `Query` implementation that scores documents such that the node represented by the document has a name that is greater than or equal to the supplied constraint name.
      Parameters:
        `constraintValue` - the constraint value; may not be null
        `localNameField` - the name of the document field containing the local name value; may not be null
        `snsIndexFieldName` - the name of the document field containing the same-name-sibling index; may not be null
        `factories` - the value factories that can be used during the scoring; may not be null
        `caseOperation` - the operation that should be performed on the indexed values before the constraint value is being evaluated; may not be null
        `includeSns` - true if the SNS index should be considered, or false if the SNS value should be ignored
      Returns:
        the query; never null

    - #### createQueryForNodesWithNameLessThan

          public static CompareNameQuery createQueryForNodesWithNameLessThan(Path.Segment constraintValue,
                                                             String localNameField,
                                                             String snsIndexFieldName,
                                                             ValueFactories factories,
                                                             CaseOperations.CaseOperation caseOperation,
                                                             boolean includeSns)

      Construct a `Query` implementation that scores documents such that the node represented by the document has a name that is less than the supplied constraint name.
      Parameters:
        `constraintValue` - the constraint value; may not be null
        `localNameField` - the name of the document field containing the local name value; may not be null
        `snsIndexFieldName` - the name of the document field containing the same-name-sibling index; may not be null
        `factories` - the value factories that can be used during the scoring; may not be null
        `caseOperation` - the operation that should be performed on the indexed values before the constraint value is being evaluated; may not be null
        `includeSns` - true if the SNS index should be considered, or false if the SNS value should be ignored
      Returns:
        the query; never null

    - #### createQueryForNodesWithNameLessThanOrEqualTo

          public static CompareNameQuery createQueryForNodesWithNameLessThanOrEqualTo(Path.Segment constraintValue,
                                                                      String localNameField,
                                                                      String snsIndexFieldName,
                                                                      ValueFactories factories,
                                                                      CaseOperations.CaseOperation caseOperation,
                                                                      boolean includeSns)

      Construct a `Query` implementation that scores documents such that the node represented by the document has a name that is less than or equal to the supplied constraint name.
      Parameters:
        `constraintValue` - the constraint value; may not be null
        `localNameField` - the name of the document field containing the local name value; may not be null
        `snsIndexFieldName` - the name of the document field containing the same-name-sibling index; may not be null
        `factories` - the value factories that can be used during the scoring; may not be null
        `caseOperation` - the operation that should be performed on the indexed values before the constraint value is being evaluated; may not be null
        `includeSns` - true if the SNS index should be considered, or false if the SNS value should be ignored
      Returns:
        the query; never null

    - #### readFromDocument

          protected Path.Segment readFromDocument(org.apache.lucene.index.IndexReader reader,
                                      int docId)
                                           throws IOException

      Overrides:
        `readFromDocument` in class `CompareQuery<Path.Segment>`
      Throws:
        `IOException`

    - #### clone

          public Object clone()

      Overrides:
        `clone` in class `org.apache.lucene.search.Query`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.