FieldableNode (Lucene 10.5.0 queryparser API)
Description: declaration: package: org.apache.lucene.queryparser.flexible.core.nodes, interface: FieldableNode

Package org.apache.lucene.queryparser.flexible.core.nodes

# Interface FieldableNode

All Superinterfaces:
  `QueryNode`

All Known Subinterfaces:
  `FieldValuePairQueryNode<T>`, `RangeQueryNode<T>`

All Known Implementing Classes:
  `AbstractRangeQueryNode`, `FieldQueryNode`, `FuzzyQueryNode`, `IntervalQueryNode`, `MultiPhraseQueryNode`, `PhraseSlopQueryNode`, `PointQueryNode`, `PointRangeQueryNode`, `PrefixWildcardQueryNode`, `QuotedFieldQueryNode`, `RegexpQueryNode`, `SlopQueryNode`, `TermRangeQueryNode`, `TokenizedPhraseQueryNode`, `WildcardQueryNode`

public interface FieldableNode extends QueryNode
A query node implements `FieldableNode` interface to indicate that its children and itself are associated to a specific field.

If it has any children which also implements this interface, it must ensure the children are associated to the same field.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CharSequence`
  `getField()`
  `void`
  `setField(CharSequence fieldName)`
  Associates the node to a field.

  ### Methods inherited from interface org.apache.lucene.queryparser.flexible.core.nodes.QueryNode

  `add, add, cloneTree, containsTag, getChildren, getParent, getTag, getTagMap, isLeaf, removeChildren, removeFromParent, set, setTag, toQueryString, toString, unsetTag`

- ## Method Details

  - ### getField

    CharSequence getField()
    Returns:
      name of the filed associated to the node and every node under it

  - ### setField

    void setField(CharSequence fieldName)
    Associates the node to a field.
    Parameters:
      `fieldName` - the field name