Skip to content

Commit 65f7504

Browse files
polyfractalclintongormley
authored andcommitted
Fix snippet path, add missing
1 parent 6fff3af commit 65f7504

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

300_Aggregations/75_sigterms.asciidoc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ POST /_snapshot/sigterms/snapshot/_restore <3>
2626
2727
GET /mlmovies,mlratings/_recovery <4>
2828
----
29-
// SENSE: 300_Aggregations/20_basic_example.json
29+
// SENSE: 300_Aggregations/75_sigterms.json
3030
<1> Register a new read-only URL repository pointing at the demo snapshot
3131
<2> (Optional) Inspect the repository to learn details about available snapshots
3232
<3> Begin the Restore process. This will download two indices into your cluster: `mlmovies`
@@ -70,7 +70,7 @@ GET mlmovies/_search <1>
7070
},
7171
....
7272
----
73-
// SENSE: 300_Aggregations/20_basic_example.json
73+
// SENSE: 300_Aggregations/75_sigterms.json
7474
<1> Execute a search without a query, so that we can see a random sampling of docs.
7575

7676
Each document in `mlmovies` represents a single movie. The two important pieces
@@ -110,6 +110,7 @@ GET mlratings/_search
110110
},
111111
...
112112
----
113+
// SENSE: 300_Aggregations/75_sigterms.json
113114

114115
Here we can see the recommendations of individual users. Each document represents
115116
a single user, denoted by the `user` ID field. The `movie` field holds a list
@@ -154,7 +155,8 @@ GET mlmovies/_search
154155
},
155156
...
156157
----
157-
<1> The _Talladega Nights_ ID is `46970`.
158+
// SENSE: 300_Aggregations/75_sigterms.json
159+
<1> _Talladega Nights_ is ID `46970`.
158160

159161
Armed with the ID, we can now filter the ratings and ((("filtering", "in aggregations")))apply our `terms` aggregation
160162
to find the most popular movies from people who also like _Talladega Nights_:
@@ -182,6 +184,7 @@ GET mlratings/_search?search_type=count <1>
182184
}
183185
}
184186
----
187+
// SENSE: 300_Aggregations/75_sigterms.json
185188
<1> We execute our query on `mlratings` this time, and specify `search_type=count`
186189
since we are interested only in the aggregation results.
187190
<2> Apply a filter on the ID corresponding to _Talladega Nights_.
@@ -258,6 +261,7 @@ GET mlmovies/_search
258261
}
259262
}
260263
----
264+
// SENSE: 300_Aggregations/75_sigterms.json
261265

262266
And finally, we end up with the following list:
263267

@@ -290,6 +294,7 @@ GET mlratings/_search?search_type=count
290294
}
291295
}
292296
----
297+
// SENSE: 300_Aggregations/75_sigterms.json
293298

294299
This returns a list that is very similar:
295300

@@ -339,7 +344,8 @@ GET mlratings/_search?search_type=count
339344
}
340345
}
341346
----
342-
<1> The setup is nearly identical: we just use `significant_terms` instead of
347+
// SENSE: 300_Aggregations/75_sigterms.json
348+
<1> The setup is nearly identical -- we just use `significant_terms` instead of
343349
`terms`.
344350

345351
As you can see, the query is nearly the same. We filter for users who

0 commit comments

Comments
 (0)