View Source Hui.Query.Facet (Hui v0.11.0)

Struct related to faceting.

example

Example

iex> x = %Hui.Query.Facet{field: ["type", "year"], query: "year:[2000 TO NOW]"}
%Hui.Query.Facet{
  contains: nil,
  "contains.ignoreCase": nil,
  "enum.cache.minDf": nil,
  excludeTerms: nil,
  exists: nil,
  facet: true,
  field: ["type", "year"],
  interval: nil,
  limit: nil,
  matches: nil,
  method: nil,
  mincount: nil,
  missing: nil,
  offset: nil,
  "overrequest.count": nil,
  "overrequest.ratio": nil,
  pivot: nil,
  "pivot.mincount": nil,
  prefix: nil,
  query: "year:[2000 TO NOW]",
  range: nil,
  sort: nil,
  threads: nil
}
iex> x |> Hui.Encoder.encode
"facet=true&facet.field=type&facet.field=year&facet.query=year%3A%5B2000+TO+NOW%5D"

Link to this section Summary

Types

t()

Struct for faceting.

Link to this section Types

@type t() :: %Hui.Query.Facet{
  contains: binary(),
  "contains.ignoreCase": binary(),
  "enum.cache.minDf": number(),
  excludeTerms: binary(),
  exists: boolean(),
  facet: boolean(),
  field: binary() | [binary()],
  interval: Hui.Query.FacetInterval.t() | [Hui.Query.FacetInterval.t()],
  limit: number(),
  matches: binary(),
  method: :enum | :fc | :fcs,
  mincount: number(),
  missing: boolean(),
  offset: number(),
  "overrequest.count": number(),
  "overrequest.ratio": number(),
  pivot: binary() | [binary()],
  "pivot.mincount": number(),
  prefix: binary(),
  query: binary() | [binary()],
  range: Hui.Query.FacetRange.t() | [Hui.Query.FacetRange.t()],
  sort: :count | :index,
  threads: number()
}

Struct for faceting.

Link to this section Functions

@spec new() :: t()
Link to this function

new(field, query \\ nil)

View Source
@spec new(binary() | [binary()], binary() | [binary()]) :: t()