queries

作者: 方方块 | 来源:发表于2017-07-19 03:48 被阅读0次

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

      本文链接:https://www.haomeiwen.com/subject/rkmkkxtx.html