设为首页 加入收藏

TOP

〈三〉ElasticSearch的认识:搜索、过滤、排序(一)
2019-09-23 11:18:14 】 浏览:149
Tags:ElasticSearch 认识 搜索 过滤 排序

发表日期:2019年9月20日


上节回顾


1.讲了如何对索引CRUD
2.重新解释了type,只是元数据的效果
3.讲了如何对文档CRUD



本节前言


1.ElasticSearch的主要功能是搜索,这节也将会主要讲搜索,将会涉及到如何使用关键字进行全文搜索
2.除了讲搜索,也会讲到搜索相关的“分页”、“排序”、“聚合分析”等内容。
3.还会补充一些与搜索相关的知识。



文档的搜索




测试数据:请先插入以下数据,以便练习搜索功能
【突然看了一下之前的博文,发现我后面去准备数据的时候写错格式了。所以导致id为1,2,3的文档和后面的文档的字段不一样。你可以仅仅基于以下的数据来测试】

PUT /douban/book/5
{
    "book_id":5,
    "book_name":"A Boy's Own Story",
    "book_author":"Edmund White",
    "book_pages":217,
    "book_express":"Vintage",
    "publish_date":"1994-02-01",
    "book_summary":"""

  An instant classic upon its original publication, A Boy's Own Story is the first of Edmund White's highly acclaimed trilogy of autobiographical novels that brilliantly evoke a young man's coming of age and document American gay life through the last forty years.
  
  The nameless narrator in this deeply affecting work reminisces about growing up in the 1950s with emotionally aloof, divorced parents, an unrelenting sister, and the schoolmates who taunt him. He finds consolation in literature and his fantastic imagination. Eager to cultivate intimate, enduring friendships, he becomes aware of his yearning to be loved by men, and struggles with the guilt and shame of accepting who he is. Written with lyrical delicacy and extraordinary power, A Boy's Own Story is a triumph."""
}


PUT /douban/book/6
{
    "book_id":6,
    "book_name":"The Lost Language of Cranes",
    "book_author":"David Leavitt",
    "book_pages":352,
    "book_express":"Bloomsbury Publishing PLC",
    "publish_date":"2005-05-02",
    "book_summary":"""David Leavitt's extraordinary first novel, now reissued in paperback, is a seminal work about family, sexual identity, home, and loss. Set in the 1980s against the backdrop of a swiftly gentrifying Manhattan, The Lost Language of Cranes tells the story of twenty-five-year-old Philip, who realizes he must come out to his parents after falling in love for the first time with a man. Philip's parents are facing their own crisis: pressure from developers and the loss of their longtime home. But the real threat to this family is Philip's father's own struggle with his latent homosexuality, realized only in his Sunday afternoon visits to gay porn theaters. Philip's admission to his parents and his father's hidden life provoke changes that forever alter the landscape of their worlds."""
}

PUT /douban/book/7
{
    "book_id":7,
    "book_name":"Immortality",
    "book_author":"Milan Kundera",
    "book_pages":400,
    "book_express":"Faber and Faber",
    "publish_date":"2000-08-21",
    "book_summary":"""Milan Kundera's sixth novel springs from a casual gesture of a woman to her swimming instructor, a gesture that creates a character in the mind of a writer named Kundera. Like Flaubert's Emma or Tolstoy's Anna, Kundera's Agnes
首页 上一页 1 2 3 4 5 6 下一页 尾页 1/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇SQL DROP INDEX 语句 下一篇Part_one:Redis第一次接触

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目