two node Elasticsearch cluster having data sync issue - elasticsearch
I have a 2 node Elasticsearch cluster with both as master eligible nodes. They both are formed a cluster and named as **node1 and **node2. Couple of weeks back we have upgraded the version of ES from 7.9 to 7.17.4. Now there was an issue reported that there is some data sync issue between the nodes.
When hitting elasticsearch url we are seeing different data for an index. so we tried to hit two node urls individually as below and we observed different data on each node.
curl http://node1:9200/vehicle/_search?q=***
curl http://node2:9200/vehicle/_search?q=***
I know that data on a cluster will get synced automatically on elasticsearch but I think this is not happening in my case. Could you please let me know why this is happening ? is there anything that I can forcefully sync data between nodes.
What could be the reason to get different data on the nodes ? what should I check why there is a different data getting populated ?
Here are the curl queries and their results on two nodes. Node 2 has an additional object along with the first object with a small difference in the last line.
curl http://node1:9200/vehicle/_search?q=XYZ
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 7.8380795,
"hits": [
{
"_index": "vehicle_inventory",
"_type": "_doc",
"_id": "109802",
"_score": 7.8380795,
"_source": {
"abs": "Yes",
"addressLine1": "965 ALDRIN DR",
"addressLine2": " ",
"aeroCabExtenders": "Yes",
"aeroRoof": " ",
"aeroSideFairings": "Yes",
"airConditioning": "Yes",
"areaName": " ",
"areaNumber": "0617",
"bodyMake": "NULL",
"bodySerialNumber": "NULL",
"bodyFloorType": "",
"bodyRoofType": "",
"brakeType": "NULL",
"cabStyle": "Conventional",
"category": "TRACTOR",
"chassisBumper": "AERO",
"chassisMakeCode": "FTL",
"cdlRequired": "Yes",
"city": "Eagan",
"color": "White",
"modified_color": "WHITE",
"compared": false,
"saved": false,
"country": "US",
"countryExt": "United States",
"collisionWarning": "No",
"collisionWarningModel": "",
"customerNumber": "RENTAL",
"description": "AVAILABLE JANUARY 2022",
"displayDeliveryCal": "Y",
"districtName": " ",
"driverSeatType": "AIR",
"emailAddress": "E-MAIL.GENERAL.LOCATION#XXXXXX",
"engineBrake": "Yes",
"engineMake": "Detroit",
"engineModel4": "DD15AT",
"engineHours": 0,
"faxNumber": "06516860476",
"featuredListing": "Y",
"frontAxleCapacity": "13300",
"frontWheelType": "",
"fuelType": "DIESEL",
"grossVehicleWeight": 80000,
"height": "NULL",
"horsepower": 455,
"image": "/usedtrucks/image/109802/1",
"interiorLevel": "PREMIUM",
"individualPageUrl": "",
"liftGate": "NULL",
"liftGateCapacity": "0",
"liftGateModel": " ",
"loadLength": "NULL",
"make": "Freightliner",
"managersSpecial": "false",
"managerSpecialDiscountRetail": "0",
"managerSpecialDiscountWholeSale": "0",
"mileage": "701,830 miles",
"model": "Cascadia 12564ST",
"newListing": "false",
"numberOfBunks": "2",
"numberOfDriveAxles": "2",
"numberOfTanks": "Dual",
"numericHeight": "",
"numericLoadLength": -1,
"numericWidth": "",
"offLease": "N",
"originalWholeSalePrice": "64,500",
"originalRetailPrice": "64,500",
"phoneNumber": "1-866-309-1962",
"promotionVehicle": "true",
"rearAxleCapacity": "40000",
"rearAxleMake": "Detroit",
"rearDoor": "NULL",
"rearRatio": "2.53",
"rearWheelType": "",
"reeferStandby": "",
"refrigerationHours": "",
"refrigerationMake": "NULL",
"refrigerationModel": "NULL",
"retailPrice": "54,500",
"salePutUpDate": "2021-12-17 00:00:00",
"sideConstruction": "NULL",
"sideDoor": "NULL",
"sleeperSize": "72",
"sleeperType": "Raised Roof",
"slidingFifthWheel": "Yes",
"state": "MN",
"status": "ACTIVE",
"statusComments": " ",
"sale_reason_desc": "AVAILABLE JANUARY 2022",
"saleType": " ",
"size": "",
"suspension": "Air",
"tareWeight": "18795",
"thumbnail": "usedtrucks/image/109802t/1",
"tireSize": "11R22.5",
"tireType": "S/WAY",
"totalFuelCapacity": "220",
"transmissionMake": "Detroit",
"transmissionModel": "12DA1550",
"transmissionSpeed": "12",
"transmissionType": "Automatic",
"type": "Sleeper Tractor",
"unitNumber": "109802",
"use": "RENTAL",
"vin": "3AKJGLD53FSGJ8668",
"wheelBase": "228\"",
"wheelType": "Aluminum",
"wholesalePrice": "59,500",
"width": "NULL",
"year": 2015,
"zip": "55121",
"numeric_mileage": 701830,
"numeric_retail_price": 54500,
"numeric_wholesale_price": 59500,
"dLatitude": 44.944400787353516,
"dLongitude": -93.09329986572266,
"bodyModel": null,
"promotionAmount": "10,000",
"salePrice": 0,
"location": "016510",
"jpegImage": "/usedtrucks/JpgServlet/109802_1.jpg",
"translatedCategory": "Heavy Duty Tractors",
"originalCategory": "Heavy Duty Tractors",
"monFriHours": "M-F 8:00 am to 8:00 pm ET",
"satHours": "Sat 9:00 am to 3:00 pm ET",
"mobileSitePhone": "1-800-485-9671",
"salePutUpDatesort": "2021-12-17",
"stringyear": "2015",
"range_grossVehicleWeight": null,
"range_loadLength": null,
"range_horsepower": "401 and more",
"range_cabType": "Raised Roof",
"range_retailCenter": null,
"viewCount": "222ST15",
"advertTerm": "Level 1",
"numeric_Height": 0,
"numeric_totalFuelCapacity": 0,
"numeric_Width": 0,
"promotionList": [
{
"name": "Save on Select Sleeper Tractors",
"description": "Save on Select Sleeper Tractors",
"amount": 10000,
"amountDisplayRetail": "10,000",
"amountDisplayWholeSale": "10,000",
"type": "DISCOUNT",
"rule": "viewCount != null and viewCount.equalsIgnoreCase('222ST15') and (year <= 2014 or numeric_mileage >= 700)"
}
],
"imageMaxInstance": 10,
"defaultImageBeanList": null,
"translationsMap": {
"cdlRequired": "Yes",
"countryExt": "United States",
"advertTerm": "Level 1",
"color": "White",
"range_horsepower": "401 and more",
"range_cabType": "Raised Roof",
"model": "Cascadia 12564ST",
"category": "Heavy Duty Tractors",
"type": "Sleeper Tractor"
},
"vehicle_suggestions": {},
"vehicle_locations": {
"lon": "-93.0933",
"lat": "44.9444"
},
"combo_filter": [
{
"filter_name": "range_horsepower",
"filter_value": "401 and more"
},
{
"filter_name": "range_cabType",
"filter_value": "Raised Roof"
},
{
"filter_name": "range_retailCenter",
"filter_value": null
},
{
"filter_name": "advertTerm",
"filter_value": "Level 1"
},
{
"filter_name": "airConditioning",
"filter_value": "Yes"
},
{
"filter_name": "category",
"filter_value": "Heavy Duty Tractors"
},
{
"filter_name": "color",
"filter_value": "White"
},
{
"filter_name": "engineMake",
"filter_value": "Detroit"
},
{
"filter_name": "fuelType",
"filter_value": "DIESEL"
},
{
"filter_name": "make",
"filter_value": "Freightliner"
},
{
"filter_name": "model",
"filter_value": "Cascadia 12564ST"
},
{
"filter_name": "newListing",
"filter_value": "false"
},
{
"filter_name": "numberOfBunks",
"filter_value": "2"
},
{
"filter_name": "numberOfDriveAxles",
"filter_value": "2"
},
{
"filter_name": "state",
"filter_value": "MN"
},
{
"filter_name": "transmissionMake",
"filter_value": "Detroit"
},
{
"filter_name": "transmissionSpeed",
"filter_value": "12"
},
{
"filter_name": "transmissionType",
"filter_value": "Automatic"
},
{
"filter_name": "type",
"filter_value": "Sleeper Tractor"
},
{
"filter_name": "collisionWarning",
"filter_value": "No"
},
{
"filter_name": "canada",
"filter_value": null
},
{
"filter_name": "unitedStates",
"filter_value": "MN"
},
{
"filter_name": "countryExt",
"filter_value": "United States"
},
{
"filter_name": "promotionVehicle",
"filter_value": "true"
},
{
"filter_name": "promotions",
"filter_value": "Current Deals"
},
{
"filter_name": "promotions",
"filter_value": "Save on Select Sleeper Tractors"
}
],
"slider_filter_integer": [
{
"filter_name": "numeric_mileage",
"filter_value": 701830
},
{
"filter_name": "year",
"filter_value": 2015
}
],
"slider_filter_float": [
{
"filter_name": "numeric_retail_price",
"filter_value": 54500
},
{
"filter_name": "numeric_wholesale_price",
"filter_value": 59500
}
],
"basic_filter": {},
"rowNum": 2465,
"displayManagerspecial": null,
"displayPromotions": "true",
"canada": null,
"unitedStates": "MN",
"mgrSpecialRetail": "false",
"mgrSpecialWholesale": "false",
"promotions": []
}
}
]
}
}
curl http://node2:9200/vehicle/_search?q=XYZ
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 7.8380795,
"hits": [
{
"_index": "vehicle_inventory",
"_type": "_doc",
"_id": "109802",
"_score": 7.8380795,
"_source": {
"abs": "Yes",
"addressLine1": "965 ALDRIN DR",
"addressLine2": " ",
"aeroCabExtenders": "Yes",
"aeroRoof": " ",
"aeroSideFairings": "Yes",
"airConditioning": "Yes",
"areaName": " ",
"areaNumber": "0617",
"bodyMake": "NULL",
"bodySerialNumber": "NULL",
"bodyFloorType": "",
"bodyRoofType": "",
"brakeType": "NULL",
"cabStyle": "Conventional",
"category": "TRACTOR",
"chassisBumper": "AERO",
"chassisMakeCode": "FTL",
"cdlRequired": "Yes",
"city": "Eagan",
"color": "White",
"modified_color": "WHITE",
"compared": false,
"saved": false,
"country": "US",
"countryExt": "United States",
"collisionWarning": "No",
"collisionWarningModel": "",
"customerNumber": "RENTAL",
"description": "AVAILABLE JANUARY 2022",
"displayDeliveryCal": "Y",
"districtName": " ",
"driverSeatType": "AIR",
"emailAddress": "E-MAIL.GENERAL.LOCATION#XXXXXX",
"engineBrake": "Yes",
"engineMake": "Detroit",
"engineModel": "DD15AT",
"engineHours": 0,
"faxNumber": "06516860476",
"featuredListing": "Y",
"frontAxleCapacity": "13300",
"frontWheelType": "",
"fuelType": "DIESEL",
"grossVehicleWeight": 80000,
"height": "NULL",
"horsepower": 455,
"image": "/usedtrucks/image/109802/1",
"interiorLevel": "PREMIUM",
"individualPageUrl": "",
"liftGate": "NULL",
"liftGateCapacity": "0",
"liftGateModel": " ",
"loadLength": "NULL",
"make": "Freightliner",
"managersSpecial": "false",
"managerSpecialDiscountRetail": "0",
"managerSpecialDiscountWholeSale": "0",
"mileage": "701,830 miles",
"model": "Cascadia 12564ST",
"newListing": "false",
"numberOfBunks": "2",
"numberOfDriveAxles": "2",
"numberOfTanks": "Dual",
"numericHeight": "",
"numericLoadLength": -1,
"numericWidth": "",
"offLease": "N",
"originalWholeSalePrice": "64,500",
"originalRetailPrice": "64,500",
"phoneNumber": "1-866-309-1962",
"promotionVehicle": "true",
"rearAxleCapacity": "40000",
"rearAxleMake": "Detroit",
"rearDoor": "NULL",
"rearRatio": "2.53",
"rearWheelType": "",
"reeferStandby": "",
"refrigerationHours": "",
"refrigerationMake": "NULL",
"refrigerationModel": "NULL",
"retailPrice": "44,500",
"salePutUpDate": "2021-12-17 00:00:00",
"sideConstruction": "NULL",
"sideDoor": "NULL",
"sleeperSize": "72",
"sleeperType": "Raised Roof",
"slidingFifthWheel": "Yes",
"state": "MN",
"status": "ACTIVE",
"statusComments": " ",
"sale_reason_desc": "AVAILABLE JANUARY 2022",
"saleType": " ",
"size": "",
"suspension": "Air",
"tareWeight": "18795",
"thumbnail": "usedtrucks/image/109802t/1",
"tireSize": "11R22.5",
"tireType": "S/WAY",
"totalFuelCapacity": "220",
"transmissionMake": "Detroit",
"transmissionModel": "12DA1550",
"transmissionSpeed": "12",
"transmissionType": "Automatic",
"type": "Sleeper Tractor",
"unitNumber": "109802",
"use": "RENTAL",
"vin": "3AKJGLD53FSGJ8668",
"wheelBase": "228\"",
"wheelType": "Aluminum",
"wholesalePrice": "59,500",
"width": "NULL",
"year": 2015,
"zip": "55121",
"numeric_mileage": 701830,
"numeric_retail_price": 44500,
"numeric_wholesale_price": 59500,
"dLatitude": 44.944400787353516,
"dLongitude": -93.09329986572266,
"bodyModel": null,
"promotionAmount": "10,000",
"salePrice": 0,
"location": "016510",
"jpegImage": "/usedtrucks/JpgServlet/109802_1.jpg",
"translatedCategory": "Heavy Duty Tractors",
"originalCategory": "Heavy Duty Tractors",
"monFriHours": "M-F 8:00 am to 8:00 pm ET",
"satHours": "Sat 9:00 am to 3:00 pm ET",
"mobileSitePhone": "1-800-485-9671",
"salePutUpDatesort": "2021-12-17",
"stringyear": "2015",
"range_grossVehicleWeight": null,
"range_loadLength": null,
"range_horsepower": "401 and more",
"range_cabType": "Raised Roof",
"range_retailCenter": null,
"viewCount": "222ST15",
"advertTerm": "Level 1",
"numeric_Height": 0,
"numeric_totalFuelCapacity": 0,
"numeric_Width": 0,
"promotionList": [
{
"name": "Save on Select Sleeper Tractors",
"description": "Save on Select Sleeper Tractors",
"amount": 10000,
"amountDisplayRetail": "10,000",
"amountDisplayWholeSale": "10,000",
"type": "DISCOUNT",
"rule": "viewCount != null and viewCount.equalsIgnoreCase('222ST15') and (numeric_mileage < 700 or year > 2014)"
},
{
"name": "Save on Select Sleeper Tractors. Save an additional $5,000 when financing with Premier Financing",
"description": "Save on Select Sleeper Tractors. Save an additional $5,000 when financing with Premier Financing",
"amount": 10000,
"amountDisplayRetail": "10,000",
"amountDisplayWholeSale": "10,000",
"type": "DISCOUNT",
"rule": "viewCount != null and viewCount.equalsIgnoreCase('222ST15') and (numeric_mileage >= 700 or year <= 2014) "
}
],
"imageMaxInstance": 10,
"defaultImageBeanList": null,
"translationsMap": {
"cdlRequired": "Yes",
"countryExt": "United States",
"advertTerm": "Level 1",
"color": "White",
"range_horsepower": "401 and more",
"range_cabType": "Raised Roof",
"model": "Cascadia 12564ST",
"category": "Heavy Duty Tractors",
"type": "Sleeper Tractor"
},
"vehicle_suggestions": {},
"vehicle_locations": {
"lon": "-93.0933",
"lat": "44.9444"
},
"combo_filter": [
{
"filter_name": "range_horsepower",
"filter_value": "401 and more"
},
{
"filter_name": "range_cabType",
"filter_value": "Raised Roof"
},
{
"filter_name": "range_retailCenter",
"filter_value": null
},
{
"filter_name": "advertTerm",
"filter_value": "Level 1"
},
{
"filter_name": "airConditioning",
"filter_value": "Yes"
},
{
"filter_name": "category",
"filter_value": "Heavy Duty Tractors"
},
{
"filter_name": "color",
"filter_value": "White"
},
{
"filter_name": "engineMake",
"filter_value": "Detroit"
},
{
"filter_name": "fuelType",
"filter_value": "DIESEL"
},
{
"filter_name": "make",
"filter_value": "Freightliner"
},
{
"filter_name": "model",
"filter_value": "Cascadia 12564ST"
},
{
"filter_name": "newListing",
"filter_value": "false"
},
{
"filter_name": "numberOfBunks",
"filter_value": "2"
},
{
"filter_name": "numberOfDriveAxles",
"filter_value": "2"
},
{
"filter_name": "state",
"filter_value": "MN"
},
{
"filter_name": "transmissionMake",
"filter_value": "Detroit"
},
{
"filter_name": "transmissionSpeed",
"filter_value": "12"
},
{
"filter_name": "transmissionType",
"filter_value": "Automatic"
},
{
"filter_name": "type",
"filter_value": "Sleeper Tractor"
},
{
"filter_name": "collisionWarning",
"filter_value": "No"
},
{
"filter_name": "canada",
"filter_value": null
},
{
"filter_name": "unitedStates",
"filter_value": "MN"
},
{
"filter_name": "countryExt",
"filter_value": "United States"
},
{
"filter_name": "promotionVehicle",
"filter_value": "true"
},
{
"filter_name": "promotions",
"filter_value": "Current Deals"
},
{
"filter_name": "promotions",
"filter_value": "Save on Select Sleeper Tractors"
},
{
"filter_name": "promotions",
"filter_value": "Save on Select Sleeper Tractors. Save an additional $5,000 when financing with Premier Financing"
}
],
"slider_filter_integer": [
{
"filter_name": "numeric_mileage",
"filter_value": 701830
},
{
"filter_name": "year",
"filter_value": 2015
}
],
"slider_filter_float": [
{
"filter_name": "numeric_retail_price",
"filter_value": 44500
},
{
"filter_name": "numeric_wholesale_price",
"filter_value": 59500
}
],
"basic_filter": {},
"rowNum": 2465,
"displayManagerspecial": null,
"displayPromotions": "true",
"canada": null,
"unitedStates": "MN",
"mgrSpecialRetail": "false",
"mgrSpecialWholesale": "false",
"promotions": []
}
}
]
}
}
Output of GET _cat/shards/vehicle*?v from both the nodes
node1
index shard prirep state docs store ip node
vehicle_inventory 0 p STARTED 120528 9.9mb 3.178.159.250 qa-esearch-n1
vehicle_inventory 0 r UNASSIGNED
node2
index shard prirep state docs store ip node
vehicle_inventory 0 p STARTED 121065 10.1mb 3.178.159.252 qa-esearch-n2
vehicle_inventory 0 r UNASSIGNED
Please observe there is a difference in storage size (9.9mb and 10.1mb). why is the size difference.
Output of GET _cat/nodes?v from both nodes
node1
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
3.178.159.250 54 96 7 2.10 1.53 1.58 cdfhilmrstw * qa-esearch-n1
node2
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
3.178.159.252 30 98 6 0.35 0.21 0.17 cdfhilmrstw * qa-esearch-n2
Related
Elastic search query - all objects of nested array should have specific value
I want to write Elasticsearch query where I am able to look into a nested array, and check a key for all those elements inside the array, if all of them have that value then the root document should be selected. this is a sample data : [ { "_index": "allproperties", "_type": "_doc", "_id": "5241050", "_score": 0.0, "_source": { "id": 5241050, "type": "HOUSE", "state": "NSW", "agency": { "id": 31, "code": "AU_LNT", "name": "Luthor Properties", "config": "{}" }, "branch": { "id": 89, "name": "Luthor Sales Unit Trust", "tradingName": "Luthor Properties", "internalCode": "AU_LNT_G" }, "images": null, "leases": [ { "id": 26439, "bond": 2000, "leased": true, "source": "PORTAL", "status": "SIGNED", "endDate": "2022-11-06T00:00:00", "tenants": [ { "id": 11106, "role": "TENANT", "user": { "id": 38817, "dob": "1900-01-01", "name": "Liam", "email": "tempo#tempo.com", "phone": "+61400000000", "surname": "Tempo", "salutation": "Mr.", "invitations": null, "lastInAppActivity": null }, "address": "45675 Bruce Hwy, Coolbie QLD 4850, Australia", "extendedData": "{\"rentSplitAmount\":22.62}", "roleAdjective": "PRIMARY", "addressComponents": { "state": "QLD", "suburb": "Coolbie", "country": "Australia", "postcode": "4850", "streetName": "Bruce Hwy", "unitNumber": null, "poboxNumber": null, "streetNumber": "45675", "addressComponentsUnavailable": null } } ], "signDate": "2022-10-05T04:58:08.887", "startDate": "2022-10-06T00:00:00", "moveInDate": "2022-10-06T00:00:00", "appointments": [ { "id": 3506, "type": "REMOTE", "date_time": "2022-10-12T04:56:00+00:00", "createdBy": "Lex Luthor", "createdDate": "2022-10-05T04:56:52.936", "lastModifiedBy": "Lex Luthor", "lastModifiedDate": "2022-10-05T04:56:53.51" } ], "createdDate": "2022-10-05T04:55:42.247", "rentalAmount": 500, "dateAvailable": null, "extendedData": { "last_rent_adjustment_date": 1665014400000 }, "leaseDuration": 32, "rentalFrequency": "2", "signedManually": false } ], "refId": "b66326eb-a6b2-42b6-b058-b46847e13399", "source": "PT", "status": null, "suburb": "Hurstville", "address": "456 Forest Road Hurstville NSW AUSTRALIA 2220", "country": "Australia", "bedrooms": 3, "category": null, "pmsCode": "84c34d15-a0ab-4791-b9e3-1bdac215b99c", "postcode": "2220", "agencyId": 31, "bathrooms": 3, "branchId": 89, "carspaces": 3, "createdBy": "system", "streetname": "Forest Road", "unitnumber": null, "description": null, "createdDate": "2022-10-05T04:51:12.619", "entitlements": [ { "id": 3453799, "role": "LANDLORD", "user": { "id": 22855, "dob": null, "name": "please enter ownership name", "email": "mag.m#rr.com.au", "phone": "0400000000", "surname": "", "salutation": null, "lastInAppActivity": null }, "company": { "id": 137, "abn": "", "acn": "", "phone": "0400000000", "address": "1234 Park Avenue New York NY USA 10037-1702", "companyName": "please enter ownership name", "displayName": "please enter ownership name", "email": "mag.m#rr.com.au" }, "roleAdjective": "GROUP" }, { "id": 3453800, "role": "AGENT", "user": { "id": 20054, "dob": null, "name": "Paul", "email": "p.b#mr.com", "phone": "+61403084232", "surname": "Botti", "salutation": null, "lastInAppActivity": null }, "company": null, "roleAdjective": "MANAGING" }, { "id": 3453801, "role": "AGENT", "user": { "id": 20054, "dob": null, "name": "Paul", "email": "p.b#mr.com", "phone": "+61403084232", "surname": "Botti", "salutation": null, "lastInAppActivity": null }, "company": null, "roleAdjective": "LEASING" } ], "streetnumber": "456", "advertised": false, "commission_type": null, "lastModifiedBy": "system", "lastModifiedDate": "2022-10-05T04:58:09.043", "_meta": { "branches": { "id": [ 89 ] }, "agencies": { "id": [ 31 ] }, "user_property_entitlement": { "id": [ 3453799, 3453800, 3453801 ] }, "users": { "id": [ 20054, 22855, 38817 ] }, "companies": { "id": [ 137 ] }, "leases": { "id": [ 26439 ] }, "user_lease_entitlement": { "id": [ 11106 ] }, "appointments": { "id": [ 3506 ] } } }, "sort": [ 1664945472619, 0.0 ] } ] In this particular case, leases is a nested document, I want to select the documents where all the leases are in cancelled state or leases is null, i.e; either all of the objects inside leases should have status as CANCELLED or the leases key should be null. Already went through this question, but did'nt quite get it as its an old answer from 2015 and methods used in this got deprecated.
Try this query: GET idx_test/_search?filter_path=hits.hits { "query": { "bool": { "must_not": [ { "nested": { "path": "leases", "query": { "bool": { "must_not": [ { "bool": { "should": [ { "term": { "leases.status.keyword": "CANCELLED" } }, { "bool": { "must_not": [ { "exists": { "field": "leases" } } ] } } ] } } ] } } } } ] } } }
parse nested hash into RUBY to print output, without taking duplicate values
I have a nested hash and I am able to iterate it and print the section and the field values from the hash. I'm trying to iterate over this nested hash to create a steps guide, I want to create a file with the information and the output file to have the output written like: steps_guide [section]elemento1 [section]elemento2 [section]elemento3 steps_guide [section]elemento2 [section]elemento3 [section]elemento4 .... steps_guide [section]radio [section]xenon [section]aluminio steps_guide [section]xenon [section]aluminio [section]boro If a section name is duplicated in other elementos I only need to print something like: steps_guide expected_[section_duplicated]elemento1 [section]elemento2 [section]elemento3 and not print that section again and print the next element, and this for all the nested hash. Here is the source data. _Data =[ { "name": "script", "elements": [ { "name": "unknown group", "headers": { "map": {} }, "agent": "", "bottom_comments": [], "checks": [ { "title": "", "field": "elemento1", "section": "control_psd", "value": "0", }, { "title": "", "field": "elemento2", "section": "control_psd", "value": "0", }, { "title": "", "field": "elemento3", "section": "control_ptt", "value": "0", }, { "title": "", "field": "elemento4", "section": "control_save", "value": "0", }, { "title": "", "section": "control_relay", "field": "elemento5", "value": "0", }, { "title": "", "section": "control_relay", "field": "elemento6", "value": "1", }, { "title": "", "section": "control_reply", "field": "elemento7", "value": "1", }, { "title": "", "section": "plc_status", "field": "elemento8", "value": "1", }, { "title": "", "section": "plc_status", "field": "elemento9", "value": "1", }, { "title": "", "section": "plc_value", "field": "elemento10", "value": "0", }, { "type": "condiciones", "elementos": [ { "table": [ { "title": "", "section": "regresion", "name": "radio", }, { "title": "", "section": "regresion", "name": "xenon", }, { "title": "", "section": "update", "name": "aluminio", }, { "title": "", "section": "cont", "name": "boro", }, { "title": "", "section": "container", "name": "oro", }, { "title": "", "section": "after", "name": "bromo", }, { "title": "", "section": "after", "name": "oxigeno", } ] } ] } ] } ] } ]
REQL to match string expression
I have the following json: { "release": { "genres": { "genre": "Electronic" }, "identifiers": { "identifier": [ { "description": "Text", "value": "5 709498 101026", "type": "Barcode" }, { "description": "String", "value": 5709498101026, "type": "Barcode" } ] }, "status": "Accepted", "videos": { "video": [ { "title": "Future 3 - Renaldo", "duration": 446, "description": "Future 3 - Renaldo", "src": "http://www.youtube.com/watch?v=hpc9aQpnUjc", "embed": true }, { "title": "Future 3 - Silver M from album We are the Future / 1995 Denmark / Archivos de Kraftwerkmusik", "duration": 461, "description": "Future 3 - Silver M from album We are the Future / 1995 Denmark / Archivos de Kraftwerkmusik", "src": "http://www.youtube.com/watch?v=nlcHRI8iV4g", "embed": true }, { "title": "Future 3 - Bubbles At Dawn", "duration": 710, "description": "Future 3 - Bubbles At Dawn", "src": "http://www.youtube.com/watch?v=ABBCyvGMOFw", "embed": true } ] }, "labels": { "label": { "catno": "APR 010CD", "name": "April Records" } }, "companies": { "company": { "id": 26184, "catno": "", "name": "Voices Of Wonder", "entity_type_name": "Published By", "resource_url": "http://api.discogs.com/labels/26184", "entity_type": 21 } }, "styles": { "style": [ "Abstract", "IDM", "Downtempo" ] }, "formats": { "format": { "text": "", "name": "CD", "qty": 1, "descriptions": { "description": "Album" } } }, "country": "Denmark", "id": 5375, "released": "1995-00-00", "artists": { "artist": { "id": 5139, "anv": "", "name": "Future 3", "role": "", "tracks": "", "join": "" } }, "title": "We Are The Future 3", "master_id": 638422, "tracklist": { "track": [ { "position": 1, "duration": "8:04", "title": "Future 3" }, { "position": 2, "duration": "7:38", "title": "Silver M" }, { "position": 3, "duration": "7:27", "title": "Renaldo" }, { "position": 4, "duration": "6:04", "title": "B.O.Y.D." }, { "position": 5, "duration": "6:12", "title": "Fumble" }, { "position": 6, "duration": "6:12", "title": "Dawn" }, { "position": 7, "duration": "11:54", "title": "Bubbles At Dawn" }, { "position": 8, "duration": "6:03", "title": "D.A.W.N. At 6" }, { "position": 9, "duration": "8:50", "title": 4684351684651 } ] }, "data_quality": "Needs Vote", "extraartists": { "artist": [ { "id": 2647642, "anv": "", "name": "Danesadwork", "role": "Cover", "tracks": "", "join": "" }, { "id": 2647647, "anv": "", "name": "Djon Edvard Petersen", "role": "Photography By", "tracks": "", "join": "" }, { "id": 114164, "anv": "", "name": "Anders Remmer", "role": "Written-By", "tracks": "", "join": "" }, { "id": 435979, "anv": "", "name": "Jesper Skaaning", "role": "Written-By", "tracks": "", "join": "" }, { "id": 15691, "anv": "", "name": "Thomas Knak", "role": "Written-By", "tracks": "", "join": "" } ] }, "notes": "© 1995 April Records APS ℗ 1995 April Records APS" } } I am trying to get those titles which end with 'At Dawn'. I am using the following command r.db("discogs1").table("releases").filter(function(doc){ return doc('release')('title').match('At Dawn$')}) But I get errors as follows: RqlRuntimeError: Expected type STRING but found NUMBER in:r.db("discogs1").table("releases").filter(function(var_24) { return var_24("release")("title").match("At Dawn$"); }) I tried different combinations but I can't seem to get it to work
It seems that some of your documents don't have a row('release')('title') property that is a string. Some of them are numbers, so when you try to call .match on them, they throw an error because .match only works on strings. To see if this is true, try the following: r.db("discogs1").table("releases") .filter(r.row('release')('title').typeOf().ne('STRING')) .count() Ideally, the result of this should be 0, since no document should have a title property that's not a string. If it's higher than 0, that's why you're getting an error. If you want to only get documents where the title is a string, you can do the following: r.db("discogs1").table("releases") .filter(r.row('release')('title').typeOf().eq('STRING')) .filter(function(doc){ return doc('release')('title').match('At Dawn$')}) This query will work, because it will filter our all documents where the title is not a string. If you want to coerce all title into strings, you can do the following: r.db("discogs1").table("releases") .filter(r.row('release')('title').typeOf().ne('STRING')) .merge(function (row) { return { 'title': row('title').coerceTo('string') } }) If you want to delete all documents where the title is not a string, you can do this: r.db("discogs1").table("releases") .filter(r.row('release')('title').typeOf().ne('STRING')) .delete()
Binding Data to Kendo ui Scheduler
I've managed to get the Kendo UI scheduler to work as far as adding resources creating new events and saving new events. However I'm unable to get data from an asp.net web api and display it. Can someone provide an example of how to bind it to the following data: [{"Client":{"ID":1,"Name":"Ford Motor Company","IsActive":true,"DisplayColor":null},"ID":7,"StartDateTime":"2014-04-14T11:00:00","EndDateTime":"2014-04-14T11:30:00","Title":"sdfsdf","Description":"","IsAllDay":false,"Resources":[{"Name":"Eric Longsdorf","ID":1,"IsActive":true,"PhoneNumber":null}],"EquipmentItems":[{"ID":1,"Description":"Truck # 1","IsActive":true,"Status":1}]},{"Client":{"ID":1,"Name":"Ford Motor Company","IsActive":true,"DisplayColor":null},"ID":8,"StartDateTime":"2014-04-14T11:00:00","EndDateTime":"2014-04-14T11:30:00","Title":"Test","Description":"Thee","IsAllDay":false,"Resources":[{"Name":"Eric Longsdorf","ID":1,"IsActive":true,"PhoneNumber":null}],"EquipmentItems":[{"ID":1,"Description":"Truck # 1","IsActive":true,"Status":1}]},{"Client":{"ID":1,"Name":"Ford Motor Company","IsActive":true,"DisplayColor":null},"ID":9,"StartDateTime":"2014-04-14T11:00:00","EndDateTime":"2014-04-14T11:30:00","Title":"yrtyr","Description":"dfg","IsAllDay":false,"Resources":[{"Name":"Eric Longsdorf","ID":1,"IsActive":true,"PhoneNumber":null},{"Name":"Jim Smith","ID":3,"IsActive":true,"PhoneNumber":null}],"EquipmentItems":[{"ID":1,"Description":"Truck # 1","IsActive":true,"Status":1},{"ID":3,"Description":"Vacuum 26","IsActive":true,"Status":1}]},{"Client":{"ID":1,"Name":"Ford Motor Company","IsActive":true,"DisplayColor":null},"ID":10,"StartDateTime":"2014-04-14T11:00:00","EndDateTime":"2014-04-14T11:30:00","Title":"","Description":"","IsAllDay":false,"Resources":[{"Name":"Eric Longsdorf","ID":1,"IsActive":true,"PhoneNumber":null}],"EquipmentItems":[{"ID":1,"Description":"Truck # 1","IsActive":true,"Status":1},{"ID":2,"Description":"Truck # 2","IsActive":true,"Status":3}]},{"Client":{"ID":1,"Name":"Ford Motor Company","IsActive":true,"DisplayColor":null},"ID":11,"StartDateTime":"2014-04-14T11:30:00","EndDateTime":"2014-04-14T12:00:00","Title":"fgdfg","Description":"dfg","IsAllDay":false,"Resources":[{"Name":"Eric Longsdorf","ID":1,"IsActive":true,"PhoneNumber":null}],"EquipmentItems":[{"ID":2,"Description":"Truck # 2","IsActive":true,"Status":3},{"ID":1,"Description":"Truck # 1","IsActive":true,"Status":1}]},{"Client":{"ID":1,"Name":"Ford Motor Company","IsActive":true,"DisplayColor":null},"ID":1008,"StartDateTime":"2014-04-14T11:00:00","EndDateTime":"2014-04-14T11:30:00","Title":"sdfsd","Description":"sdf","IsAllDay":false,"Resources":[{"Name":"Eric Longsdorf","ID":1,"IsActive":true,"PhoneNumber":null}],"EquipmentItems":[{"ID":1,"Description":"Truck # 1","IsActive":true,"Status":1},{"ID":2,"Description":"Truck # 2","IsActive":true,"Status":3}]},{"Client":{"ID":1,"Name":"Ford Motor Company","IsActive":true,"DisplayColor":null},"ID":1009,"StartDateTime":"2014-04-14T11:00:00","EndDateTime":"2014-04-14T11:30:00","Title":"sdfsd","Description":"sdf","IsAllDay":false,"Resources":[{"Name":"Eric Longsdorf","ID":1,"IsActive":true,"PhoneNumber":null}],"EquipmentItems":[{"ID":2,"Description":"Truck # 2","IsActive":true,"Status":3},{"ID":1,"Description":"Truck # 1","IsActive":true,"Status":1}]}]
Please try with the below code snippet. <div id="scheduler"> </div> <script> var test = '[{ "Client": { "ID": 1, "Name": "Ford Motor Company", "IsActive": true, "DisplayColor": null }, "ID": 7, "StartDateTime": "2014-04-15T11:00:00", "EndDateTime": "2014-04-15T11:30:00", "Title": "First Meeting", "Description": "", "IsAllDay": false, "Resources": [{ "Name": "Eric Longsdorf", "ID": 1, "IsActive": true, "PhoneNumber": null}], "EquipmentItems": [{ "ID": 1, "Description": "Truck # 1", "IsActive": true, "Status": 1}] }, { "Client": { "ID": 1, "Name": "Ford Motor Company", "IsActive": true, "DisplayColor": null }, "ID": 8, "StartDateTime": "2014-04-14T11:00:00", "EndDateTime": "2014-04-14T11:30:00", "Title": "Test", "Description": "Thee", "IsAllDay": false, "Resources": [{ "Name": "Eric Longsdorf", "ID": 1, "IsActive": true, "PhoneNumber": null}], "EquipmentItems": [{ "ID": 1, "Description": "Truck # 1", "IsActive": true, "Status": 1}] }, { "Client": { "ID": 1, "Name": "Ford Motor Company", "IsActive": true, "DisplayColor": null }, "ID": 9, "StartDateTime": "2014-04-14T11:00:00", "EndDateTime": "2014-04-14T11:30:00", "Title": "yrtyr", "Description": "dfg", "IsAllDay": false, "Resources": [{ "Name": "Eric Longsdorf", "ID": 1, "IsActive": true, "PhoneNumber": null }, { "Name": "Jim Smith", "ID": 3, "IsActive": true, "PhoneNumber": null}], "EquipmentItems": [{ "ID": 1, "Description": "Truck # 1", "IsActive": true, "Status": 1 }, { "ID": 3, "Description": "Vacuum 26", "IsActive": true, "Status": 1}] }, { "Client": { "ID": 1, "Name": "Ford Motor Company", "IsActive": true, "DisplayColor": null }, "ID": 10, "StartDateTime": "2014-04-14T11:00:00", "EndDateTime": "2014-04-14T11:30:00", "Title": "", "Description": "", "IsAllDay": false, "Resources": [{ "Name": "Eric Longsdorf", "ID": 1, "IsActive": true, "PhoneNumber": null}], "EquipmentItems": [{ "ID": 1, "Description": "Truck # 1", "IsActive": true, "Status": 1 }, { "ID": 2, "Description": "Truck # 2", "IsActive": true, "Status": 3}] }, { "Client": { "ID": 1, "Name": "Ford Motor Company", "IsActive": true, "DisplayColor": null }, "ID": 11, "StartDateTime": "2014-04-14T11:30:00", "EndDateTime": "2014-04-14T12:00:00", "Title": "fgdfg", "Description": "dfg", "IsAllDay": false, "Resources": [{ "Name": "Eric Longsdorf", "ID": 1, "IsActive": true, "PhoneNumber": null}], "EquipmentItems": [{ "ID": 2, "Description": "Truck # 2", "IsActive": true, "Status": 3 }, { "ID": 1, "Description": "Truck # 1", "IsActive": true, "Status": 1}] }, { "Client": { "ID": 1, "Name": "Ford Motor Company", "IsActive": true, "DisplayColor": null }, "ID": 1008, "StartDateTime": "2014-04-14T11:00:00", "EndDateTime": "2014-04-14T11:30:00", "Title": "sdfsd", "Description": "sdf", "IsAllDay": false, "Resources": [{ "Name": "Eric Longsdorf", "ID": 1, "IsActive": true, "PhoneNumber": null}], "EquipmentItems": [{ "ID": 1, "Description": "Truck # 1", "IsActive": true, "Status": 1 }, { "ID": 2, "Description": "Truck # 2", "IsActive": true, "Status": 3}] }, { "Client": { "ID": 1, "Name": "Ford Motor Company", "IsActive": true, "DisplayColor": null }, "ID": 1009, "StartDateTime": "2014-04-14T11:00:00", "EndDateTime": "2014-04-14T11:30:00", "Title": "sdfsd", "Description": "sdf", "IsAllDay": false, "Resources": [{ "Name": "Eric Longsdorf", "ID": 1, "IsActive": true, "PhoneNumber": null}], "EquipmentItems": [{ "ID": 2, "Description": "Truck # 2", "IsActive": true, "Status": 3 }, { "ID": 1, "Description": "Truck # 1", "IsActive": true, "Status": 1}]}]'; $(function () { $("#scheduler").kendoScheduler({ height: 600, views: [ "day", { type: "workWeek", selected: true }, "week", "month", "agenda" ], timezone: "Etc/UTC", dataSource: { data: eval(test), schema: { model: { id: "ID", fields: { taskId: { from: "ID", type: "number" }, title: { from: "Title" }, start: { type: "date", from: "StartDateTime" }, end: { type: "date", from: "EndDateTime" }, //startTimezone: { from: "StartTimezone" }, //endTimezone: { from: "EndTimezone" }, description: { from: "Description" }, //recurrenceId: { from: "RecurrenceID" }, //recurrenceRule: { from: "RecurrenceRule" }, //recurrenceException: { from: "RecurrenceException" }, //ownerId: { from: "OwnerID", defaultValue: 1 }, isAllDay: { type: "boolean", from: "IsAllDay" } } } } } }); }); </script> Demo Let me know if any concern.
I can't seem to get faceted search working in elastic search
I can't seem to understand the QueryDSL for facets in elastic search. Below are my query object, and the mapping for my tags array. I'm trying to get these to put in a faceted navigation based on tags. Each "element" will have multiple tags associated in the tags array [Not all elements will have tags. Some will have an empty array.]. Each tag is an object with id and tag properties. I've tried the nested facet approach and get the error that "tags is not nested", so then I try this below. I don't receive an error, but there is no facets object in the return JSON. I've been using this page for help: http://www.elasticsearch.org/guide/reference/api/search/facets/index.html. Can anyone help me to format this correctly and understand the organization of these? I appreciate any help! // this is my query object { "sort":{ "created_at":{ "order":"desc" } }, "query":{ "constant_score":{ "filter":{ "and":[ { "missing":{ "field":"parent_id" } }, { "missing":{ "field":"wall_id" } }, { "term":{ "active":true } } ] } } }, "facets":{ "tags":{ "terms":{ "field":"tags.tag" } } } } // this is the mapping for the tags array "tags":{ "type":"nested", "include_in_parent":true, "properties":{ "id":{ "type":"integer" }, "tag":{ "type":"string" } } },
I've tried hard to replicate this (using 0.18.5) but without any luck. Some details below. The first example tries to replicate what you describe. The second doesn't map tags as include_in_parent and uses the "nested" field in the facet request. As you can see, in both cases the facet is returned. This leads me to believe that there is either something wrong with the rest of the mappings or some document (not the sample one you provided) that is causing issues. When you tried the nested approach, perhaps you used "nested":"tags.tag" instead of "nested":"tags"? (Un)Successful attempt #1: Create index with mappings: $ curl -XPOST 'http://localhost:9200/testindex/' -d '{ "mappings": { "element": { "properties": { "tags": { "type": "nested", "include_in_parent": true, "properties": { "id": { "type": "integer" }, "tag": { "type": "string" } } } } } } }' Index document: $ curl -XPOST 'http://localhost:9200/testindex/element' -d '{ "element_id": 4682, "parent_id": null, "wall_id": null, "username": "John Doe", "avatar": "56f1bb0a96d02b90e5915ff38ea189ec.jpg", "title": "Easy Chart is a great easy comparison chart maker for math and...", "description": "<p>Easy Chart is a great easy comparison chart maker for math and science skills. It even allows you to pick the appropriate chart type.</p>", "groups": [ { "id": 6, "name": "Fourth Grade (All Subjects)", "name_short": "4th Grade" }, { "id": 17, "name": "Eighth Grade Science", "name_short": "8th Science" }, { "id": 13, "name": "Seventh Grade Science", "name_short": "7th Science" }, { "id": 9, "name": "Sixth Grade Science", "name_short": "6th Science" } ], "tags": [ { "id": 33, "tag": "iPad" }, { "id": 32, "tag": "iPod" } ], "webpages": [], "videos": [], "documents": [], "photos": [], "reports": [], "bookmarks": [], "likes": [], "dislikes": [], "element_type": "Post", "active": true, "deleted": false, "updated_at": "2011-11-27T21:37:38-0600", "created_at": 1322451458000, "created_at_formatted": "2 weeks ago" }' Search: $ curl -XPOST 'http://localhost:9200/testindex/element/_search' -d '{ "sort":{ "created_at":{ "order":"desc" } }, "query":{ "constant_score":{ "filter":{ "and":[ { "missing":{ "field":"parent_id" } }, { "missing":{ "field":"wall_id" } }, { "term":{ "active":true } } ] } } }, "facets":{ "tags":{ "terms":{ "field":"tags.tag" } } } }' Result: { "took": 4, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 1, "max_score": null, "hits": [ { "_index": "testindex", "_type": "element", "_id": "RZK41LngTKOhMUS6DXRi7w", "_score": null, "_source": { "element_id": 4682, "parent_id": null, "wall_id": null, "username": "John Doe", "avatar": "56f1bb0a96d02b90e5915ff38ea189ec.jpg", "title": "Easy Chart is a great easy comparison chart maker for math and...", "description": "<p>Easy Chart is a great easy comparison chart maker for math and science skills. It even allows you to pick the appropriate chart type.</p>", "groups": [ { "id": 6, "name": "Fourth Grade (All Subjects)", "name_short": "4th Grade" }, { "id": 17, "name": "Eighth Grade Science", "name_short": "8th Science" }, { "id": 13, "name": "Seventh Grade Science", "name_short": "7th Science" }, { "id": 9, "name": "Sixth Grade Science", "name_short": "6th Science" } ], "tags": [ { "id": 33, "tag": "iPad" }, { "id": 32, "tag": "iPod" } ], "webpages": [], "videos": [], "documents": [], "photos": [], "reports": [], "bookmarks": [], "likes": [], "dislikes": [], "element_type": "Post", "active": true, "deleted": false, "updated_at": "2011-11-27T21:37:38-0600", "created_at": 1322451458000, "created_at_formatted": "2 weeks ago" }, "sort": [ 1322451458000 ] } ] }, "facets": { "tags": { "_type": "terms", "missing": 0, "total": 2, "other": 0, "terms": [ { "term": "ipod", "count": 1 }, { "term": "ipad", "count": 1 } ] } } } (Un)Successful attempt #2: Create index with mappings: $ curl -XPOST 'http://localhost:9200/testindex2/' -d '{ "mappings": { "element": { "properties": { "tags": { "type": "nested", "include_in_parent": false, "properties": { "id": { "type": "integer" }, "tag": { "type": "string" } } } } } } }' Index document: $ curl -XPOST 'http://localhost:9200/testindex2/element' -d '{ "element_id": 4682, "parent_id": null, "wall_id": null, "username": "John Doe", "avatar": "56f1bb0a96d02b90e5915ff38ea189ec.jpg", "title": "Easy Chart is a great easy comparison chart maker for math and...", "description": "<p>Easy Chart is a great easy comparison chart maker for math and science skills. It even allows you to pick the appropriate chart type.</p>", "groups": [ { "id": 6, "name": "Fourth Grade (All Subjects)", "name_short": "4th Grade" }, { "id": 17, "name": "Eighth Grade Science", "name_short": "8th Science" }, { "id": 13, "name": "Seventh Grade Science", "name_short": "7th Science" }, { "id": 9, "name": "Sixth Grade Science", "name_short": "6th Science" } ], "tags": [ { "id": 33, "tag": "iPad" }, { "id": 32, "tag": "iPod" } ], "webpages": [], "videos": [], "documents": [], "photos": [], "reports": [], "bookmarks": [], "likes": [], "dislikes": [], "element_type": "Post", "active": true, "deleted": false, "updated_at": "2011-11-27T21:37:38-0600", "created_at": 1322451458000, "created_at_formatted": "2 weeks ago" }' Search: $ curl -XPOST 'http://localhost:9200/testindex2/element/_search' -d '{ "sort":{ "created_at":{ "order":"desc" } }, "query":{ "constant_score":{ "filter":{ "and":[ { "missing":{ "field":"parent_id" } }, { "missing":{ "field":"wall_id" } }, { "term":{ "active":true } } ] } } }, "facets":{ "tags":{ "terms":{ "field":"tags.tag" }, "nested":"tags" } } }' Result: { "took": 17, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 1, "max_score": null, "hits": [ { "_index": "testindex2", "_type": "element", "_id": "_F1TTGJETOipo8kVR7ZXkQ", "_score": null, "_source": { "element_id": 4682, "parent_id": null, "wall_id": null, "username": "John Doe", "avatar": "56f1bb0a96d02b90e5915ff38ea189ec.jpg", "title": "Easy Chart is a great easy comparison chart maker for math and...", "description": "<p>Easy Chart is a great easy comparison chart maker for math and science skills. It even allows you to pick the appropriate chart type.</p>", "groups": [ { "id": 6, "name": "Fourth Grade (All Subjects)", "name_short": "4th Grade" }, { "id": 17, "name": "Eighth Grade Science", "name_short": "8th Science" }, { "id": 13, "name": "Seventh Grade Science", "name_short": "7th Science" }, { "id": 9, "name": "Sixth Grade Science", "name_short": "6th Science" } ], "tags": [ { "id": 33, "tag": "iPad" }, { "id": 32, "tag": "iPod" } ], "webpages": [], "videos": [], "documents": [], "photos": [], "reports": [], "bookmarks": [], "likes": [], "dislikes": [], "element_type": "Post", "active": true, "deleted": false, "updated_at": "2011-11-27T21:37:38-0600", "created_at": 1322451458000, "created_at_formatted": "2 weeks ago" }, "sort": [ 1322451458000 ] } ] }, "facets": { "tags": { "_type": "terms", "missing": 0, "total": 2, "other": 0, "terms": [ { "term": "ipod", "count": 1 }, { "term": "ipad", "count": 1 } ] } } }