File tree Expand file tree Collapse file tree 6 files changed +9
-13
lines changed
docs/kratos/manage-identities/search Expand file tree Collapse file tree 6 files changed +9
-13
lines changed Original file line number Diff line number Diff line change 9696 ],
9797 "page" : 1 ,
9898 "request_params" : {
99- "collection_name" : " identities-f59802a6-eb63-44cc-a3ac-d90db3d3abc2 " ,
99+ "collection_name" : " identities" ,
100100 "first_q" : " *" ,
101101 "per_page" : 20 ,
102102 "q" : " *"
Original file line number Diff line number Diff line change 11export ORY_API_KEY=" ory_pat_XXXXXXXXXXXXXXXX"
2- export COLLECTION=" identities-d7c52eed-e45c-4483-af3b-4aaa5782bff7" # replace with your project ID
32export ORY_SLUG=" upbeat-lalande-zu8omm6wwp" # replace with your Ory slug
43
54# list identities which do not have two-factor authentication enabled,
65# resolved by the organization to which they belong,
76# ordered by creation date (newest first),
87# and limited to 20 per page
98curl -H " Authorization: Bearer $ORY_API_KEY " \
10- " https://$ORY_SLUG .projects.oryapis.com/admin/preview/search/v0beta1/collections/$COLLECTION /documents/search" \
9+ " https://$ORY_SLUG .projects.oryapis.com/admin/preview/search/v0beta1/collections/identities /documents/search" \
1110 --url-query ' q=*' \
1211 --url-query ' filter_by=available_aal:!=aal2' \
1312 --url-query ' facet_by=organization_id' \
Original file line number Diff line number Diff line change 11export ORY_API_KEY=" ory_pat_XXXXXXXXXXXXXXXX"
2- export COLLECTION=" identities-d7c52eed-e45c-4483-af3b-4aaa5782bff7" # replace with your project ID
32export ORY_SLUG=" upbeat-lalande-zu8omm6wwp" # replace with your Ory slug
43
54# List identities via Search API
65curl -H " Authorization: Bearer $ORY_API_KEY " \
7- " https://$ORY_SLUG .projects.oryapis.com/admin/preview/search/v0beta1/collections/$COLLECTION /documents/search?q=*"
6+ " https://$ORY_SLUG .projects.oryapis.com/admin/preview/search/v0beta1/collections/identities /documents/search?q=*"
87
98# Search for "foo" in the email trait
109curl -H " Authorization: Bearer $ORY_API_KEY " \
11- " https://$ORY_SLUG .projects.oryapis.com/admin/preview/search/v0beta1/collections/$COLLECTION /documents/search?q=foo&query_by=traits.email"
10+ " https://$ORY_SLUG .projects.oryapis.com/admin/preview/search/v0beta1/collections/identities /documents/search?q=foo&query_by=traits.email"
Original file line number Diff line number Diff line change @@ -13,11 +13,10 @@ import (
1313var (
1414 ORY_PROJECT_URL = os .Getenv ("ORY_PROJECT_URL" )
1515 ORY_API_KEY = os .Getenv ("ORY_API_KEY" )
16- Collection = "identities-" + os .Getenv ("ORY_PROJECT_ID" )
1716)
1817
1918func main () {
20- ctx := context .WithValue (context .Background (), ory .ContextAccessToken , os . Getenv ( " ORY_API_KEY" ) )
19+ ctx := context .WithValue (context .Background (), ory .ContextAccessToken , ORY_API_KEY )
2120
2221 // Initialize Ory client
2322 cfg := ory .NewConfiguration ()
@@ -34,7 +33,7 @@ func main() {
3433
3534 // highlight-start
3635 // List identities via Search API
37- list , err := searchClient .Collection (Collection ).Documents ().Search (ctx , & typesenseapi.SearchCollectionParams {
36+ list , err := searchClient .Collection ("identities" ).Documents ().Search (ctx , & typesenseapi.SearchCollectionParams {
3837 Q : ptr ("*" ),
3938 })
4039 // highlight-end
@@ -49,7 +48,7 @@ func main() {
4948
5049 // highlight-start
5150 // Search identities via Search API
52- search , err := searchClient .Collection (Collection ).Documents ().Search (ctx , & typesenseapi.SearchCollectionParams {
51+ search , err := searchClient .Collection ("identities" ).Documents ().Search (ctx , & typesenseapi.SearchCollectionParams {
5352 Q : ptr ("foo" ),
5453 QueryBy : ptr ("traits" ),
5554 })
Original file line number Diff line number Diff line change @@ -16,8 +16,7 @@ public static void main(String[] args) {
1616 Client searchClient = initializeSearchClient ();
1717 // highlight-start
1818 // Search identities via Search API
19- String collection = "identities-" + System .getenv ("ORY_PROJECT_ID" ); // Set the collection name
20- SearchResult searchResult = searchClient .collections (collection ).documents ()
19+ SearchResult searchResult = searchClient .collections ("identities" ).documents ()
2120 .search (new SearchParameters ().q ("test@example.com" ).queryBy ("traits.email" ));
2221 // highlight-end
2322
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ Typesense API key, and use the following base URL:
3737https://{your-ory-slug}.projects.oryapis.com/admin/preview/search/v0beta1
3838```
3939
40- and set the collection name to ` identities-{your-project-id} ` .
40+ and query the collection named ` identities ` .
4141
4242See the following examples for how to configure and use the Typesense SDKs to search for identities.
4343
You can’t perform that action at this time.
0 commit comments