2017-09-26 124 views
0

我在elasticsearch中保存了scrapy爬行数据。在elasticsearch中保存了数百个文档,但在elasticsearch中仅显示五个文档。如何在弹性搜索中搜索所有数据

Elasticsearch查询:

curl http://localhost:9200/mall/search/_search?pretty 

上述查询的结果:

{ 
    "took": 4, 
    "timed_out": false, 
"_shards": { 
    "total": 5, 
    "successful": 5, 
    "skipped": 0, 
    "failed": 0 
}, 
"hits": { 
    "total": 397, 
    "max_score": 1, 
    "hits": [ 
     { 
      "_index": "mall", 
      "_type": "search", 
      "_id": "73f419e9b8b59a60315280a8df765e11bc8fc0ac", 
      "_score": 1, 
      "_source": { 
       "category": "노트북", 
       "count": 48, 
       "img": "http://image.auction.co.kr/itemimage/12/2e/dd/122edd2be6.jpg", 
       "title": "<h1 class=\"itemtit\">[MSI] MSI 최강 게이밍 노트북 GP62-7RDX Leopard ultimate</h1>", 
       "url": "http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=B439698159&keyword=&Fwc=22160000&scoredtype=0", 
       "price": "1,129,000", 
       "site": "auction" 
      } 
     }, 
     { 
      "_index": "mall", 
      "_type": "search", 
      "_id": "6fb57d6ecf908ed00512a0ba1f0ba23cdf2d5615", 
      "_score": 1, 
      "_source": { 
       "category": "노트북", 
       "count": 2117, 
       "img": "http://image.auction.co.kr/itemimage/10/b9/f4/10b9f41526.jpg", 
       "title": "<h1 class=\"itemtit\">노트북 XH57 BossMonster Hero456GT 게이밍</h1>", 
       "url": "http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=B389377365&keyword=&Fwc=22160000&scoredtype=0", 
       "price": "668,990", 
       "site": "auction" 
      } 
     }, 
     { 
      "_index": "mall", 
      "_type": "search", 
      "_id": "0a9760b5d349eac8282808d954366f1ec5800c9d", 
      "_score": 1, 
      "_source": { 
       "category": "노트북", 
       "count": 3, 
       "img": "http://image.auction.co.kr/itemimage/11/34/bb/1134bb9016.jpg", 
       "title": "<h1 class=\"itemtit\">[삼성전자] 삼성 신모델 NT300E5Q-KD5S-7 (i5/SSD120G)win7 비즈</h1>", 
       "url": "http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=B407944583&keyword=&Fwc=22160000&scoredtype=0", 
       "price": "799,000", 
       "site": "auction" 
      } 
     }, 
     { 
      "_index": "mall", 
      "_type": "search", 
      "_id": "c591cc96b2e4af69b382c328757348410739f873", 
      "_score": 1, 
      "_source": { 
       "category": "노트북", 
       "count": 24, 
       "img": "http://image.auction.co.kr/itemimage/12/64/f9/1264f91be6.jpg", 
       "title": "<h1 class=\"itemtit\">[파빌리온] 9월특가+GIFT/i7/GTX1050/NVMe/게이밍 15-bc223TX_LE</h1>", 
       "url": "http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=B402800443&keyword=&Fwc=22160000&scoredtype=0", 
       "price": "1,299,000", 
       "site": "auction" 
      } 
     }, 
     { 
      "_index": "mall", 
      "_type": "search", 
      "_id": "ca57eab78a65df174c811c9517a28c13dcaf3ae2", 
      "_score": 1, 
      "_source": { 
       "category": "노트북", 
       "count": 88, 
       "img": "http://image.auction.co.kr/itemimage/11/c4/56/11c456a8c6.jpg", 
       "title": "<h1 class=\"itemtit\">노트북 XF57 BossMonster Lv.61 게이밍</h1>", 
       "url": "http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=B391694689&keyword=&Fwc=22160000&scoredtype=0", 
       "price": "658,990", 
       "site": "auction" 
      } 
     }, 
     { 
      "_index": "mall", 
      "_type": "search", 
      "_id": "ed71876733cccfb2b1327d70d5864835bb7463ec", 
      "_score": 1, 
      "_source": { 
       "category": "PC서버", 
       "count": 9, 
       "img": "http://image.auction.co.kr/itemimage/d6/a4/2d/d6a42d016.jpg", 
       "title": "<h1 class=\"itemtit\">[HP] HP 워크스테이션 Z800 Z600</h1>", 
       "url": "http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=B261811590&keyword=&Fwc=22250000&scoredtype=0", 
       "price": "1,200,000", 
       "site": "auction" 
      } 
     }, 
     { 
      "_index": "mall", 
      "_type": "search", 
      "_id": "80b19759e945789dd2e9956de22ea4f2c3746d8a", 
      "_score": 1, 
      "_source": { 
       "category": "PC서버", 
       "count": 92, 
       "img": "http://image.auction.co.kr/itemimage/b1/f0/78/b1f078a36.jpg", 
       "title": "<h1 class=\"itemtit\">LS-LS12 랜스타 고급 RJ-45 랜 선택기 1:2 8P8C</h1>", 
       "url": "http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=A980343024&keyword=&Fwc=22250000&scoredtype=0", 
       "price": "5,770", 
       "site": "auction" 
      } 
     }, 
     { 
      "_index": "mall", 
      "_type": "search", 
      "_id": "34d1d3cfef1a8e643a3c37f520cb71979d669613", 
      "_score": 1, 
      "_source": { 
       "category": "노트북", 
       "count": 111, 
       "img": "http://image.auction.co.kr/itemimage/12/a4/4a/12a44a5d86.jpg", 
       "title": "<h1 class=\"itemtit\">최종가71만 사은품 3종 게이밍노트북 HP 15-bc229TX</h1>", 
       "url": "http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=B435753012&keyword=&Fwc=22160000&scoredtype=0", 
       "price": "759,000", 
       "site": "auction" 
      } 
     }, 
     { 
      "_index": "mall", 
      "_type": "search", 
      "_id": "026408368c6ef8f8f03a338276c3889d44bd25ac", 
      "_score": 1, 
      "_source": { 
       "category": "모니터", 
       "count": 764, 
       "img": "http://image.auction.co.kr/itemimage/12/35/07/1235076f26.jpg", 
       "title": "<h1 class=\"itemtit\">[코리아정보통신] 10 12 19인치 소형/차량용모니터/AV/CCTV/미니/보조</h1>", 
       "url": "http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=A621585384&keyword=&Fwc=01920000&scoredtype=0", 
       "price": "89,000", 
       "site": "auction" 
      } 
     }, 
     { 
      "_index": "mall", 
      "_type": "search", 
      "_id": "c791966d2cccca86c4c31061a12fc8272127d537", 
      "_score": 1, 
      "_source": { 
       "category": "모니터", 
       "count": 725, 
       "img": "http://image.auction.co.kr/itemimage/c5/e4/42/c5e442516.jpg", 
       "title": "<h1 class=\"itemtit\">[삼성전자] 삼성 S27B240B LE/27인치 대화면 풀HD LED모니터</h1>", 
       "url": "http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=B231610363&keyword=&Fwc=01920000&scoredtype=0", 
       "price": "139,000", 
       "site": "auction" 
      } 
     } 
    ] 
} 

}

该结果显示总计数397,但仅显示7的文档。我怎么解决这个问题?

+1

刚一说明。根据你最初的问题(你在这里看到10),我相信你正在读取成功的碎片计数作为文档计数。提供的答案在说明您需要指定是否要返回超过10个(默认)响应文档时是正确的 – Miek

回答

3

你需要指定大小查询参数的默认值是10

curl http://localhost:9200/mall/search/_search?size=1000&pretty