In [1]:
import os,json

In [2]:
path = "/var/www/html/geography/SE/01/STO/"
print path
from elasticsearch import Elasticsearch


/var/www/html/geography/SE/01/STO/

In [58]:
import numpy

In [59]:
numpy.version.version


Out[59]:
'1.8.1'

In [5]:
from ElasticsearchInterface import ESinterface
es = ESinterface()

In [4]:
cd git/SolarDataRESTfulAPI/


/root/git/SolarDataRESTfulAPI

In [11]:
totalquery = {"size":1000,"query": {"match_all": {} }}

In [12]:
res = es.search(index=Index,doc_type="meta-data", body=totalquery)

In [8]:
Index = "solar-sites-index"

In [13]:
res


Out[13]:
{u'_shards': {u'failed': 0, u'successful': 5, u'total': 5},
 u'hits': {u'hits': [{u'_id': u'6f075b69-b823-4e6b-8021-dd751cc79eea',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'Oslogatan 24',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 15.0,
     u'Area': 266.25,
     u'Citypart': u'HU',
     u'Citypart_nyko': 22602,
     u'Country': u'SE',
     u'County': 1,
     u'E_expected_annual': 30317.0,
     u'Latitude': 59.408243000000006,
     u'Longitude': 17.923839,
     u'Maplink': u'http://maps.google.com/?q=59.408243,17.923839',
     u'Municipality': u'STO',
     u'Operator_ID': u'b04',
     u'Orientation': 45.0,
     u'Owner': u'Svenska Bost\xe4der',
     u'Pmax': 35.5,
     u'Status': u'OK',
     u'System_supplier': u'Glacell',
     u'Yield_annual': 854.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1394092200000.0,
     u'startdate': u'2014-05-14 00:00'},
    u'_type': u'meta-data'},
   {u'_id': u'32383bde-7648-4abe-9dac-44701eabd72f',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'Kuddbygr\xe4nd 4\u201322 a',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 15.0,
     u'Citypart': u'RY',
     u'Citypart_nyko': 22405,
     u'Country': u'SE',
     u'County': 1,
     u'Latitude': 59.392118999999994,
     u'Longitude': 17.929436,
     u'Maplink': u'http://maps.google.com/?q=59.392119,17.929436',
     u'Municipality': u'STO',
     u'Operator_ID': u'f04',
     u'Orientation': 20.0,
     u'Owner': u'Familjebost\xe4der',
     u'Pmax': 23.3,
     u'Status': u'OK',
     u'System_supplier': u'Direct Energy',
     u'Yield_annual': 0.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1397016600000.0,
     u'startdate': u'2014-04-09 00:00'},
    u'_type': u'meta-data'},
   {u'_id': u'e8a13982-f651-11e3-a510-f23c9173ce4a',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'H\xe4llbybacken 7\u201315',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 14.0,
     u'Citypart': u'RY',
     u'Citypart_nyko': 22405,
     u'Country': u'SE',
     u'County': 1,
     u'Latitude': 59.38956999999999,
     u'Longitude': 17.926602,
     u'Maplink': u'http://maps.google.com/?q=59.389570,17.926602',
     u'Municipality': u'STO',
     u'Operator_ID': u'f11',
     u'Orientation': 20.0,
     u'Owner': u'Familjebost\xe4der',
     u'Pmax': 23.7,
     u'Status': u'Jonas \xe4ndrat adress',
     u'System_supplier': u'Direct Energy',
     u'Yield_annual': 0.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1396843200000.0,
     u'startdate': u'2014-04-07 00:00'},
    u'_type': u'meta-data'},
   {u'_id': u'e63710a4-78d9-4071-9a2e-ad35534355f4',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'Oslogatan 22',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 15.0,
     u'Area': 277.5,
     u'Citypart': u'HU',
     u'Citypart_nyko': 22602,
     u'Country': u'SE',
     u'County': 1,
     u'E_expected_annual': 31561.0,
     u'Latitude': 59.40835,
     u'Longitude': 17.923796,
     u'Maplink': u'http://maps.google.com/?q=59.408350,17.923796',
     u'Municipality': u'STO',
     u'Operator_ID': u'b03',
     u'Orientation': -45.0,
     u'Owner': u'Svenska Bost\xe4der',
     u'Pmax': 37.0,
     u'Status': u'OK',
     u'System_supplier': u'Glacell',
     u'Yield_annual': 853.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1394019000000.0,
     u'startdate': u'2014-05-14 00:00'},
    u'_type': u'meta-data'},
   {u'_id': u'802afb51-c5eb-4230-9b22-9a77ef7260b3',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'Oslogatan 27',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 22.0,
     u'Area': 142.5,
     u'Citypart': u'HU',
     u'Citypart_nyko': 22602,
     u'Country': u'SE',
     u'County': 1,
     u'E_expected_annual': 16606.0,
     u'Latitude': 59.406707,
     u'Longitude': 17.924208,
     u'Maplink': u'http://maps.google.com/?q=59.406707,17.924208',
     u'Municipality': u'STO',
     u'Operator_ID': u'b05',
     u'Orientation': 45.0,
     u'Owner': u'Svenska Bost\xe4der',
     u'Pmax': 19.0,
     u'Status': u'OK',
     u'System_supplier': u'Glacell',
     u'Yield_annual': 874.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1394033400000.0,
     u'startdate': u'2014-05-14 00:00'},
    u'_type': u'meta-data'},
   {u'_id': u'2a31fb24-347b-4924-ab89-5c434771a2ae',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'Oslogatan 38',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 22.0,
     u'Area': 191.25,
     u'Citypart': u'HU',
     u'Citypart_nyko': 22602,
     u'Country': u'SE',
     u'County': 1,
     u'E_expected_annual': 22287.0,
     u'Latitude': 59.407183999999994,
     u'Longitude': 17.922809,
     u'Maplink': u'http://maps.google.com/?q=59.407184,17.922809',
     u'Municipality': u'STO',
     u'Operator_ID': u'b06',
     u'Orientation': 45.0,
     u'Owner': u'Svenska Bost\xe4der',
     u'Pmax': 25.5,
     u'Status': u'OK',
     u'System_supplier': u'Glacell',
     u'Yield_annual': 874.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1394035200000.0,
     u'startdate': u'2014-05-14 00:00'},
    u'_type': u'meta-data'},
   {u'_id': u'b0dd71a8-efe8-41eb-bab1-633ebaaa778c',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'Stavbygr\xe4nd 1\u201319',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 15.0,
     u'Citypart': u'RY',
     u'Citypart_nyko': 22405,
     u'Country': u'SE',
     u'County': 1,
     u'Latitude': 59.392247,
     u'Longitude': 17.928606,
     u'Maplink': u'http://maps.google.com/?q=59.392247,17.928606',
     u'Municipality': u'STO',
     u'Operator_ID': u'f07',
     u'Orientation': 20.0,
     u'Owner': u'Familjebost\xe4der',
     u'Pmax': 43.4,
     u'Status': u'OK',
     u'System_supplier': u'Direct Energy',
     u'Yield_annual': 0.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1397118600000.0,
     u'startdate': u'2014-04-08 00:00'},
    u'_type': u'meta-data'},
   {u'_id': u'46d55815-f927-459f-a8e2-8bbcd88008ee',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'Frihamnsgatan 60',
     u'Administrative_area': u'STERMALM',
     u'Adminstrative_area_nr': 15,
     u'Citypart': u'GA',
     u'Citypart_nyko': 12303,
     u'Country': u'SE',
     u'County': 1,
     u'Height': 212.0,
     u'Latitude': 59.344505000000005,
     u'Longitude': 18.126523000000002,
     u'Maplink': u'http://maps.google.com/?q=59.344505,18.126523',
     u'Municipality': u'STO',
     u'Operator_ID': u'h00',
     u'Owner': u'Stockholms hamnar',
     u'Pmax': 200.0,
     u'Status': u'OK ',
     u'System_supplier': u'Direct Energy',
     u'Yield_annual': 0.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1381900800000.0,
     u'startdate': u'2013-10-16 00:00'},
    u'_type': u'meta-data'},
   {u'_id': u'f1136e33-d227-4fbd-ae72-d3488d70ba89',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'Oslogatan 10',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 16.0,
     u'Area': 210.0,
     u'Citypart': u'HU',
     u'Citypart_nyko': 22602,
     u'Country': u'SE',
     u'County': 1,
     u'E_expected_annual': 23996.0,
     u'Latitude': 59.409071999999995,
     u'Longitude': 17.925554,
     u'Maplink': u'http://maps.google.com/?q=59.409072,17.925554',
     u'Municipality': u'STO',
     u'Operator_ID': u'b01',
     u'Orientation': 45.0,
     u'Owner': u'Svenska Bost\xe4der',
     u'Pmax': 28.0,
     u'Status': u'OK',
     u'System_supplier': u'Glacell',
     u'Yield_annual': 857.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1394089800000.0,
     u'startdate': u'2014-05-14 00:00'},
    u'_type': u'meta-data'},
   {u'_id': u'4cf6c743-8d0b-45f0-aa72-8a0c10315cf5',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'Askebykroken 26\u201332',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 18.0,
     u'Citypart': u'RY',
     u'Citypart_nyko': 22405,
     u'Country': u'SE',
     u'County': 1,
     u'Latitude': 59.391149,
     u'Longitude': 17.92614,
     u'Maplink': u'http://maps.google.com/?q=59.391149,17.926140',
     u'Municipality': u'STO',
     u'Operator_ID': u'f09',
     u'Orientation': 20.0,
     u'Owner': u'Familjebost\xe4der',
     u'Pmax': 19.1,
     u'Status': u'OK',
     u'System_supplier': u'Direct Energy',
     u'Yield_annual': 0.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1395808200000.0},
    u'_type': u'meta-data'},
   {u'_id': u'c6261166-f651-11e3-a510-f23c9173ce4a',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'H\xe4llbybacken 17-23',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 14.0,
     u'Citypart': u'RY',
     u'Citypart_nyko': 22405,
     u'Country': u'SE',
     u'County': 1,
     u'Maplink': u'http://maps.google.com/?q=,',
     u'Municipality': u'STO',
     u'Operator_ID': u'f10',
     u'Orientation': 20.0,
     u'Owner': u'Familjebost\xe4der',
     u'Pmax': 21.4,
     u'Status': u'Jonas \xe4ndrat adress',
     u'System_supplier': u'Direct Energy',
     u'data_collection_operator': u'SLB',
     u'online_since': 1396843200000.0,
     u'startdate': u'2014-04-07 00:00'},
    u'_type': u'meta-data'},
   {u'_id': u'4a39b124-f594-11e3-a510-f23c9173ce4a',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'Oslogatan 11',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 16.0,
     u'Area': 210.0,
     u'Citypart': u'HU',
     u'Citypart_nyko': 22602,
     u'Country': u'SE',
     u'County': 1,
     u'E_expected_annual': 23996.0,
     u'Latitude': 59.4078,
     u'Longitude': 17.92644,
     u'Maplink': u'http://maps.google.com/?q=59.407800,17.926440',
     u'Municipality': u'STO',
     u'Operator_ID': u'b02',
     u'Orientation': 45.0,
     u'Owner': u'Svenska Bost\xe4der',
     u'Pmax': 28.0,
     u'Status': u'OK',
     u'System_supplier': u'Glacell',
     u'Yield_annual': 857.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1402018200000.0,
     u'startdate': u'2014-05-14 00:00'},
    u'_type': u'meta-data'},
   {u'_id': u'face0d13-b22d-48fe-bec1-d29732604133',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'Hinderstorps gr\xe4nd 4\u201312',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 9.0,
     u'Citypart': u'RY',
     u'Citypart_nyko': 22405,
     u'Country': u'SE',
     u'County': 1,
     u'Latitude': 59.389258999999996,
     u'Longitude': 17.927305,
     u'Maplink': u'http://maps.google.com/?q=59.389259,17.927305',
     u'Municipality': u'STO',
     u'Operator_ID': u'f05',
     u'Orientation': 20.0,
     u'Owner': u'Familjebost\xe4der',
     u'Pmax': 20.1,
     u'Status': u'Jonas \xe4ndrat adress',
     u'System_supplier': u'Direct Energy',
     u'Yield_annual': 0.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1396930200000.0,
     u'startdate': u'2014-04-08 00:00'},
    u'_type': u'meta-data'},
   {u'_id': u'709e47a1-ca88-4c22-890f-2407e9cb131a',
    u'_index': u'solar-sites-index',
    u'_score': 1.0,
    u'_source': {u'Address': u'Hinderstorps gr\xe4nd 14-20',
     u'Administrative_area': u'KISTA-RINKEBY',
     u'Adminstrative_area_nr': 1,
     u'Angle': 9.0,
     u'Citypart': u'RY',
     u'Citypart_nyko': 22405,
     u'Country': u'SE',
     u'County': 1,
     u'Latitude': 59.388574,
     u'Longitude': 17.92953,
     u'Maplink': u'http://maps.google.com/?q=59.388574,17.929530',
     u'Municipality': u'STO',
     u'Operator_ID': u'f06',
     u'Orientation': 20.0,
     u'Owner': u'Familjebost\xe4der',
     u'Pmax': 15.3,
     u'Status': u'Jonas \xe4ndrat adress',
     u'System_supplier': u'Direct Energy',
     u'Yield_annual': 0.0,
     u'data_collection_operator': u'SLB',
     u'online_since': 1396930200000.0,
     u'startdate': u'2014-04-08 00:00'},
    u'_type': u'meta-data'}],
  u'max_score': 1.0,
  u'total': 14},
 u'timed_out': False,
 u'took': 26}

In [ ]: