Skip to content

Instantly share code, notes, and snippets.

@gtsai
Created May 26, 2023 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtsai/b773d0e547d3f07cc9e6f2cea08810dc to your computer and use it in GitHub Desktop.
Save gtsai/b773d0e547d3f07cc9e6f2cea08810dc to your computer and use it in GitHub Desktop.
A Primer on Elasticsearch Query String Search
{
"dynamic": "false",
"properties": {
"dealerData": {
"properties": {
"dealershipName": {
"type": "keyword"
},
"postalCode": {
"type": "keyword"
},
"state": {
"type": "keyword"
},
"tcDealershipId": {
"type": "integer"
}
}
},
"pricing": {
"properties": {
"totalMsrp": {
"type": "long"
}
}
},
"vehicle": {
"properties": {
"createdDate": {
"type": "date",
"format": "epoch_millis"
},
"daysInInventory": {
"type": "integer"
},
"imageCount": {
"type": "integer"
},
"imageUrls": {
"properties": {
"images": {
"properties": {
"hash": {
"type": "keyword"
},
"height": {
"type": "integer"
},
"width": {
"type": "integer"
}
}
}
}
},
"newOrUsed": {
"type": "keyword"
},
"odometer": {
"type": "integer"
},
"truecarPlusEligible": {
"type": "boolean"
},
"listPrice": {
"type": "long"
},
"vin": {
"type": "keyword",
"fields": {
"analyzed": {
"type": "text"
}
}
},
"make": {
"type": "text",
"fields": {
"raw": {
"type": "keyword"
}
}
},
"makeId": {
"type": "integer"
},
"model": {
"type": "text",
"fields": {
"raw": {
"type": "keyword"
}
}
},
"modelId": {
"type": "integer"
},
"modelYear": {
"type": "integer"
},
"styleId": {
"type": "integer"
},
"vehicleStyle": {
"type": "text",
"fields": {
"raw": {
"type": "keyword"
}
}
}
}
}
}
}
{ "index" : { "_index" : "sample_listings_index", "_id" : "3VV2B7AX5JM085555" } }
{ "vehicle": { "styleId": 60285, "makeId": 35, "modelId": 7456, "make": "Kia", "model": "Rio", "modelYear": 2018, "vehicleStyle": "S Sedan Automatic", "vin": "3VV2B7AX5JM085555", "imageCount": 4, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 }, { "hash": "listings/image3", "width": 1600, "height": 900 }, { "hash": "listings/image4", "cropAvailable": false, "width": 1600, "height": 900 } ] }, "odometer": 22345, "createdDate": 1676446980000, "newOrUsed": "u", "days Inventory": 1, "truecarPlusEligible": false, "listPrice": 1799800 }, "dealerData": { "tcDealershipId": 46897, "state": "CA", "postalCode": "94538", "dealershipName": "BestCars Fremont" }, "pricing": { "totalMsrp": null } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "1N4AZ1CP6KC304912" } }
{ "vehicle": { "styleId": 63784, "makeId": 43, "modelId": 8257, "make": "Nissan", "model": "LEAF", "modelYear": 2019, "vehicleStyle": "SV", "vin": "1N4AZ1CP6KC304912", "imageCount": 4, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 }, { "hash": "listings/image3", "width": 1600, "height": 900 }, { "hash": "listings/image4", "cropAvailable": false, "width": 1600, "height": 900 } ] }, "odometer": 35949, "createdDate": 1675903380000, "newOrUsed": "u", "daysInInventory": 7, "truecarPlusEligible": false, "listPrice": 2099800 }, "dealerData": { "tcDealershipId": 88100, "state": "CA", "postalCode": "94538", "dealershipName": "NiceCars Fremont" }, "pricing": { "totalMsrp": null } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "3VVPB7AX5PM056768" } }
{ "vehicle": { "styleId": 93793, "makeId": 18, "modelId": 11084, "make": "Volkswagen", "model": "Tiguan", "modelYear": 2023, "vehicleStyle": "SE FWD", "vin": "3VVPB7AX5PM056768", "imageCount": 4, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 }, { "hash": "listings/image3", "width": 1600, "height": 900 }, { "hash": "listings/image4", "cropAvailable": false, "width": 1600, "height": 900 } ] }, "odometer": 3, "createdDate": 1675818540000, "newOrUsed": "n", "daysInInventory": 12, "truecarPlusEligible": true, "listPrice": 3405100 }, "dealerData": { "tcDealershipId": 14442, "state": "FL", "postalCode": "33912", "dealershipName": "Volkswagen of Future" }, "pricing": { "totalMsrp": 3405100 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "2C3RDXHG6PH522978" } }
{ "vehicle": { "styleId": 94707, "makeId": 42, "modelId": 429554, "make": "Dodge", "model": "Charger", "modelYear": 2023, "vehicleStyle": "GT RWD", "vin": "2C3RDXHG6PH522978", "imageCount": 0, "imageUrls": null, "odometer": 5, "createdDate": 1674758580000, "newOrUsed": "n", "daysInInventory": 22, "truecarPlusEligible": false, "listPrice": 4354500 }, "dealerData": { "tcDealershipId": 102140, "state": "CA", "postalCode": "91801", "dealershipName": "Excellent Cars" }, "pricing": { "totalMsrp": 4354500 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "1FGTW1CF5HKE12749" } }
{ "vehicle": { "styleId": 56236, "makeId": 21, "modelId": 2856, "make": "Ford", "model": "F-150", "modelYear": 2017, "vehicleStyle": "XLT SuperCrew 5.5' Box RWD", "vin": "1FGTW1CF5HKE12749", "imageCount": 2, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 } ] }, "odometer": 68204, "createdDate": 1675903380000, "newOrUsed": "u", "daysInInventory": 7, "truecarPlusEligible": false, "listPrice": 3099800 }, "dealerData": { "tcDealershipId": 285139, "state": "TX", "postalCode": "76543", "dealershipName": "Cars at Killeen" }, "pricing": { "totalMsrp": null } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "1FTFW1ED1PFA69090" } }
{ "vehicle": { "styleId": 93924, "makeId": 21, "modelId": 11092, "make": "Ford", "model": "F-150", "modelYear": 2023, "vehicleStyle": "Limited SuperCrew 5.5' Box 4WD", "vin": "1FTFW1ED1PFA69090", "imageCount": 2, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 } ] }, "odometer": 0, "createdDate": 1674585780000, "newOrUsed": "n", "daysInInventory": 23, "truecarPlusEligible": true, "listPrice": 8595000 }, "dealerData": { "tcDealershipId": 18363, "state": "IL", "postalCode": "60188", "dealershipName": "BestCars Ford" }, "pricing": { "totalMsrp": 8595000 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "WBAKN9C56FD265550" } }
{ "vehicle": { "styleId": 49302, "makeId": 37, "modelId": 2453, "make": "BMW", "model": "5 Series", "modelYear": 2015, "vehicleStyle": "550i Sedan RWD", "vin": "WBAKN9C56FD265550", "imageCount": 0, "imageUrls": null, "odometer": 89320, "createdDate": 1674067380000, "newOrUsed": "u", "daysInInventory": 28, "truecarPlusEligible": false, "listPrice": 2199900 }, "dealerData": { "tcDealershipId": 95792, "state": "GA", "postalCode": "30060", "dealershipName": "Auto Family Cars" }, "pricing": { "totalMsrp": null } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "1N4AL2SD5CN478507" } }
{ "vehicle": { "styleId": 36646, "makeId": 43, "modelId": 6244, "make": "Nissan", "model": "Altima", "modelYear": 2012, "vehicleStyle": "2.5 S Sedan CVT", "vin": "1N4AL2SD5CN478507", "imageCount": 0, "imageUrls": null, "odometer": 86865, "createdDate": 1672949520000, "newOrUsed": "u", "daysInInventory": 43, "truecarPlusEligible": false, "listPrice": 1099900 }, "dealerData": { "tcDealershipId": 122789, "state": "WA", "postalCode": "98034", "dealershipName": "BestCars of Kirkland" }, "pricing": { "totalMsrp": null } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "5THXRLEC7PS13A654" } }
{ "vehicle": { "styleId": 94175, "makeId": 53, "modelId": 11118, "make": "Toyota", "model": "Sienna", "modelYear": 2023, "vehicleStyle": "XSE 7-Passenger FWD", "vin": "5THXRLEC7PS13A654", "imageCount": 0, "imageUrls": null, "odometer": 10, "createdDate": 1676551380000, "newOrUsed": "n", "days Inventory": 1, "truecarPlusEligible": false, "listPrice": 4587900 }, "dealerData": { "tcDealershipId": 1044, "state": "FL", "postalCode": "33331", "dealershipName": "Toyota of Carsville" }, "pricing": { "totalMsrp": 4587900 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "5YJXCBE48LF265578" } }
{ "vehicle": { "styleId": 68296, "makeId": 57, "modelId": 8855, "make": "Tesla", "model": "Model X", "modelYear": 2020, "vehicleStyle": "Performance", "vin": "5YJXCBE48LF265578", "imageCount": 3, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 }, { "hash": "listings/image3", "width": 1600, "height": 900 } ] }, "odometer": 29599, "createdDate": 1665103440000, "newOrUsed": "u", "daysInInventory": 132, "truecarPlusEligible": true, "listPrice": 8400000 }, "dealerData": { "tcDealershipId": 112323, "state": "GA", "postalCode": "30062", "dealershipName": "DreamCar of Marietta" }, "pricing": { "totalMsrp": 8500000 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "5UXCY8C00M9F58779" } }
{ "vehicle": { "styleId": 69131, "makeId": 37, "modelId": 9060, "make": "BMW", "model": "X6", "modelYear": 2021, "vehicleStyle": "M50i AWD", "vin": "5UXCY8C00M9F58779", "imageCount": 2, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 } ] }, "odometer": 29986, "createdDate": 1675168980000, "newOrUsed": "u", "daysInInventory": 48, "truecarPlusEligible": false, "listPrice": 7899800 }, "dealerData": { "tcDealershipId": 10072, "state": "CA", "postalCode": "93405", "dealershipName": "Dreamcar BMW" }, "pricing": { "totalMsrp": 9499800 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "WBA2J7C51JVB18589" } }
{ "vehicle": { "styleId": 59301, "makeId": 37, "modelId": 7347, "make": "BMW", "model": "2 Series", "modelYear": 2018, "vehicleStyle": "M240i xDrive Coupe", "vin": "WBA2J7C51JVB18589", "imageCount": 4, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 }, { "hash": "listings/image3", "width": 1600, "height": 900 }, { "hash": "listings/image4", "width": 1600, "height": 900 } ] }, "odometer": 35351, "createdDate": 1675928580000, "newOrUsed": "u", "daysInInventory": 19, "truecarPlusEligible": true, "listPrice": 3799900 }, "dealerData": { "tcDealershipId": 119540, "state": "IN", "postalCode": "47401", "dealershipName": "Cars of the Future" }, "pricing": { "totalMsrp": 3799900 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "WBY1Z4J52GV506708" } }
{ "vehicle": { "styleId": 53462, "makeId": 37, "modelId": 3132, "make": "BMW", "model": "i3", "modelYear": 2016, "vehicleStyle": "60 Ah with Range Extender", "vin": "WBY1Z4J52GV506708", "imageCount": 4, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 }, { "hash": "listings/image3", "width": 1600, "height": 900 }, { "hash": "listings/image4", "width": 1600, "height": 900 } ] }, "odometer": 33754, "createdDate": 1675384980000, "newOrUsed": "u", "daysInInventory": 29, "truecarPlusEligible": true, "listPrice": 2299000 }, "dealerData": { "tcDealershipId": 13415, "state": "OR", "postalCode": "97070", "dealershipName": "Charlie Brown Cars" }, "pricing": { "totalMsrp": 2299000 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "1C4PJMMN6ND125811" } }
{ "vehicle": { "styleId": 91910, "makeId": 34, "modelId": 10788, "make": "Jeep", "model": "Cherokee", "modelYear": 2022, "vehicleStyle": "Latitude Lux 4WD", "vin": "1C4PJMMN6ND125811", "imageCount": 4, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 }, { "hash": "listings/image3", "width": 1600, "height": 900 }, { "hash": "listings/image4", "width": 1600, "height": 900 } ] }, "odometer": 10, "createdDate": 1669228860000, "newOrUsed": "n", "daysInInventory": 92, "truecarPlusEligible": true, "listPrice": 3700000 }, "dealerData": { "tcDealershipId": 12924, "state": "FL", "postalCode": "33033", "dealershipName": "Chrysler BestCars" }, "pricing": { "totalMsrp": 4187000 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "3TYCZ5AN9PT120248" } }
{ "vehicle": { "styleId": 94458, "makeId": 53, "modelId": 11149, "make": "Toyota", "model": "Tacoma", "modelYear": 2023, "vehicleStyle": "TRD Sport Double Cab 5' Bed V6 4WD Automatic", "vin": "3TYCZ5AN9PT120248", "imageCount": 4, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 }, { "hash": "listings/image3", "width": 1600, "height": 900 }, { "hash": "listings/image4", "width": 1600, "height": 900 } ] }, "odometer": 7, "createdDate": 1676508180000, "newOrUsed": "n", "daysInInventory": 2, "truecarPlusEligible": false, "listPrice": 4588900 }, "dealerData": { "tcDealershipId": 1173, "state": "FL", "postalCode": "33169", "dealershipName": "Toyota of Florida" }, "pricing": { "totalMsrp": 4588900 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "2C3CDZFJ0LH143021" } }
{ "vehicle": { "styleId": 68124, "makeId": 42, "modelId": 8823, "make": "Dodge", "model": "Challenger", "modelYear": 2020, "vehicleStyle": "R/T Scat Pack Widebody RWD", "vin": "2C3CDZFJ0LH143021", "imageCount": 4, "imageUrls": null, "odometer": 23715, "createdDate": 1673203320000, "newOrUsed": "u", "daysInInventory": 40, "truecarPlusEligible": true, "listPrice": 4699500 }, "dealerData": { "tcDealershipId": 116479, "state": "CA", "postalCode": "93105", "dealershipName": "Dodge BestCars" }, "pricing": { "totalMsrp": 5143200 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "1FTFW1RG7PFA30008" } }
{ "vehicle": { "styleId": 93936, "makeId": 21, "modelId": 11092, "make": "Ford", "model": "F-150", "modelYear": 2023, "vehicleStyle": "Raptor SuperCrew 5.5' Box 4WD", "vin": "1FTFW1RG7PFA30008", "imageCount": 4, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 }, { "hash": "listings/image3", "width": 1600, "height": 900 }, { "hash": "listings/image4", "width": 1600, "height": 900 } ] }, "odometer": null, "createdDate": 1675190580000, "newOrUsed": "n", "daysInInventory": 17, "truecarPlusEligible": false, "listPrice": 8738500 }, "dealerData": { "tcDealershipId": 15556, "state": "VA", "postalCode": "22408", "dealershipName": "Ford BestCars" }, "pricing": { "totalMsrp": 8738500 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "3C63R3EL1NG203343" } }
{ "vehicle": { "styleId": 73530, "makeId": 20, "modelId": 9525, "make": "Ram", "model": "3500", "modelYear": 2022, "vehicleStyle": "Laramie Crew Cab 6'4\" Box 4WD", "vin": "3C63R3EL1NG203343", "imageCount": 4, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 }, { "hash": "listings/image3", "width": 1600, "height": 900 }, { "hash": "listings/image4", "width": 1600, "height": 900 } ] }, "odometer": 16, "createdDate": 1661560980000, "newOrUsed": "n", "daysInInventory": 178, "truecarPlusEligible": true, "listPrice": 8100000 }, "dealerData": { "tcDealershipId": 12924, "state": "FL", "postalCode": "33033", "dealershipName": "Cars of the Future" }, "pricing": { "totalMsrp": 8556500 } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "3VWC57BU9MM050987" } }
{ "vehicle": { "styleId": 70268, "makeId": 18, "modelId": 9181, "make": "Volkswagen", "model": "Jetta", "modelYear": 2021, "vehicleStyle": "S Automatic", "vin": "3VWC57BU9MM050987", "imageCount": 4, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 }, { "hash": "listings/image3", "width": 1600, "height": 900 }, { "hash": "listings/image4", "width": 1600, "height": 900 } ] }, "odometer": 37107, "createdDate": 1674499380000, "newOrUsed": "u", "daysInInventory": 34, "truecarPlusEligible": true, "listPrice": 1999800 }, "dealerData": { "tcDealershipId": 14440, "state": "FL", "postalCode": "33912", "dealershipName": "Volkswagen of the Future" }, "pricing": { "totalMsrp": null } }
{ "index" : { "_index" : "sample_listings_index", "_id" : "JF2SJAEC5JH433355" } }
{ "vehicle": { "styleId": 58391, "makeId": 60, "modelId": 170, "make": "Subaru", "model": "Forester", "modelYear": 2018, "vehicleStyle": "2.5i Premium CVT", "vin": "JF2SJAEC5JH433355", "imageCount": 4, "imageUrls": { "images": [ { "hash": "listings/image1", "width": 1600, "height": 900 }, { "hash": "listings/image2", "width": 1600, "height": 900 }, { "hash": "listings/image3", "width": 1600, "height": 900 }, { "hash": "listings/image4", "width": 1600, "height": 900 } ] }, "odometer": 29739, "createdDate": 1666312800000, "newOrUsed": "u", "daysInInventory": 119, "truecarPlusEligible": false, "listPrice": 2397500 }, "dealerData": { "tcDealershipId": 117379, "state": "IL", "postalCode": "60448", "dealershipName": "Chicago Cars" }, "pricing": { "totalMsrp": null } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment