queries

What is search query
{ "query": { "match_all": {} } }

params

  • match_all
  • size (default to 10) how many search hits
  • from - where to start, useful for paging (default 0)
  • sort
  • balance -> order
  • _source - can be specified to only return specific fields (SQL select from)
  • match (SQL where)
  • match_phrase (SQL where exact)
  • bool
  • must/must_not -> array contains params and relationship
  • should -> ... or relationship
  • _score - result relevancy
  • filter
  • range - balance -> gte, lte, etc, use with filter

aggrgation

  • aggs (SQL group by)
  • group_by_.. -> terms -> field === SELECT state, count(*) from bank GROUP BY state ORDER BY count(*) DESC
  • average_balance -> avg -> field

can be embeeddededdeed

你可能感兴趣的:(queries)