Skip to content

Instantly share code, notes, and snippets.

@dezmathio
Last active September 28, 2017 22:18
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 dezmathio/40c397c40c5f7ee864126acc1416e828 to your computer and use it in GitHub Desktop.
Save dezmathio/40c397c40c5f7ee864126acc1416e828 to your computer and use it in GitHub Desktop.
{
"vendors-test": {
"mappings": {
"vendor": {
"dynamic": "false",
"_all": {
"enabled": false
},
"properties": {
"active_flag": {
"type": "boolean"
},
"availability": {
"type": "nested",
"properties": {
"availability_status_type": {
"type": "integer"
},
"day_rules": {
"type": "nested",
"properties": {
"day_code": {
"type": "integer"
},
"open": {
"type": "boolean"
}
}
},
"es_available_closed_dates": {
"type": "date",
"format": "MM/dd/yyyy"
},
"es_dates_unavailable": {
"type": "date",
"format": "MM/dd/yyyy"
},
"setup_complete": {
"type": "boolean"
}
}
},
"availability_category": {
"type": "boolean"
},
"band_genre": {
"type": "keyword"
},
"band_pricing_popular_price": {
"type": "integer"
},
"beauty_fitness_health": {
"type": "keyword"
},
"beauty_hair": {
"type": "keyword"
},
"beauty_makeup": {
"type": "keyword"
},
"beauty_service": {
"type": "keyword"
},
"cake_dietary": {
"type": "keyword"
},
"cake_food": {
"type": "keyword"
},
"catering_bar": {
"type": "keyword"
},
"catering_cuisine": {
"type": "keyword"
},
"catering_dietary": {
"type": "keyword"
},
"catering_service": {
"type": "keyword"
},
"ceremonymusic_instrument": {
"type": "keyword"
},
"ceremonymusic_pricing_popular_price": {
"type": "integer"
},
"ceremonymusic_type": {
"type": "keyword"
},
"confirm_flag": {
"type": "boolean"
},
"dj_equipment": {
"type": "keyword"
},
"dj_genre": {
"type": "keyword"
},
"dj_pricing_popular_price": {
"type": "integer"
},
"dj_services": {
"type": "keyword"
},
"dress_service": {
"type": "keyword"
},
"favor_product": {
"type": "keyword"
},
"favor_service": {
"type": "keyword"
},
"florist_arrangement": {
"type": "keyword"
},
"florist_pricing_services": {
"type": "integer"
},
"florist_service": {
"type": "keyword"
},
"image_file_name_exists": {
"type": "boolean"
},
"invitation_product": {
"type": "keyword"
},
"invitation_service": {
"type": "keyword"
},
"jewelry_type": {
"type": "keyword"
},
"location_cities": {
"type": "nested",
"properties": {
"city_and_state": {
"type": "keyword"
},
"city_raw_and_state": {
"type": "keyword"
},
"region_code": {
"type": "keyword"
}
}
},
"location_sub_regions": {
"type": "keyword"
},
"max_rating_datetime": {
"type": "date"
},
"name": {
"type": "text",
"fields": {
"ngram": {
"type": "text",
"analyzer": "name_ngram_analyzer"
},
"no_dot": {
"type": "text",
"analyzer": "standard_no_dot"
},
"raw": {
"type": "text",
"analyzer": "strip",
"fielddata": true
}
},
"analyzer": "english"
},
"national": {
"type": "boolean"
},
"officiant_language": {
"type": "keyword"
},
"officiant_type": {
"type": "keyword"
},
"officiant_typical_price": {
"type": "integer"
},
"officiant_wedding_services": {
"type": "keyword"
},
"other_specialty": {
"type": "keyword"
},
"photography_items": {
"type": "keyword"
},
"photography_pricing_popular_price": {
"type": "integer"
},
"photography_services": {
"type": "keyword"
},
"photography_style": {
"type": "keyword"
},
"planner_pricing_partial": {
"type": "integer"
},
"planner_service": {
"type": "keyword"
},
"rehearsal_dinner_max_capacity_count": {
"type": "integer"
},
"rehearsal_dinner_type": {
"type": "keyword"
},
"rental_service": {
"type": "keyword"
},
"transportation_special": {
"type": "keyword"
},
"transportation_type": {
"type": "keyword"
},
"travel_locations": {
"type": "keyword"
},
"travel_type": {
"type": "keyword"
},
"vendor_badges": {
"type": "nested",
"properties": {
"badge_api_string": {
"type": "text"
},
"badge_code": {
"type": "text"
}
}
},
"vendor_locations": {
"type": "geo_point"
},
"vendor_portfolio_items": {
"type": "nested",
"properties": {
"clarifai_item": {
"type": "nested",
"properties": {
"confidence_value": {
"type": "float"
},
"description": {
"type": "text",
"analyzer": "clarifai_analyzer"
}
}
},
"image_url": {
"type": "keyword"
}
}
},
"vendor_profile_regions": {
"type": "nested",
"properties": {
"catalog_semcat_index": {
"type": "integer"
},
"category_code": {
"type": "integer"
},
"category_search_active": {
"type": "boolean"
},
"current_listing_type_code": {
"type": "integer"
},
"listing_end_date": {
"type": "date"
},
"listing_flag": {
"type": "boolean"
},
"listing_start_date": {
"type": "date"
},
"listing_type_code": {
"type": "integer"
},
"name_search_active": {
"type": "boolean"
},
"network_type_code": {
"type": "integer"
},
"new_and_noteworthy": {
"type": "boolean"
},
"region_code": {
"type": "keyword"
},
"sem_catalog_index": {
"type": "integer"
},
"state_code": {
"type": "keyword"
}
}
},
"vendor_type_code": {
"type": "integer"
},
"venue_event_services": {
"type": "keyword"
},
"venue_max_capacity_count": {
"type": "integer"
},
"venue_setting": {
"type": "keyword"
},
"venue_type": {
"type": "keyword"
},
"videography_genre": {
"type": "keyword"
},
"videography_pricing_popular_price": {
"type": "integer"
},
"videography_services": {
"type": "keyword"
},
"videography_type": {
"type": "keyword"
},
"wedding_rating_average": {
"type": "float"
},
"wedding_rating_count": {
"type": "integer"
}
}
}
}
}
}
GET _search
{
"from": 0,
"size": 8,
"version": true,
"query": {
"function_score": {
"query": {
"bool": {
"should": [
{
"nested": {
"path": "vendor_portfolio_items.clarifai_item",
"query": {
"match": {
"vendor_portfolio_items.clarifai_item.description": "garden"
}
},
"inner_hits": {"size": 5, "sort": [{ "vendor_portfolio_items.clarifai_item.confidence_value": "desc" }]}
}
}
],
"must": [
{
"term": {
"vendor_type_code": "1"
}
},
{
"term": {
"active_flag": true
}
},
{
"nested": {
"path": "vendor_profile_regions",
"query": {
"bool": {
"must": [
{
"term": {
"vendor_profile_regions.network_type_code": "1"
}
},
{
"term": {
"vendor_profile_regions.listing_flag": true
}
},
{
"term": {
"vendor_profile_regions.region_code": "511"
}
},
{
"term": {
"vendor_profile_regions.category_code": "11"
}
}
],
"should": [],
"must_not": [
{
"term": {
"vendor_profile_regions.current_listing_type_code": "4"
}
}
]
}
},
"inner_hits": {
"_source": {
"includes": [
"*.current_listing_type_code",
"*.category_code"
]
}
}
}
}
]
}
},
"random_score": {
"seed": 1502991873
}
}
},
"sort": [
{
"confirm_flag": {
"order": "desc"
}
},
{
"vendor_profile_regions.current_listing_type_code": {
"order": "desc",
"nested_path": "vendor_profile_regions",
"nested_filter": {
"bool": {
"must": [
{
"term": {
"vendor_profile_regions.network_type_code": "1"
}
},
{
"term": {
"vendor_profile_regions.listing_flag": true
}
},
{
"term": {
"vendor_profile_regions.region_code": "511"
}
},
{
"term": {
"vendor_profile_regions.category_code": "11"
}
}
],
"should": []
}
}
}
},
{
"_score": {
"order": "desc"
}
}
]
}
{
"took": 42,
"timed_out": false,
"_shards": {
"total": 2,
"successful": 2,
"failed": 0
},
"hits": {
"total": 1,
"max_score": null,
"hits": [
{
"_index": "vendors-test",
"_type": "vendor",
"_id": "1",
"_version": 2,
"_score": 0.73347723,
"_source": {
"active_flag": true,
"confirm_flag": true,
"vendor_type_code": 1,
"name": "Test Vendor 1",
"favor_service": null,
"photography_pricing_popular_price": null,
"florist_pricing_services": null,
"band_pricing_popular_price": null,
"invitation_service": null,
"jewelry_type": null,
"beauty_hair": null,
"other_specialty": null,
"officiant_typical_price": null,
"catering_cuisine": null,
"venue_max_capacity_count": 0,
"travel_locations": null,
"rehearsal_dinner_max_capacity_count": null,
"transportation_special": null,
"ceremonymusic_pricing_popular_price": null,
"videography_pricing_popular_price": null,
"rental_service": null,
"dj_pricing_popular_price": null,
"dress_service": null,
"cake_food": null,
"planner_pricing_partial": null,
"rehearsal_dinner_type": null,
"beauty_service": null,
"cake_dietary": null,
"catering_service": null,
"ceremonymusic_type": null,
"dj_genre": null,
"favor_product": null,
"invitation_product": null,
"officiant_wedding_services": null,
"photography_style": null,
"transportation_type": null,
"travel_type": null,
"venue_type": "GARDEN",
"videography_type": null,
"band_genre": "ACOUSTIC",
"florist_service": null,
"dj_services": null,
"videography_services": null,
"ceremonymusic_instrument": null,
"catering_dietary": null,
"officiant_type": null,
"venue_setting": null,
"photography_services": null,
"planner_service": null,
"beauty_makeup": null,
"venue_event_services": null,
"beauty_fitness_health": null,
"officiant_language": null,
"photography_items": null,
"florist_arrangement": null,
"videography_genre": null,
"catering_bar": null,
"dj_equipment": null,
"availability_category": true,
"vendor_profile_regions": [
{
"region_code": "511",
"network_type_code": 1,
"listing_flag": true,
"listing_type_code": 1,
"listing_start_date": null,
"listing_end_date": null,
"category_code": 1,
"current_listing_type_code": 1,
"state_code": "DC",
"name_search_active": false,
"category_search_active": false,
"catalog_semcat_index": null,
"sem_catalog_index": null,
"new_and_noteworthy": false
},
{
"region_code": "511",
"network_type_code": 1,
"listing_flag": true,
"listing_type_code": 1,
"listing_start_date": null,
"listing_end_date": null,
"category_code": 11,
"current_listing_type_code": 1,
"state_code": "DC",
"name_search_active": false,
"category_search_active": false,
"catalog_semcat_index": null,
"sem_catalog_index": null,
"new_and_noteworthy": false
}
],
"availability": {
"setup_complete": true,
"es_dates_unavailable": [],
"es_available_closed_dates": [],
"availability_status_type": 3,
"day_rules": [
{
"day_code": 0,
"open": false
},
{
"day_code": 1,
"open": false
},
{
"day_code": 2,
"open": false
},
{
"day_code": 3,
"open": false
},
{
"day_code": 4,
"open": true
},
{
"day_code": 5,
"open": true
},
{
"day_code": 6,
"open": true
}
]
},
"vendor_badges": [],
"image_file_name_exists": false,
"national": false,
"wedding_rating_count": 0,
"wedding_rating_average": null,
"max_rating_datetime": null,
"vendor_locations": [
[
-112.1953849771,
-6.4857123517
]
],
"location_sub_regions": [
"20004"
],
"location_cities": [
{
"city_raw_and_state": "Lake Eileenland, DC",
"city_and_state": "lake eileenland, dc",
"region_code": "511"
}
],
"vendor_portfolio_items": [
{
"clarifai_item": [
{
"description": "outdoors",
"confidence_value": 0.779
}
],
"image_url": "vendor/1_5000/1/thumbnails/440x440_1506635499-14d5f4d0759e9a18-209bf8.jpg"
},
{
"clarifai_item": [
{
"description": "patio",
"confidence_value": 0.821
}
],
"image_url": "vendor/1_5000/1/thumbnails/440x440_1506635499-9501bffa0ba5e60e-209bf8.jpg"
},
{
"clarifai_item": [
{
"description": "backyard",
"confidence_value": 0.934
}
],
"image_url": "vendor/1_5000/1/thumbnails/440x440_1506635500-2a6bb903e625e59e-209bf8.jpg"
}
]
},
"sort": [
1,
1,
0.73347723
],
"inner_hits": {
"vendor_portfolio_items.clarifai_item": {
"hits": {
"total": 3,
"max_score": null,
"hits": [
{
"_nested": {
"field": "vendor_portfolio_items",
"offset": 2,
"_nested": {
"field": "clarifai_item",
"offset": 0
}
},
"_score": null,
"_source": {
"description": "backyard",
"confidence_value": 0.934
},
"sort": [
0.934
]
},
{
"_nested": {
"field": "vendor_portfolio_items",
"offset": 1,
"_nested": {
"field": "clarifai_item",
"offset": 0
}
},
"_score": null,
"_source": {
"description": "patio",
"confidence_value": 0.821
},
"sort": [
0.821
]
},
{
"_nested": {
"field": "vendor_portfolio_items",
"offset": 0,
"_nested": {
"field": "clarifai_item",
"offset": 0
}
},
"_score": null,
"_source": {
"description": "outdoors",
"confidence_value": 0.779
},
"sort": [
0.779
]
}
]
}
},
"vendor_profile_regions": {
"hits": {
"total": 1,
"max_score": 2.364643,
"hits": [
{
"_nested": {
"field": "vendor_profile_regions",
"offset": 1
},
"_score": 2.364643,
"_source": {
"vendor_profile_regions": {
"category_code": 11,
"current_listing_type_code": 1
}
}
}
]
}
}
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment