Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge doc tests into main branch to keep in-sync with the code #3861

Merged
merged 26 commits into from
Jun 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1578b98
Fix search_quickstart example
uglide May 17, 2023
50544dc
Add data_class step to SearchQuickstartExample
uglide May 18, 2023
a0043ff
Update examples with new bikes and align to new tutorial
elena-kolevska Jul 4, 2023
c5dd771
Fixes doctests for search tutorial
elena-kolevska Jul 4, 2023
2ba7bdb
Small fixes doctests
elena-kolevska Jul 4, 2023
5b0a7f8
Updates search tutorial doc examples to new format and data
elena-kolevska Jul 5, 2023
dd76c48
Merge branch 'master' into emb-examples
elena-kolevska Jul 5, 2023
ec0e1a3
Fix formatting in doc tests
uglide Jul 18, 2023
983b677
Add Hashes and String Example (#3477)
bsbodden Jul 20, 2023
4ddc215
Add Geospatial data type example (#3487)
bsbodden Aug 8, 2023
d8f4153
Merge branch 'master' into emb-examples
sazzad16 Dec 6, 2023
0526f6c
Added example Java code snippets for Streams (#3641)
Harsh4902 Dec 6, 2023
ccf74cf
Java example code snippets for T-Digest and TopK (#3660)
Ranjeet0611 Dec 29, 2023
cea57ff
Create Java code snippets for sets redis#3626 (#3661)
suraj11chauhan Jan 2, 2024
da8e25c
Create Java code snippets for count min sketch (#3644)
Harsh4902 Jan 13, 2024
7878e46
Added Java code snippets for Bloom #3630 (#3671)
Ranjeet0611 Jan 13, 2024
783f92e
Added java code snippet for hyperloglog (#3674)
Ranjeet0611 Jan 13, 2024
b21daab
Added Java code snippets for cuckoo filters (#3679)
Ranjeet0611 Jan 13, 2024
fbed166
Create Java code snippet for lists #3625 (#3677)
suraj11chauhan Jan 13, 2024
c467015
Create Java code snippet for sorted sets (#3680)
Harsh4902 Jan 16, 2024
118cc1d
Added Java code snippet for bitmap (#3687)
Ranjeet0611 Jan 16, 2024
ced33a9
Merge branch 'master' into emb-examples
sazzad16 Jan 17, 2024
5d58ae6
Merge branch 'master' into emb-examples
sazzad16 Jan 17, 2024
f217596
Merge branch 'master' into emb-examples
sazzad16 Feb 27, 2024
79d7ec7
Merge branch 'master' into emb-examples
uglide Jun 12, 2024
4035a46
Merge branch 'master' into emb-examples
uglide Jun 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updates search tutorial doc examples to new format and data
  • Loading branch information
elena-kolevska committed Jul 5, 2023
commit 5b0a7f8e8c8778bbf3f4f40f0a39428cf7a9c64e
26 changes: 22 additions & 4 deletions src/test/java/io/redis/examples/SearchQuickstartExample.java
Original file line number Diff line number Diff line change
@@ -213,14 +213,14 @@ public void run() {
// STEP_START wildcard_query
Query query1 = new Query("*");
List < Document > result1 = jedis.ftSearch("idx:bicycle", query1).getDocuments();
System.out.println(result1);
// Prints: [id:bicycle:1, score: 1.0, payload:null, properties:[$={"brand":"Bicyk","...
System.out.println("Documents found:" + result1.size());
// Prints: Documents found: 10
// STEP_END
// REMOVE_START
assertEquals("Validate total results", 10, result1.size());
// REMOVE_END

// STEP_START query_single_term_all_fields
// STEP_START query_single_term
Query query2 = new Query("@model:Jigger");
List < Document > result2 = jedis.ftSearch(
"idx:bicycle", query2).getDocuments();
@@ -231,7 +231,7 @@ public void run() {
assertEquals("Validate bike id", "bicycle:0", result2.get(0).getId());
// REMOVE_END

// STEP_START query_single_term
// STEP_START query_single_term_limit_fields
Query query3 = new Query("@model:Jigger").returnFields("price");
List < Document > result3 = jedis.ftSearch(
"idx:bicycle", query3).getDocuments();
@@ -264,6 +264,24 @@ public void run() {
assertEquals("Validate bike id", "bicycle:4", result5.get(0).getId());
// REMOVE_END


// STEP_START simple_aggregation
AggregationBuilder ab = new AggregationBuilder("*")
.groupBy("@condition", Reducers.count().as("count"));
AggregationResult ar = jedis.ftAggregate("idx:bicycle", ab);
for (int i = 0; i < ar.getTotalResults(); i++) {
System.out.println(
ar.getRow(i).getString("condition")
+ " - "
+ ar.getRow(i).getString("count"));
}
// Prints:
// refurbished - 1
// used - 5
// new - 4
assertEquals("Validate aggregation results", 3, ar.getTotalResults());
// STEP_END

jedis.close();
}
}