Skip to content

Commit 7a07610

Browse files
authored
remove comma's to follow the style of the rest of the project (#40)
1 parent 925f2ac commit 7a07610

File tree

2 files changed

+88
-88
lines changed

2 files changed

+88
-88
lines changed

test/typesense/api_test.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"test_collection"
9797
documents)
9898
exp {:uri "http://localhost:8108/collections/test_collection/documents/import"
99-
:req {:headers {"X-TYPESENSE-API-KEY" "key",
99+
:req {:headers {"X-TYPESENSE-API-KEY" "key"
100100
"Content-Type" "text/plain"}
101101
:body "{\"test_name\":\"test_document_two\",\"test_count\":2}\n{\"test_name\":\"test_document_three\",\"test_count\":3}\n{\"test_name\":\"test_document_four\",\"test_count\":4}\n"}}]
102102
(is (= exp req))))
@@ -112,7 +112,7 @@
112112
"test_collection"
113113
documents {:action "upsert" :batch_size 100})
114114
exp {:uri "http://localhost:8108/collections/test_collection/documents/import?action=upsert&batch_size=100"
115-
:req {:headers {"X-TYPESENSE-API-KEY" "key",
115+
:req {:headers {"X-TYPESENSE-API-KEY" "key"
116116
"Content-Type" "text/plain"}
117117
:body "{\"test_name\":\"test_document_two\",\"test_count\":2}\n{\"test_name\":\"test_document_three\",\"test_count\":3}\n{\"test_name\":\"test_document_four\",\"test_count\":4}\n"}}]
118118
(is (= exp req))))
@@ -256,7 +256,7 @@
256256
"companies"
257257
{:collection_name "companies_june11"})
258258
exp {:uri "http://localhost:8108/aliases/companies"
259-
:req {:headers {"X-TYPESENSE-API-KEY" "key",
259+
:req {:headers {"X-TYPESENSE-API-KEY" "key"
260260
"Content-Type" "text/json"}
261261
:body "{\"collection_name\":\"companies_june11\"}"}}]
262262
(is (= exp req))))

test/typesense/client_test.clj

Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -327,36 +327,36 @@
327327
(is (= exp res))))
328328

329329
(testing "Search"
330-
(let [exp {:facet_counts [],
331-
:found 1,
330+
(let [exp {:facet_counts []
331+
:found 1
332332
:hits
333333
[{:document
334-
{:company_name "Innovationsoft A/S",
335-
:country "Finland",
336-
:id "1",
337-
:num_employees 10},
334+
{:company_name "Innovationsoft A/S"
335+
:country "Finland"
336+
:id "1"
337+
:num_employees 10}
338338
:highlight
339339
{:company_name
340-
{:matched_tokens ["Innovation"],
341-
:snippet "<mark>Innovation</mark>soft A/S"}},
340+
{:matched_tokens ["Innovation"]
341+
:snippet "<mark>Innovation</mark>soft A/S"}}
342342
:highlights
343-
[{:field "company_name",
344-
:matched_tokens ["Innovation"],
345-
:snippet "<mark>Innovation</mark>soft A/S"}],
346-
:text_match 578730089005449337,
343+
[{:field "company_name"
344+
:matched_tokens ["Innovation"]
345+
:snippet "<mark>Innovation</mark>soft A/S"}]
346+
:text_match 578730089005449337
347347
:text_match_info
348-
{:best_field_score "1108074561536",
349-
:best_field_weight 15,
350-
:fields_matched 1,
351-
:score "578730089005449337",
352-
:tokens_matched 1}}],
353-
:out_of 1,
354-
:page 1,
348+
{:best_field_score "1108074561536"
349+
:best_field_weight 15
350+
:fields_matched 1
351+
:score "578730089005449337"
352+
:tokens_matched 1}}]
353+
:out_of 1
354+
:page 1
355355
:request_params
356-
{:collection_name "companies_documents_test",
357-
:per_page 10,
358-
:q "Innovation"},
359-
:search_cutoff false,
356+
{:collection_name "companies_documents_test"
357+
:per_page 10
358+
:q "Innovation"}
359+
:search_cutoff false
360360
:search_time_ms 0}
361361
res (sut/search settings
362362
"companies_documents_test"
@@ -385,55 +385,55 @@
385385

386386
(testing "Multi search"
387387
(let [exp {:results
388-
[{:facet_counts [],
389-
:found 1,
388+
[{:facet_counts []
389+
:found 1
390390
:hits
391-
[{:document {:id "1", :name "shoe", :price 75},
391+
[{:document {:id "1" :name "shoe" :price 75}
392392
:highlight
393-
{:name {:matched_tokens ["shoe"], :snippet "<mark>shoe</mark>"}},
393+
{:name {:matched_tokens ["shoe"] :snippet "<mark>shoe</mark>"}}
394394
:highlights
395-
[{:field "name",
396-
:matched_tokens ["shoe"],
397-
:snippet "<mark>shoe</mark>"}],
398-
:text_match 578730123365711993,
395+
[{:field "name"
396+
:matched_tokens ["shoe"]
397+
:snippet "<mark>shoe</mark>"}]
398+
:text_match 578730123365711993
399399
:text_match_info
400-
{:best_field_score "1108091339008",
401-
:best_field_weight 15,
402-
:fields_matched 1,
403-
:score "578730123365711993",
404-
:tokens_matched 1}}],
405-
:out_of 1,
406-
:page 1,
400+
{:best_field_score "1108091339008"
401+
:best_field_weight 15
402+
:fields_matched 1
403+
:score "578730123365711993"
404+
:tokens_matched 1}}]
405+
:out_of 1
406+
:page 1
407407
:request_params
408-
{:collection_name "products_multi_search_test",
409-
:per_page 10,
410-
:q "shoe"},
411-
:search_cutoff false,
408+
{:collection_name "products_multi_search_test"
409+
:per_page 10
410+
:q "shoe"}
411+
:search_cutoff false
412412
:search_time_ms 0}
413-
{:facet_counts [],
414-
:found 1,
413+
{:facet_counts []
414+
:found 1
415415
:hits
416-
[{:document {:id "1", :name "Nike"},
416+
[{:document {:id "1" :name "Nike"}
417417
:highlight
418-
{:name {:matched_tokens ["Nike"], :snippet "<mark>Nike</mark>"}},
418+
{:name {:matched_tokens ["Nike"] :snippet "<mark>Nike</mark>"}}
419419
:highlights
420-
[{:field "name",
421-
:matched_tokens ["Nike"],
422-
:snippet "<mark>Nike</mark>"}],
423-
:text_match 578730123365711993,
420+
[{:field "name"
421+
:matched_tokens ["Nike"]
422+
:snippet "<mark>Nike</mark>"}]
423+
:text_match 578730123365711993
424424
:text_match_info
425-
{:best_field_score "1108091339008",
426-
:best_field_weight 15,
427-
:fields_matched 1,
428-
:score "578730123365711993",
429-
:tokens_matched 1}}],
430-
:out_of 1,
431-
:page 1,
425+
{:best_field_score "1108091339008"
426+
:best_field_weight 15
427+
:fields_matched 1
428+
:score "578730123365711993"
429+
:tokens_matched 1}}]
430+
:out_of 1
431+
:page 1
432432
:request_params
433-
{:collection_name "brands_multi_search_test",
434-
:per_page 10,
435-
:q "Nike"},
436-
:search_cutoff false,
433+
{:collection_name "brands_multi_search_test"
434+
:per_page 10
435+
:q "Nike"}
436+
:search_cutoff false
437437
:search_time_ms 0}]}
438438
res (sut/multi-search settings
439439
{:searches [{:collection "products_multi_search_test"
@@ -457,20 +457,20 @@
457457
(sut/create-document! settings "places" document))
458458

459459
(testing "Geosearch"
460-
(let [exp {:facet_counts [],
461-
:found 1,
460+
(let [exp {:facet_counts []
461+
:found 1
462462
:hits
463463
[{:document
464-
{:id "0",
465-
:location [48.86093481609114 2.33698396872901],
466-
:points 1,
467-
:title "Louvre Museuem"},
468-
:geo_distance_meters {:location 1020},
469-
:highlight {},
470-
:highlights []}],
471-
:out_of 1,
472-
:page 1,
473-
:request_params {:collection_name "places", :per_page 10, :q "*"},
464+
{:id "0"
465+
:location [48.86093481609114 2.33698396872901]
466+
:points 1
467+
:title "Louvre Museuem"}
468+
:geo_distance_meters {:location 1020}
469+
:highlight {}
470+
:highlights []}]
471+
:out_of 1
472+
:page 1
473+
:request_params {:collection_name "places" :per_page 10 :q "*"}
474474
:search_cutoff false}
475475
res (sut/search settings
476476
"places"
@@ -512,23 +512,23 @@
512512

513513
(testing "List all overrides"
514514
(let [exp {:overrides
515-
[{:excludes [{:id "287"}],
516-
:filter_curated_hits false,
517-
:id "customize_apple",
518-
:includes [{:id "422", :position 1} {:id "54", :position 2}],
519-
:remove_matched_tokens false,
520-
:rule {:match "exact", :query "apple"},
515+
[{:excludes [{:id "287"}]
516+
:filter_curated_hits false
517+
:id "customize_apple"
518+
:includes [{:id "422" :position 1} {:id "54" :position 2}]
519+
:remove_matched_tokens false
520+
:rule {:match "exact" :query "apple"}
521521
:stop_processing true}]}
522522
res (sut/list-overrides settings "companies_curation_test")]
523523
(is (= exp res))))
524524

525525
(testing "Retrieve override"
526-
(let [exp {:excludes [{:id "287"}],
527-
:filter_curated_hits false,
528-
:id "customize_apple",
529-
:includes [{:id "422", :position 1} {:id "54", :position 2}],
530-
:remove_matched_tokens false,
531-
:rule {:match "exact", :query "apple"},
526+
(let [exp {:excludes [{:id "287"}]
527+
:filter_curated_hits false
528+
:id "customize_apple"
529+
:includes [{:id "422" :position 1} {:id "54" :position 2}]
530+
:remove_matched_tokens false
531+
:rule {:match "exact" :query "apple"}
532532
:stop_processing true}
533533
res (sut/retrieve-override settings
534534
"companies_curation_test"

0 commit comments

Comments
 (0)