Package org.eclipse.rdf4j.sail.lucene

## Class QuerySpecBuilder

- java.lang.Object
- - org.eclipse.rdf4j.sail.lucene.QuerySpecBuilder

- All Implemented Interfaces:
    `SearchQueryInterpreter`

      public class QuerySpecBuilder
      extends Object
      implements SearchQueryInterpreter

  A QueryInterpreter creates a set of QuerySpecs based on Lucene-related StatementPatterns that it finds in a TupleExpr.

  QuerySpecs will only be created when the set of StatementPatterns is complete (i.e. contains at least a matches and a query statement connected properly) and correct (query pattern has a literal object, matches a resource subject, etc.).

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `QuerySpecBuilder​(boolean incompleteQueryFails)` | Initialize a new QuerySpecBuilder
    `QuerySpecBuilder​(boolean incompleteQueryFails, IRI indexId)` | Initialize a new QuerySpecBuilder

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Set<QuerySpec>` | `process​(TupleExpr tupleExpr, BindingSet bindings)` | Deprecated.
    `void` | `process​(TupleExpr tupleExpr, BindingSet bindings, Collection<SearchQueryEvaluator> result)` | Appends a set of QuerySpecs embodying all necessary information to perform the Lucene query embedded in a TupleExpr.

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

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

- - ### Constructor Detail

    - #### QuerySpecBuilder

          public QuerySpecBuilder​(boolean incompleteQueryFails)

      Initialize a new QuerySpecBuilder
      Parameters:
        `incompleteQueryFails` - see `LuceneSail.isIncompleteQueryFails()`

    - #### QuerySpecBuilder

          public QuerySpecBuilder​(boolean incompleteQueryFails,
                                  IRI indexId)

      Initialize a new QuerySpecBuilder
      Parameters:
        `incompleteQueryFails` - see `LuceneSail.isIncompleteQueryFails()`
        `indexId` - the id of the index, null to do not filter by index id, see `LuceneSail.INDEX_ID`

  - ### Method Detail

    - #### process

          @Deprecated
          public Set<QuerySpec> process​(TupleExpr tupleExpr,
                                        BindingSet bindings)
                                 throws SailException

      Deprecated.
      Returns a set of QuerySpecs embodying all necessary information to perform the Lucene query embedded in a TupleExpr. To be removed, prefer `#process(TupleExpr, BindingSet, Collection)`.
      Throws:
        `SailException`

    - #### process

          public void process​(TupleExpr tupleExpr,
                              BindingSet bindings,
                              Collection<SearchQueryEvaluator> result)
                       throws SailException

      Appends a set of QuerySpecs embodying all necessary information to perform the Lucene query embedded in a TupleExpr.
      Specified by:
        `process` in interface `SearchQueryInterpreter`
      Parameters:
        `tupleExpr` - the TupleExpr to process.
        `bindings` - any bindings.
        `result` - the Collection to add any SearchQueryEvaluators to.
      Throws:
        `SailException`