| { |
| {% if last %}"last": "{{ last }}",{% endif %} |
| {% if prev %}"prev": "{{ prev }}",{% endif %} |
| {% if next %}"next": "{{ next }}",{% endif %} |
| {% if first %}"first": "{{ first }}",{% endif %} |
| "results":[ |
| {% for doc in docs %} |
| { |
| "id": "{{ doc['id'] }}", |
| "time": "{{ doc['time'] }}", |
| "point": "{{ doc['loc'] }}", |
| "sea_water_temperature": {{ doc['sst'] | jsonify }}, |
| "sea_water_temperature_depth": {{ doc['sst_depth'] | jsonify }}, |
| "sea_water_temperature_quality": {{ doc['sst_qc_flag'] | jsonify }}, |
| "wind_speed": {{ doc['wind_speed'] | jsonify }}, |
| "eastward_wind": {{ doc['wind_u'] | jsonify }}, |
| "northward_wind": {{ doc['wind_v'] | jsonify }}, |
| "wind_depth": {{ doc['wind_depth'] | jsonify }}, |
| "wind_speed_quality": {{ doc['wind_qc_flag'] | jsonify }}, |
| "wind_component_quality": {{ doc['wind_qc_flag'] | jsonify }}, |
| "sea_water_salinity": {{ doc['sss'] | jsonify }}, |
| "sea_water_salinity_depth": {{ doc['sss_depth'] | jsonify }}, |
| "sea_water_salinity_quality": {{ doc['sss_qc_flag'] | jsonify }}, |
| "mission": {{ doc['mission'] | jsonify }}, |
| "platform": {{ doc['platform'] | jsonify }}, |
| "device": {{ doc['device'] | jsonify }}, |
| "metadata": {{ doc['meta'] }} |
| } |
| {% if not loop.last %} |
| , |
| {% endif %} |
| {% endfor %} |
| ] |
| ,"totalResults":{{ numFound }} |
| ,"startIndex":{{ startIndex }} |
| ,"itemsPerPage":{{ itemsPerPage }} |
| {% if stats %} |
| , |
| "stats_fields": {{ stats['stats_fields'] | jsonify }} |
| {% endif %} |
| {% if facets %} |
| , |
| "facets":[ |
| {% for key, facet in facets['facet_fields'].iteritems() %} |
| { |
| "field": "{{ key }}", |
| "values":[ |
| {% for i in range(0, facet|count, 2) %} |
| { |
| "count":{{facet[i+1] }}, |
| "value": "{{ facet[i] }}" |
| } |
| {% if not loop.last %} |
| , |
| {% endif %} |
| {% endfor %} |
| ] |
| } |
| {% if not loop.last %} |
| , |
| {% endif %} |
| {% endfor %} |
| ] |
| {% endif %} |
| } |