Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def filter_query():
search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key))

async with search_client:
results = await search_client.search(search_text="WiFi", facets=["Category"], top=0)
results = await search_client.search(search_text="WiFi", facets=["Category,count:3", "ParkingIncluded"])

facets = await results.get_facets()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ async def create_index():
fields = [
SimpleField(name="hotelId", type=SearchFieldDataType.String, key=True),
SimpleField(name="baseRate", type=SearchFieldDataType.Double),
SearchableField(name="description", type=SearchFieldDataType.String),
SearchableField(name="description", type=SearchFieldDataType.String, collection=True),
ComplexField(name="address", fields=[
SimpleField(name="streetAddress", type=SearchFieldDataType.String),
SimpleField(name="city", type=SearchFieldDataType.String),
])
], collection=True)
]

cors_options = CorsOptions(allowed_origins=["*"], max_age_in_seconds=60)
Expand All @@ -72,16 +72,16 @@ async def get_index():
async def update_index():
# [START update_index_async]
name = "hotels"
fields = fields = [
fields = [
SimpleField(name="hotelId", type=SearchFieldDataType.String, key=True),
SimpleField(name="baseRate", type=SearchFieldDataType.Double),
SearchableField(name="description", type=SearchFieldDataType.String),
SearchableField(name="description", type=SearchFieldDataType.String, collection=True),
SearchableField(name="hotelName", type=SearchFieldDataType.String),
ComplexField(name="address", fields=[
SimpleField(name="streetAddress", type=SearchFieldDataType.String),
SimpleField(name="city", type=SearchFieldDataType.String),
SimpleField(name="state", type=SearchFieldDataType.String),
])
], collection=True)
]

cors_options = CorsOptions(allowed_origins=["*"], max_age_in_seconds=60)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def filter_query():

search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key))

results = search_client.search(search_text="WiFi", facets=["Category"], top=0)
results = search_client.search(search_text="WiFi", facets=["Category,count:3", "ParkingIncluded"])

facets = results.get_facets()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def create_index():
fields = [
SimpleField(name="hotelId", type=SearchFieldDataType.String, key=True),
SimpleField(name="baseRate", type=SearchFieldDataType.Double),
SearchableField(name="description", type=SearchFieldDataType.String),
SearchableField(name="description", type=SearchFieldDataType.String, collection=True),
ComplexField(name="address", fields=[
SimpleField(name="streetAddress", type=SearchFieldDataType.String),
SimpleField(name="city", type=SearchFieldDataType.String),
])
], collection=True)
]
cors_options = CorsOptions(allowed_origins=["*"], max_age_in_seconds=60)
scoring_profiles = []
Expand All @@ -73,13 +73,13 @@ def update_index():
fields = [
SimpleField(name="hotelId", type=SearchFieldDataType.String, key=True),
SimpleField(name="baseRate", type=SearchFieldDataType.Double),
SearchableField(name="description", type=SearchFieldDataType.String),
SearchableField(name="description", type=SearchFieldDataType.String, collection=True),
SearchableField(name="hotelName", type=SearchFieldDataType.String),
ComplexField(name="address", fields=[
SimpleField(name="streetAddress", type=SearchFieldDataType.String),
SimpleField(name="city", type=SearchFieldDataType.String),
SimpleField(name="state", type=SearchFieldDataType.String),
])
], collection=True)
]
cors_options = CorsOptions(allowed_origins=["*"], max_age_in_seconds=60)
scoring_profile = ScoringProfile(
Expand Down