CombinedFieldQuery.Builder (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.search, class: CombinedFieldQuery, class: Builder

Package org.apache.lucene.search

# Class CombinedFieldQuery.Builder

java.lang.Object
org.apache.lucene.search.CombinedFieldQuery.Builder

Enclosing class:
  `CombinedFieldQuery`

public static class CombinedFieldQuery.Builder extends Object
A builder for `CombinedFieldQuery`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder(String term)`
  Create a builder for the given term `String`.
  `Builder(BytesRef term)`
  Create a builder for the given term bytes.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CombinedFieldQuery.Builder`
  `addField(String field)`
  Adds a field to this builder.
  `CombinedFieldQuery.Builder`
  `addField(String field, float weight)`
  Adds a field to this builder.
  `CombinedFieldQuery`
  `build()`
  Builds the `CombinedFieldQuery`.

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

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

- ## Constructor Details

  - ### Builder

    public Builder(String term)
    Create a builder for the given term `String`.

  - ### Builder

    public Builder(BytesRef term)
    Create a builder for the given term bytes.

- ## Method Details

  - ### addField

    public CombinedFieldQuery.Builder addField(String field)
    Adds a field to this builder.
    Parameters:
      `field` - The field name.

  - ### addField

    public CombinedFieldQuery.Builder addField(String field, float weight)
    Adds a field to this builder.
    Parameters:
      `field` - The field name.
      `weight` - The weight associated to this field.

  - ### build

    public CombinedFieldQuery build()
    Builds the `CombinedFieldQuery`.