Interface FullTextQuery

    • Method Detail

      • unwrap

        <T> T unwrap​(Class<T> type)
        Deprecated.
        Specified by:
        unwrap in interface javax.persistence.Query
        Type Parameters:
        T - the type of the unwrapped object
        Parameters:
        type - the type to unwrap
        Returns:
        the underlying type if possible. If not possible to unwrap to the given type an IllegalArgumentException is thrown. Supported types are:
        • org.apache.lucene.search.Query the underlying lucene query
      • setSort

        FullTextQuery setSort​(Sort sort)
        Deprecated.
        Description copied from interface: FullTextQuery
        Allows to let lucene sort the results. This is useful when you have additional sort requirements on top of the default lucene ranking. Without lucene sorting you would have to retrieve the full result set and order the hibernate objects.
        Specified by:
        setSort in interface FullTextQuery
        Parameters:
        sort - The lucene sort object.
        Returns:
        this for method chaining
      • setProjection

        FullTextQuery setProjection​(String... fields)
        Deprecated.
        Description copied from interface: FullTextQuery
        Defines the Lucene field names projected and returned in a query result Each field is converted back to it's object representation, an Object[] being returned for each "row" (similar to an HQL or a Criteria API projection). A projectable field must be stored in the Lucene index and use a two-way field bridge Unless notified in their JavaDoc, all built-in bridges are two-way. All @DocumentId fields are projectable by design. If the projected field is not a projectable field, null is returned in the object[]
        Specified by:
        setProjection in interface FullTextQuery
        Parameters:
        fields - the fields to use for projection
        Returns:
        this for method chaining
      • setSpatialParameters

        FullTextQuery setSpatialParameters​(double latitude,
                                           double longitude,
                                           String fieldName)
        Deprecated.
        Description copied from interface: FullTextQuery
        Defines the center of the spatial search for this query to project distance in results
        Specified by:
        setSpatialParameters in interface FullTextQuery
        Parameters:
        latitude - latitude of the search center
        longitude - longitude of the search center
        fieldName - name of the spatial field
        Returns:
        this for method chaining
      • setSpatialParameters

        FullTextQuery setSpatialParameters​(Coordinates center,
                                           String fieldName)
        Deprecated.
        Description copied from interface: FullTextQuery
        Defines the center of the spatial search for this query to project distance in results
        Specified by:
        setSpatialParameters in interface FullTextQuery
        Parameters:
        center - the search center
        fieldName - name of the spatial field
        Returns:
        this for method chaining
      • setFlushMode

        FullTextQuery setFlushMode​(javax.persistence.FlushModeType flushMode)
        Deprecated.
        Specified by:
        setFlushMode in interface FullTextQuery
        Specified by:
        setFlushMode in interface javax.persistence.Query
        Specified by:
        setFlushMode in interface Query
        Specified by:
        setFlushMode in interface Query
        Specified by:
        setFlushMode in interface javax.persistence.TypedQuery
      • setTimeout

        FullTextQuery setTimeout​(long timeout,
                                 TimeUnit timeUnit)
        Deprecated.
        Description copied from interface: FullTextQuery
        Define a timeout period for a given unit of time. Note that this is time out is on a best effort basis. When the query goes beyond the timeout, a QueryTimeoutException is raised.
        Specified by:
        setTimeout in interface FullTextQuery
        Parameters:
        timeout - time out period
        timeUnit - time out unit
        Returns:
        this to allow method chaining
      • limitExecutionTimeTo

        FullTextQuery limitExecutionTimeTo​(long timeout,
                                           TimeUnit timeUnit)
        Deprecated.
        Description copied from interface: FullTextQuery
        Limit the time used by Hibernate Search to execute the query. When the limit is reached, results already fetched are returned. This time limit is a best effort. The query will likely run for longer than the provided time. The time limit only applies to the interactions between Hibernate Search and Lucene. In other words, a query to the database will not be limited. If the limit is reached and all results are not yet fetched, FullTextQuery.hasPartialResults() returns true.
        Specified by:
        limitExecutionTimeTo in interface FullTextQuery
        Parameters:
        timeout - time out period
        timeUnit - time out unit
        Returns:
        this for method chaining
      • initializeObjectsWith

        FullTextQuery initializeObjectsWith​(ObjectLookupMethod lookupMethod,
                                            DatabaseRetrievalMethod retrievalMethod)
        Deprecated.
        Description copied from interface: FullTextQuery
        Refine the strategies used to load entities. The lookup method defines whether or not to lookup first in the second level cache or the persistence context before trying to initialize objects from the database. Defaults to SKIP. The database retrieval method defines how objects are loaded from the database. Defaults to QUERY. Note that Hibernate Search can deviate from these choices when it makes sense.
        Specified by:
        initializeObjectsWith in interface FullTextQuery
        Parameters:
        lookupMethod - lookup method
        retrievalMethod - how to initilize an object
        Returns:
        this for method chaining