org.apache.lucene.search

## Class BM25FQuery.Builder

- java.lang.Object
- - org.apache.lucene.search.BM25FQuery.Builder

- Enclosing class:
    BM25FQuery

      public static class BM25FQuery.Builder
      extends Object

  A builder for `BM25FQuery`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Builder()` Default builder.
    `Builder(float k1, float b)` Builder with the supplied parameter values.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BM25FQuery.Builder` | `addField(String field)` Adds a field to this builder.
    `BM25FQuery.Builder` | `addField(String field, float weight)` Adds a field to this builder.
    `BM25FQuery.Builder` | `addTerm(BytesRef term)` Adds a term to this builder.
    `BM25FQuery` | `build()` Builds the `BM25FQuery`.

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

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

- - ### Constructor Detail

    - #### Builder

          public Builder()

      Default builder.

    - #### Builder

          public Builder(float k1,
                         float b)

      Builder with the supplied parameter values.
      Parameters:
        `k1` - Controls non-linear term frequency normalization (saturation).
        `b` - Controls to what degree document length normalizes tf values.

  - ### Method Detail

    - #### addField

          public BM25FQuery.Builder addField(String field)

      Adds a field to this builder.
      Parameters:
        `field` - The field name.

    - #### addField

          public BM25FQuery.Builder addField(String field,
                                             float weight)

      Adds a field to this builder.
      Parameters:
        `field` - The field name.
        `weight` - The weight associated to this field.

    - #### addTerm

          public BM25FQuery.Builder addTerm(BytesRef term)

      Adds a term to this builder.

    - #### build

          public BM25FQuery build()

      Builds the `BM25FQuery`.

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.