org.hibernate.search.query.dsl.impl

## Class ConnectedMoreLikeThisContext

- java.lang.Object
- - org.hibernate.search.query.dsl.impl.ConnectedMoreLikeThisContext

- All Implemented Interfaces:
    MoreLikeThisContext, QueryCustomization<MoreLikeThisContext>

      public class ConnectedMoreLikeThisContext
      extends Object
      implements MoreLikeThisContext

  Author:
    Emmanuel Bernard

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConnectedMoreLikeThisContext(QueryBuildingContext context)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `MoreLikeThisContext` | `boostedTo(float boost)` Boost the query to a given value Most of the time positive float: - lower than 1 to diminish the weight - higher than 1 to increase the weight Could be negative but not unless you understand what is going on (advanced)
    `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.
    `MoreLikeThisContext` | `filteredBy(Query filter)` Filter the query results with the given Query instance
    `MoreLikeThisContext` | `withConstantScore()` All results matching the query have a constant score equals to the boost FIXME is that true?

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

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

- - ### Constructor Detail

    - #### ConnectedMoreLikeThisContext

          public ConnectedMoreLikeThisContext(QueryBuildingContext context)

  - ### Method Detail

    - #### excludeEntityUsedForComparison

          public MoreLikeThisContext excludeEntityUsedForComparison()

      Description copied from interface: `MoreLikeThisContext`
      Exclude the entity used for comparison from the results
      Specified by:
        `excludeEntityUsedForComparison` in interface `MoreLikeThisContext`
      Returns:
        `this` for method chaining

    - #### favorSignificantTermsWithFactor

          public MoreLikeThisContext favorSignificantTermsWithFactor(float factor)

      Description copied from interface: `MoreLikeThisContext`
      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.
      Specified by:
        `favorSignificantTermsWithFactor` in interface `MoreLikeThisContext`
      Parameters:
        `factor` - the factor value
      Returns:
        `this` for method chaining

    - #### comparingAllFields

          public MoreLikeThisTerminalMatchingContext comparingAllFields()

      Description copied from interface: `MoreLikeThisContext`
      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.
      Specified by:
        `comparingAllFields` in interface `MoreLikeThisContext`
      Returns:
        `this` for method chaining

    - #### comparingFields

          public MoreLikeThisOpenedMatchingContext comparingFields(String... fieldNames)

      Description copied from interface: `MoreLikeThisContext`
      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.
      Specified by:
        `comparingFields` in interface `MoreLikeThisContext`
      Parameters:
        `fieldNames` - the names of the fields to use for the comparison
      Returns:
        `this` for method chaining

    - #### comparingField

          public MoreLikeThisOpenedMatchingContext comparingField(String fieldName)

      Description copied from interface: `MoreLikeThisContext`
      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.
      Specified by:
        `comparingField` in interface `MoreLikeThisContext`
      Parameters:
        `fieldName` - the name of the field to compare
      Returns:
        `this` for method chaining

    - #### boostedTo

          public MoreLikeThisContext boostedTo(float boost)

      Description copied from interface: `QueryCustomization`
      Boost the query to a given value Most of the time positive float: - lower than 1 to diminish the weight - higher than 1 to increase the weight Could be negative but not unless you understand what is going on (advanced)
      Specified by:
        `boostedTo` in interface `QueryCustomization<MoreLikeThisContext>`
      Parameters:
        `boost` - the value to use as boost
      Returns:
        an instance of T for method chaining

    - #### withConstantScore

          public MoreLikeThisContext withConstantScore()

      Description copied from interface: `QueryCustomization`
      All results matching the query have a constant score equals to the boost FIXME is that true?
      Specified by:
        `withConstantScore` in interface `QueryCustomization<MoreLikeThisContext>`
      Returns:
        an instance of T for method chaining

    - #### filteredBy

          public MoreLikeThisContext filteredBy(Query filter)

      Description copied from interface: `QueryCustomization`
      Filter the query results with the given Query instance
      Specified by:
        `filteredBy` in interface `QueryCustomization<MoreLikeThisContext>`
      Parameters:
        `filter` - the Query to use as a filter
      Returns:
        an instance of T for method chaining

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