compoundClause property

CompoundClauseType? compoundClause
getter/setter pair

Configure whether the DSL query is generated with the compound clause of CompoundClauseType.must or CompoundClauseType.filter. If nothing is passed the default is to use CompoundClauseType.must. Setting the compound clause to filter allows search engine to cache and allows for higher throughput in cases where scoring isn’t relevant (e.g. term, geo or range type of queries that act as filters on the data)

This property only has an effect when the search engine is either elasticsearch or opensearch.

Note: compoundClause is supported with v8.16.0 (server) as well as with serverless search.

/// For example,

SearchBox(
  ...
  compoundClause:  CompoundClauseType.filter
)

Implementation

CompoundClauseType? compoundClause;