pythonelasticsearchpyelasticsearch

How to get all indexed data from elastic search


I have indexed data from MySQL to elasticsearch using pyelasticsearch client. But when when I try to get the indexed data I am getting only few records I have 166 records but I am getting only this :

{
  "took": 23,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 166,
    "max_score": 1.0,
    "hits": [
      {
        "_index": "scraped_data",
        "_type": "products",
        "_id": "08e6fp_7T6OJ5LcNaf9juQ",
        "_score": 1.0,
        "_source": {
          "productTitle": "Elegant Jacquard Stockings In Black",
          "productPrice": 0.0,
          "hasVariants": 1,
          "currency": "INR",
          "productURL": "http://www.moodsofcloe.com/product/elegant-jacquard-stockings-in-black",
          "productDesc": "Turn up the heat tonight Sensual jacquard panty hose is made from high tech fiber providing super restoring force and dense texture Its lovely soft sheen is enhanced with a trail of floral motif ",
          "availability": 1,
          "productMRP": 449.0,
          "productSite": "http://www.moodsofcloe.com/",
          "productCategory": "women",
          "image_paths": "[\"full/aac34369c3bb33fe31589452b3f1e9b4f5371c13.jpg\", \"full/fe4be81ee2c4fff7ea1d475824ba458a43c177d0.jpg\", \"full/460f0f7b448720d1c0c6389e0fb50bb7a80e4d82.jpg\", \"full/b8a219f8e3295d30cc244ff0a08f3fdade6e4eb8.jpg\", \"full/a5c5cb84a4c1f07931cf9a116c3abfb11d4da18a.jpg\", \"full/b1e8902c029a1eb2225f0fac02ceef6f27fa3c22.jpg\", \"full/6b6916dda672112660259f00383669b4916aea25.jpg\", \"full/3f7a6aa16c79ef6d5df8d19bbe7480742925256c.jpg\"]",
          "productSubCategory": "stockings"
        }
      },
      {
        "_index": "scraped_data",
        "_type": "products",
        "_id": "s3Q6tNP1SXGvlz7WCFsecg",
        "_score": 1.0,
        "_source": {
          "productTitle": "Elegant Floral Stockings In Black",
          "productPrice": 0.0,
          "hasVariants": 1,
          "currency": "INR",
          "productURL": "http://www.moodsofcloe.com/product/elegant-floral-stockings-in-black",
          "productDesc": "Elegant Floral Stockings In Black Sensual jacquard panty hose is made from high tech fiber providing super restoring force and dense texture Its lovely soft sheen enhanced with a trail of floral motif ",
          "availability": 1,
          "productMRP": 449.0,
          "productSite": "http://www.moodsofcloe.com/",
          "productCategory": "women",
          "image_paths": "[\"full/85cc2fdbf2781b0187d469d69e0a1bfb10c64aea.jpg\", \"full/3476998ca1f5954b07b0f1bc769c04429bb8fadc.jpg\", \"full/5338053f24a56976082c7e8782665dbe0ed106d0.jpg\", \"full/3c06336f6bd2fd2aabbd0067a4dbfd72e9dcf6fe.jpg\", \"full/c0185369b18d9a0ef26948266edd980a973fd856.jpg\", \"full/33774893e7e8a10b0e59fcd7707d7eacab2168df.jpg\", \"full/90c59ab0fb13bed1552b91145a2e5f5d2d47de8f.jpg\", \"full/2127e8b15b4a53244879d9ef5ba1cd101a978f2a.jpg\"]",
          "productSubCategory": "stockings"
        }
      },
      {
        "_index": "scraped_data",
        "_type": "products",
        "_id": "vYpJMQ0GTza2PDh2U6MnEA",
        "_score": 1.0,
        "_source": {
          "productTitle": "ENAMEL FLOWER FASHION NECKLACE, NJW123",
          "productPrice": 0.0,
          "hasVariants": 0,
          "currency": "INR",
          "productURL": "http://www.n-gal.com/jewelry/enamel-flower-fashion-necklace-njw123",
          "productDesc": "ENAMEL FLOWER FASHION NECKLACE",
          "availability": 1,
          "productMRP": 575.0,
          "productSite": "http://www.n-gal.com/",
          "productCategory": "women",
          "image_paths": "[\"full/4b97d2a1ec06a29c3d0ef7b803ff181de07f8a73.jpg\"]",
          "productSubCategory": "jewellery"
        }
      },
      {
        "_index": "scraped_data",
        "_type": "products",
        "_id": "UtOxLskuTEqIa5cNhnk63Q",
        "_score": 1.0,
        "_source": {
          "productTitle": "Bra, Panty and Lingerie Organiser Travel Bag, NBB11",
          "productPrice": 0.0,
          "hasVariants": 0,
          "currency": "INR",
          "productURL": "http://www.n-gal.com/lingerie-bags/bra-panty-and-lingerie-organiser-travel-bag-nbb11",
          "productDesc": "1 You get a Bra and Panty Lingerie Carry Bag 2 It saves space inside your travelling bag and keeps all your lingerie well organised and safe 3 Saves your from embarrasment of all your lingerie lying here and there while someone else might open your wardrobe Briefcase travel bag etc 4 Comes in beautiful feminine colors and shades 5 High Quality Zipper and material to keep the bag in proper shape MATERIAL SATIN EVA LACE M R P Rs 999 00",
          "availability": 1,
          "productMRP": 699.0,
          "productSite": "http://www.n-gal.com/",
          "productCategory": "women",
          "image_paths": "[\"full/af68e31d96eb12fb8ebdcd45844247fa5b27e81a.jpg\", \"full/55ed7783ac85255150f7ba4d501b2917b9adf136.jpg\", \"full/98db4ed6a7b557cb88e3991c99eaadd5797796bd.jpg\", \"full/5c8820607520f4171aa149ec4381669f2410ad2d.jpg\", \"full/e5d57a12a6eaaa01e690d3c11428f55da5a155f0.jpg\", \"full/e87cfb4a6b1586341c5d2fd54bfa0d7273e24683.jpg\", \"full/e976c56e9170e97f451bba6e6aa3f788931edc1a.jpg\"]",
          "productSubCategory": "lingerie-bags"
        }
      },
      {
        "_index": "scraped_data",
        "_type": "products",
        "_id": "rU5OwV8jQ-GGr9co8oxj7Q",
        "_score": 1.0,
        "_source": {
          "productTitle": "Coins' Bracelet",
          "productPrice": 0.0,
          "hasVariants": 0,
          "currency": "INR",
          "productURL": "http://www.shopnineteen.com/jewelry/metal-coins-bracelet.html",
          "productDesc": "Add a bohemian appeal to your ensemble with this braided bracelet with metal coins Stack it with other metal bangles and increase your style quotient tenfold ",
          "availability": 1,
          "productMRP": 399.0,
          "productSite": "http://www.shopnineteen.com",
          "productCategory": "women",
          "image_paths": "[\"full/c293ecd489bddba86faa039a3010adae4329c776.jpg\", \"full/66069c79141609e3c9b6d2febfec4d7965fdd9d3.jpg\"]",
          "productSubCategory": "jewellery"
        }
      },
      {
        "_index": "scraped_data",
        "_type": "products",
        "_id": "gIBdMlncTJqnFd_tAJnNpw",
        "_score": 1.0,
        "_source": {
          "productTitle": "Mishka Scarlett Frost Tunic",
          "productPrice": 0.0,
          "hasVariants": 1,
          "currency": "INR",
          "productURL": "http://www.styleever.com/index.php/western/tops-tunics/mishka-scarlett-frost-tunic-2463.html",
          "productDesc": "A true touch of color and style This easy to wear design is met by an all around comfortable fit The Cherry Red material drapes perfectly for a flattering appearance A lovely scoop neck is met by feminine crochet detail that creates a wonderful textured contrast Soft short sleeves complete the look ",
          "availability": 1,
          "productMRP": 899.0,
          "productSite": "http://www.styleever.com",
          "productCategory": "women",
          "image_paths": "[\"full/f6aae3e2a27b4d45b15c6d5861abcf1481a039c6.jpg\", \"full/0761e28e43ffb05aae380900acce37a526b3a97b.jpg\", \"full/4df6dc22b2a1580346b7654f3f8cf141316dd3b4.jpg\", \"full/5b1dead1b992b0e4fd15f6c36edc2adfc4b3c6c3.jpg\"]",
          "productSubCategory": "tops"
        }
      },
      {
        "_index": "scraped_data",
        "_type": "products",
        "_id": "163mkGSbQkmCQzQE43hYbQ",
        "_score": 1.0,
        "_source": {
          "productTitle": "Mishka Sprouting Floral Kurti",
          "productPrice": 0.0,
          "hasVariants": 1,
          "currency": "INR",
          "productURL": "http://www.styleever.com/index.php/ethnic/kurtis/mishka-sprouting-floral-kurti.html",
          "productDesc": "The eyecatching and whimsical floral motif is always preferable to enhance your personality Pamper the women in you in this beautifull Kurti The unique blend of the colors and the print is making it perfect to grab the attention ",
          "availability": 1,
          "productMRP": 299.0,
          "productSite": "http://www.styleever.com",
          "productCategory": "women",
          "image_paths": "[\"full/c12be96682b49cc74a3dcc5ff153a9e5b1321e6d.jpg\", \"full/db9bc75e616bb050c1a2231e1ba65d27b16a6d31.jpg\", \"full/d29251db981c55bae72131822dbd4c9b8610a65d.jpg\", \"full/8cbfbcc356888c6dc4fb680cd0197d73a7cccafa.jpg\", \"full/a61fee8b5e782b65a759c464dc3421abc9791f3f.jpg\", \"full/c300d08af7231e31f17a9693b5acca129713c0a5.jpg\", \"full/2d1c6cab21dd8fb759ff66fe98e3cfb593599637.jpg\", \"full/e56ed457dd1d126a831592bbed78d23fc7c92dcd.jpg\", \"full/aef7b8b0861c837dea09c14b3ecc166a9c67f80f.jpg\", \"full/af335ecaec6403118505665e981632d9ba27b31d.jpg\", \"full/10f6fd7229e079e39a19cc7024e415592d0a9321.jpg\", \"full/1b7769847936bcb0ff2356afc5645c6787f1f8f3.jpg\", \"full/88211ab1f8bb4bce867535ef3527fadc4161b669.jpg\", \"full/abafd12788cd0e7c4b4a90131d9878c8b59617f7.jpg\", \"full/2a591ad13b3b2ef2c5b076e392a813b5e14edd16.jpg\", \"full/123f8ba7292dab2ef7055487abc5352e73edacad.jpg\"]",
          "productSubCategory": "kurti"
        }
      },
      {
        "_index": "scraped_data",
        "_type": "products",
        "_id": "BrTW_SBMR0KGNmkH2FLlpg",
        "_score": 1.0,
        "_source": {
          "productTitle": "Mishka Turquoise Top",
          "productPrice": 599.0,
          "hasVariants": 1,
          "currency": "INR",
          "productURL": "http://www.styleever.com/index.php/western/tops-tunics/mishka-turquoise-top.html",
          "productDesc": "This cambric top is a must have basic for every woman Made from soft caress cambric this sleeveless top features a scoop neckline with collar and side vents at the hem The flattering and easy silhouette makes it great for any body type and the full coverage style makes this piece an essential for your wardrobe ",
          "availability": 1,
          "productMRP": 899.0,
          "productSite": "http://www.styleever.com",
          "productCategory": "women",
          "image_paths": "[\"full/7305235ebe9c0413e8117eae2e72681a867c9be7.jpg\", \"full/a000d5b7a2cc3e90533532c4ad4343a304e51b91.jpg\", \"full/4370b40ef6decf52cf6893e2ed11bb7ae376bcc3.jpg\", \"full/a0a7763b1b9667be4d6a62500da8cb0ab74dafa6.jpg\"]",
          "productSubCategory": "tops"
        }
      },
      {
        "_index": "scraped_data",
        "_type": "products",
        "_id": "Tu9kmjiCTiG8C5R6qX23qA",
        "_score": 1.0,
        "_source": {
          "productTitle": "Amante Long Leg Side Stripe Swimsuit",
          "productPrice": 573.0,
          "hasVariants": 1,
          "currency": "INR",
          "productURL": "http://www.zivame.com/swimwear/amante-long-leg-side-stripe-swimsuit.html",
          "productDesc": "Flatter and support your body with this long leg swimsuit from Amante This style has shelf support padded bra in built and is made from durable chlorine resistant fabric to retain its shape Broad stripe along the side of the swimsuit gives contour to your figure Composition 80 Nylon 20 Elasthane",
          "availability": 1,
          "productMRP": 1145.0,
          "productSite": "http://www.zivame.com",
          "productCategory": "women",
          "image_paths": "[\"full/a1b844df630ac4d354207ea9b13a8fe57c497958.jpg\", \"full/f809af416c540f9e22c0528a58fe25574809c135.jpg\", \"full/24402e2c502b9b08c5cb3730007a84366c30e78d.jpg\", \"full/3d4d2667dd623ee855229b6e219e2967d2837883.jpg\", \"full/61095cc872206b8ce1bf1dff192ec0d34db5c7d8.jpg\", \"full/572cb8cfd759085b1d14a17ee260d58a4e3acb3f.jpg\", \"full/b28adc3711b155abad4b163eb0eb1fdd45d29499.jpg\", \"full/7528715b36c6e391fe82148486b899f35085919d.jpg\", \"full/6f40c67fda7dfdb0742125a35b8ef436596755d3.jpg\", \"full/092dc82f9975f509e604cf39a4bdc81a37819539.jpg\"]",
          "productSubCategory": "swimwear"
        }
      },
      {
        "_index": "scraped_data",
        "_type": "products",
        "_id": "o40F5eLhSfmvyJibQ_hX7g",
        "_score": 1.0,
        "_source": {
          "productTitle": "Cotton Saree Code 179218",
          "productPrice": 0.0,
          "hasVariants": 0,
          "currency": "INR",
          "productURL": "http://www.adachikan.net/index.php/women/cotton-sarees/cotton-saree-code-179218.html",
          "productDesc": "",
          "availability": 1,
          "productMRP": 1775.0,
          "productSite": "http://www.adachikan.net/",
          "productCategory": "women",
          "image_paths": "[\"full/502a513273e9149fd43efca9a3a4355790809d1a.jpg\", \"full/646071e3646a529272a9494f7c86c37abf75c7b4.jpg\", \"full/2ceb3abf5102e01faef2157e5901b48399e70c98.jpg\", \"full/cb0db89158241204ca27ecc72e4737e32236e096.jpg\"]",
          "productSubCategory": "sarees"
        }
      }
    ]
  }
}

Can someone please tell me what is happening ....


Solution

  • Every time you run a query you get back how many documents match (total:166), but only the first ten out of them, ordered by score. In your case the score is always since you executed a match_all query I guess.

    You can increase the number of documents that you get back using the size parameter. If you want to fetch a large set of documents you better use the scroll api though.