Raw
1 import { Note, Prerequisites, Table, InlineIcon } from "docs-ui"
2 import { ArrowPathMini, ArrowsPointingOutMini } from "@medusajs/icons"
3
4 export const metadata = {
5 title: `Medusa Search Analytics`,
6 keywords: [
7 "search",
8 "medusa search",
9 "analytics",
10 "no results",
11 "latency",
12 "search terms",
13 ],
14 }
15
16 # {metadata.title}
17
18 In this guide, you'll learn how to view analytics for an environment's [Medusa Search](../page.mdx) indexes in the Cloud dashboard.
19
20 <Prerequisites
21 items={[
22 {
23 text: "Medusa Search set up with at least one index definition, and an environment that has served searches",
24 link: "/search",
25 },
26 ]}
27 />
28
29 The environment only reports analytics for indexes that Medusa Search holds, so an environment without index definitions, doesn't use Medusa Search, or one that hasn't served any search yet, shows empty cards.
30
31 ## What are Search Analytics?
32
33 Search analytics show what customers searched for in an environment, how often searches came back empty, and how fast Medusa Search responded. Use them to find the terms that return nothing, spot the terms that drive the most traffic, and check that search latency stays within your targets.
34
35 Medusa collects analytics per index and per environment, so a preview environment's numbers never mix with production's.
36
37 ---
38
39 ## View Search Analytics
40
41 To view the search analytics of an environment:
42
43 1. If you're in a different organization, [switch to the organization](../../organizations/page.mdx#switch-organization).
44 2. Click **Projects** in the sidebar and select the project that contains the environment you want to view.
45 3. In the project's dashboard, click on the name of the environment. For example, "Production".
46 4. Click **Search** in the sidebar under the environment's section.
47
48 You can see under the **Search analytics** section the performance and usage metrics for each index in the selected environment.
49
50 ### Plan Availability
51
52 Item counts and index sizes shown in the [Overview](#search-overview) section are available on all Cloud plans. The rest of the metrics on this page, including the chart, the search speed cards, and the term tables, are available for Scale and Enterprise plans. If your plan doesn't include them, the section shows a prompt to change your plan instead.
53
54 Refer to the [Plans & Pricing](../../pricing/page.mdx) guide for what each plan includes, and to the [Manage Plans](../../billing/plans/page.mdx#change-plan) guide to change your organization's plan.
55
56
57 ---
58
59 ## Choose an Index and Time Range
60
61 Every card in the **Search analytics** section reports on one index over one time range. Two selectors at the top of the section control both:
62
63 - The **index selector** chooses the index, such as `products`. An index that Medusa is currently rebuilding shows an **Updating** badge next to its name, so its item count and index size change while the [reindex](../page.mdx#reindex-on-medusa-search) runs.
64 - The **time range selector** chooses the window that the metrics cover, such as **Last hour**. The ranges you can choose from depend on your organization's plan.
65
66 Click the <InlineIcon Icon={ArrowPathMini} alt="refresh" /> button next to the selectors to load the latest values.
67
68 ---
69
70 ## Search Overview
71
72 The **Overview** card under the **Search analytics** section shows the headline numbers for the selected index and time range.
73
74 <Table>
75 <Table.Header>
76 <Table.Row>
77 <Table.HeaderCell>
78 Metric
79 </Table.HeaderCell>
80 <Table.HeaderCell>
81 Description
82 </Table.HeaderCell>
83 </Table.Row>
84 </Table.Header>
85 <Table.Body>
86 <Table.Row>
87 <Table.Cell>
88 Items in index
89 </Table.Cell>
90 <Table.Cell>
91 The number of records the index currently holds. It reflects the index as it is now, not the selected time range.
92 </Table.Cell>
93 </Table.Row>
94 <Table.Row>
95 <Table.Cell>
96 Index size
97 </Table.Cell>
98 <Table.Cell>
99 The storage that the index currently occupies.
100 </Table.Cell>
101 </Table.Row>
102 <Table.Row>
103 <Table.Cell>
104 Searches
105 </Table.Cell>
106 <Table.Cell>
107 The number of searches that ran against the index in the selected time range.
108 </Table.Cell>
109 </Table.Row>
110 <Table.Row>
111 <Table.Cell>
112 Vector searches
113 </Table.Cell>
114 <Table.Cell>
115
116 How many of those searches ranked hits with an embedding. Refer to the [Semantic Search](../semantic-search/page.mdx) guide for more details.
117
118 </Table.Cell>
119 </Table.Row>
120 <Table.Row>
121 <Table.Cell>
122 Keyword searches with no results
123 </Table.Cell>
124 <Table.Cell>
125 The percentage of keyword searches that returned zero hits.
126 </Table.Cell>
127 </Table.Row>
128 </Table.Body>
129 </Table>
130
131 <Note title="Tip">
132
133 `Searches` counts the searches Medusa Search served, which isn't the same as the search requests your organization is billed for. Writes to an index count toward your allowance too. Refer to [How Medusa Search Counts Search Requests](../page.mdx#how-medusa-search-counts-search-requests) for more details.
134
135 </Note>
136
137 ---
138
139 ## Searches Over Time
140
141 The **Searches over time** chart plots the searches that ran against the index over the selected time range, split into three series:
142
143 - **Free-text searches**: keyword searches.
144 - **Vector searches**: searches that rank hits with an embedding. Refer to the [Semantic Search](../semantic-search/page.mdx) guide for more details.
145 - **No results**: searches that returned zero hits.
146
147 Use it to compare how much traffic each search type serves, and to tie a spike to the moment it started, such as a deployment that changed an index definition or a campaign that sent customers looking for a product you don't carry.
148
149 Click the <InlineIcon Icon={ArrowsPointingOutMini} alt="expand" /> button on the card to view the chart in a larger dialog.
150
151 ---
152
153 ## Search Speed
154
155 Two cards report how long Medusa Search took to respond, in milliseconds:
156
157 - **Free-text search speed** covers keyword searches.
158 - **Vector search speed** covers searches that rank hits with an embedding.
159
160 Each card shows the **Median**, **p95**, **p99**, and **Average** response times. The percentiles matter more than the average: `p95` is the time that 95% of searches stayed under, so it tells you what your slowest customers experienced.
161
162 Vector searches are slower than free-text searches by nature, since they compare embeddings.
163
164 The times measure how long Medusa Search spent on the search. They don't include the time your Medusa application or storefront spent on the rest of the request.
165
166 ---
167
168 ## Most Searched Terms
169
170 The **Most searched terms** table lists the terms customers searched for the most in the selected time range, with the number of searches for each term.
171
172 Use it to find the products, categories, or brands that deserve a place in your navigation, and to check that your top terms return the results you expect.
173
174 ---
175
176 ## Searches with No Results
177
178 The **Searches with no results** table lists the terms that returned zero hits, with the number of searches for each term.
179
180 Each of these terms is a customer who found nothing. Depending on the term, you can act on it in different ways:
181
182 - The term names a product you don't sell, which makes it a demand signal for your merchandising team.
183 - The term is a synonym or a misspelling of a product you do sell, so make the term searchable by adding it to the [index definition's fields](!resources!/infrastructure-modules/search/index-definitions/fields), or enable [typo tolerance](../settings/page.mdx) on the field it should match.
184 - The term is a natural-language phrase that keyword search can't match, so [semantic search](../semantic-search/page.mdx) can find hits for it.
185
186 <Note>
187
188 The **Most searched terms** and **Searches with no results** tables only cover keyword searches. If the index served no keyword searches in the selected time range, each table shows an empty state instead of terms.
189
190 </Note>
191
192 ---
193
194 ## Most Common Vector Terms
195
196 The **Most common vector terms** table lists the terms that customers searched for the most with [semantic search](../semantic-search/page.mdx) in the selected time range, with the number of searches for each term.
197
198 Use it to see the natural-language phrases that keyword search can't match, and to decide which of them deserve their own fields or synonyms in the [index definition](!resources!/infrastructure-modules/search/index-definitions).