org.modeshape.jcr.query.lucene

## Class HasValueQuery

- java.lang.Object
- - org.apache.lucene.search.Query
  - - org.modeshape.jcr.query.lucene.HasValueQuery

- All Implemented Interfaces:
    Serializable, Cloneable

      public class HasValueQuery
      extends org.apache.lucene.search.Query

  A Lucene `Query` implementation that is satisfied if there is at least one value for a document.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `HasValueQuery.ExistsScorer` A scorer for the Path query.
    `protected class` | `HasValueQuery.ExistsWeight` Calculates query weights and builds query scores for our NOT queries.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `fieldName`
    `protected org.apache.lucene.document.FieldSelector` | `fieldSelector`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HasValueQuery(String fieldName)` Construct a `Query` implementation that scores nodes according to the supplied comparator.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `clone()`
    `org.apache.lucene.search.Weight` | `createWeight(org.apache.lucene.search.Searcher searcher)`
    `protected boolean` | `hasValue(org.apache.lucene.index.IndexReader reader, int docId)`
    `String` | `toString(String field)`

    - ### 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

    - #### fieldName

          protected final String fieldName

    - #### fieldSelector

          protected final org.apache.lucene.document.FieldSelector fieldSelector

  - ### Constructor Detail

    - #### HasValueQuery

          public HasValueQuery(String fieldName)

      Construct a `Query` implementation that scores nodes according to the supplied comparator.
      Parameters:
        `fieldName` - the name of the document field containing the value; may not be null

  - ### Method Detail

    - #### clone

          public Object clone()

      Overrides:
        `clone` in class `org.apache.lucene.search.Query`
      See Also:
        `Query.clone()`

    - #### createWeight

          public org.apache.lucene.search.Weight createWeight(org.apache.lucene.search.Searcher searcher)

      Overrides:
        `createWeight` in class `org.apache.lucene.search.Query`
      See Also:
        `Query.createWeight(org.apache.lucene.search.Searcher)`

    - #### toString

          public String toString(String field)

      Specified by:
        `toString` in class `org.apache.lucene.search.Query`
      See Also:
        `Query.toString(java.lang.String)`

    - #### hasValue

          protected boolean hasValue(org.apache.lucene.index.IndexReader reader,
                         int docId)
                              throws IOException

      Throws:
        `IOException`

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