How to create sample data to perform searches using elastic search?

sample-data-elastic-search

Step 1 – Go to: http://www.json-generator.com/

Step 2 – Download and save as customers_full.json

Step 3 – Open customers_full.json in sublimetext

  • Remove the array brackets
  • Find-Replace },{ with }\n{ in the regex mode on sublime text
  • Find-Replace {“name” with {“index” : {}}\n{“name” in the regex model on sublime text

Now the file is in a format that can be parsed by elastic search.