org.hibernate.search.query.dsl

## Interface MoreLikeThisContext

- All Superinterfaces:
    QueryCustomization<MoreLikeThisContext>
  All Known Implementing Classes:
    ConnectedMoreLikeThisContext

      public interface MoreLikeThisContext
      extends QueryCustomization<MoreLikeThisContext>

  Context to build a More Like This Query. These queries are useful to find similar objects to a given object; the Hibernate Search implementation is a variation on Lucene's MoreLikeThisQuery Query implementation as it will not mix comparisons across different fields, but only match domain objects which have similar properties matching.
  Author:
    Emmanuel Bernard <emmanuel@hibernate.org>

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `MoreLikeThisTerminalMatchingContext` | `comparingAllFields()` Match the content using "all" of the indexed fields of the entity.
    `MoreLikeThisOpenedMatchingContext` | `comparingField(String fieldName)` Match the content using the selected field of the entity.
    `MoreLikeThisOpenedMatchingContext` | `comparingFields(String... fieldNames)` Match the content using the selected fields of the entity.
    `MoreLikeThisContext` | `excludeEntityUsedForComparison()` Exclude the entity used for comparison from the results
    `MoreLikeThisContext` | `favorSignificantTermsWithFactor(float factor)` Boost significant terms relative to their scores.

    - ### Methods inherited from interface org.hibernate.search.query.dsl.QueryCustomization

      `boostedTo, filteredBy, withConstantScore`

- - ### Method Detail

    - #### excludeEntityUsedForComparison

          MoreLikeThisContext excludeEntityUsedForComparison()

      Exclude the entity used for comparison from the results
      Returns:
        `this` for method chaining

    - #### favorSignificantTermsWithFactor

          MoreLikeThisContext favorSignificantTermsWithFactor(float factor)

      Boost significant terms relative to their scores. Amplified by the boost factor (1 is the recommended default to start with). Unless activated, terms are not boosted by their individual frequency. When activated, significant terms will have their influence increased more than by default.
      Parameters:
        `factor` - the factor value
      Returns:
        `this` for method chaining

    - #### comparingAllFields

          MoreLikeThisTerminalMatchingContext comparingAllFields()

      Match the content using "all" of the indexed fields of the entity. More precisely, only fields storing term vectors or physically stored will be compared. Fields storing the id and the class type are ignored. We highly recommend to store the term vectors if you plan on using More Like This queries.
      Returns:
        `this` for method chaining

    - #### comparingFields

          MoreLikeThisOpenedMatchingContext comparingFields(String... fieldNames)

      Match the content using the selected fields of the entity. An exception is thrown if the fields are neither storing the term vectors nor physically stored. We highly recommend to store the term vectors if you plan on using More Like This queries.
      Parameters:
        `fieldNames` - the names of the fields to use for the comparison
      Returns:
        `this` for method chaining

    - #### comparingField

          MoreLikeThisOpenedMatchingContext comparingField(String fieldName)

      Match the content using the selected field of the entity. An exception is thrown if the field are neither storing the term vectors nor physically stored. We highly recommend to store the term vectors if you plan on using More Like This queries.
      Parameters:
        `fieldName` - the name of the field to compare
      Returns:
        `this` for method chaining

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved