You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I know Algolia Analytics API has a way to fetch popular searches but wondering if there's a way to do it with this package
Describe the solution you'd like
If there's a simple way to fetch top popular searches, then it would make it easier to fully use this functionality in search
Describe alternatives you've considered
Directly implementing Algolia Analytics API but it doesn't seem to work yet
`Future fetchPopularSearches() async {
final String url = 'https://analytics.algolia.com/1/searches/popular?indexName=YOUR_INDEX_NAME';
final String appId = 'YOUR_APP_ID'; // Ensure this is secured and not hardcoded.
final String apiKey = 'YOUR_API_KEY'; // Ensure this is secured and not hardcoded.
if (response.statusCode == 200) {
final data = json.decode(response.body);
print('$popularSearchesKey: $data');
// You can use popularSearchesKey as a reference for caching the response
} else {
print('Failed to fetch $popularSearchesKey: ${response.reasonPhrase}');
// Handle non-200 responses
}
Is your feature request related to a problem? Please describe.
I know Algolia Analytics API has a way to fetch popular searches but wondering if there's a way to do it with this package
Describe the solution you'd like
If there's a simple way to fetch top popular searches, then it would make it easier to fully use this functionality in search
Describe alternatives you've considered
Directly implementing Algolia Analytics API but it doesn't seem to work yet
`Future fetchPopularSearches() async {
final String url = 'https://analytics.algolia.com/1/searches/popular?indexName=YOUR_INDEX_NAME';
final String appId = 'YOUR_APP_ID'; // Ensure this is secured and not hardcoded.
final String apiKey = 'YOUR_API_KEY'; // Ensure this is secured and not hardcoded.
try {
final response = await http.get(
Uri.parse(url),
headers: {
'X-Algolia-Application-Id': appId,
'X-Algolia-API-Key': apiKey,
},
);
} catch (e) {
print('Error fetching $popularSearchesKey: $e');
// Handle network errors, parsing errors, etc.
}
}`
The text was updated successfully, but these errors were encountered: