Table: algolia_search_metadata - Query Algolia Search Metadata using SQL
Algolia is a search and discovery API platform that provides a seamless search and discovery experience across devices and platforms. It enables developers to build search functionality into their applications, websites, and software. Algolia's Search Metadata is a resource that provides insights into search operations and their associated metadata.
Table Usage Guide
The algolia_search_metadata
table provides insights into search operations within Algolia. As a developer or data analyst, explore details about search operations through this table, including search queries, hits, processing time, and associated metadata. Utilize it to uncover information about search patterns, performance metrics, and the optimization of search operations.
Examples
Get facet data for each index
Analyze the different facets of your search indices to understand their structure and characteristics. This can help in optimizing your search functionality for better user experience.
select index, jsonb_pretty(facets)from algolia_search_metadata;
select index, facetsfrom algolia_search_metadata;
Number of hits and time take per index for a query
Analyze the performance of a specific search term in an Algolia-powered search system. This allows you to understand which indices are most frequently hit and how long it takes to process each hit, helping to optimize search performance.
select index, num_hits, processing_time_msfrom algolia_search_metadatawhere query = 'aws vpc'order by processing_time_ms desc;
select index, num_hits, processing_time_msfrom algolia_search_metadatawhere query = 'aws vpc'order by processing_time_ms desc;
Schema for algolia_search_metadata
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
ab_test_variant_id | bigint | If a search encounters an index that is being A/B tested, this reports the variant ID of the index used. | |
around_lat_long | text | The computed geo location. Format: ${lat},${lng}, where the latitude and longitude are expressed as decimal floating point numbers. | |
automatic_radius | text | The automatically computed radius. | |
exhaustive_facets_count | boolean | Whether the facet count is exhaustive (true) or approximate (false). | |
exhaustive_num_hits | boolean | Whether the nbHits is exhaustive (true) or approximate (false). | |
facets | jsonb | A mapping of each facet name to the corresponding facet counts. | |
facets_stats | jsonb | Statistics for numerical facets. | |
hits_per_page | bigint | The maximum number of hits returned per page. | |
index | text | = | Name of the index for the search result. |
index_used | text | Index name used for the query. In the case of an A/B test, the targeted index isn’t always the index used by the query. | |
message | text | Used to return warnings about the query. | |
num_hits | bigint | The number of hits matched by the query. | |
num_pages | bigint | The number of returned pages. Calculation is based on the total number of hits (nbHits) divided by the number of hits per page (hitsPerPage), rounded up to the nearest integer. | |
page | bigint | Index of the current page (zero-based). See the page search parameter. | |
params | jsonb | Parameters passed to the search. | |
parsed_query | text | The query string that will be searched, after normalization. Normalization includes removing stop words (if removeStopWords is enabled), and transforming portions of the query string into phrase queries. | |
processing_time_ms | bigint | Time the server took to process the request, in milliseconds. This does not include network time. | |
query | text | = | Query for the saerch. |
query_after_removal | text | A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. | |
query_id | text | Unique identifier of the search query, to be sent in Insights methods. This identifier links events back to the search query it represents. | |
server_used | text | Actual host name of the server that processed the request. | |
user_data | jsonb | User data results from the search. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- algolia
You can pass the configuration to the command with the --config
argument:
steampipe_export_algolia --config '<your_config>' algolia_search_metadata