Skip to content

Conversation

@andy-stark-redis
Copy link
Contributor

@andy-stark-redis andy-stark-redis commented Aug 15, 2025

Make sure that:

  • You have read the contribution guidelines.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

DOC-5594

Lettuce async and reactive examples for the exact match query page.

@andy-stark-redis andy-stark-redis marked this pull request as ready for review August 15, 2025 13:12
Copy link
Contributor

@a-TODO-rov a-TODO-rov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Json creation can be made shorter

Comment on lines +55 to +154
List<JsonObject> bicycleJsons = Arrays.asList(parser.createJsonObject()
.put("brand", parser.createJsonValue("\"Velorim\"")).put("model", parser.createJsonValue("\"Jigger\""))
.put("description", parser
.createJsonValue("\"Small and powerful, the Jigger is the best ride for the smallest of tikes! "
+ "This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger "
+ "is the vehicle of choice for the rare tenacious little rider raring to go.\""))
.put("price", parser.createJsonValue("270")).put("condition", parser.createJsonValue("\"new\"")),
parser.createJsonObject().put("brand", parser.createJsonValue("\"Bicyk\""))
.put("model", parser.createJsonValue("\"Hillcraft\""))
.put("description",
parser.createJsonValue("\"Kids want to ride with as little weight as possible. Especially "
+ "on an incline! They may be at the age when a 27.5'' wheel bike is just too clumsy coming "
+ "off a 24'' bike. The Hillcraft 26 is just the solution they need!\""))
.put("price", parser.createJsonValue("1200")).put("condition", parser.createJsonValue("\"used\"")),
parser.createJsonObject().put("brand", parser.createJsonValue("\"Nord\""))
.put("model", parser.createJsonValue("\"Chook air 5\""))
.put("description",
parser.createJsonValue("\"The Chook Air 5 gives kids aged six years and older a durable "
+ "and uberlight mountain bike for their first experience on tracks and easy cruising through "
+ "forests and fields. The lower top tube makes it easy to mount and dismount in any "
+ "situation, giving your kids greater safety on the trails.\""))
.put("price", parser.createJsonValue("815")).put("condition", parser.createJsonValue("\"used\"")),
parser.createJsonObject().put("brand", parser.createJsonValue("\"Eva\""))
.put("model", parser.createJsonValue("\"Eva 291\""))
.put("description",
parser.createJsonValue("\"The sister company to Nord, Eva launched in 2005 as the first "
+ "and only women-dedicated bicycle brand. Designed by women for women, allEva bikes "
+ "are optimized for the feminine physique using analytics from a body metrics database. "
+ "If you like 29ers, try the Eva 291. It’s a brand new bike for 2022.. This "
+ "full-suspension, cross-country ride has been designed for velocity. The 291 has "
+ "100mm of front and rear travel, a superlight aluminum frame and fast-rolling "
+ "29-inch wheels. Yippee!\""))
.put("price", parser.createJsonValue("3400")).put("condition", parser.createJsonValue("\"used\"")),
parser.createJsonObject().put("brand", parser.createJsonValue("\"Noka Bikes\""))
.put("model", parser.createJsonValue("\"Kahuna\""))
.put("description",
parser.createJsonValue("\"Whether you want to try your hand at XC racing or are looking "
+ "for a lively trail bike that's just as inspiring on the climbs as it is over rougher "
+ "ground, the Wilder is one heck of a bike built specifically for short women. Both the "
+ "frames and components have been tweaked to include a women’s saddle, different bars "
+ "and unique colourway.\""))
.put("price", parser.createJsonValue("3200")).put("condition", parser.createJsonValue("\"used\"")),
parser.createJsonObject().put("brand", parser.createJsonValue("\"Breakout\""))
.put("model", parser.createJsonValue("\"XBN 2.1 Alloy\""))
.put("description",
parser.createJsonValue("\"The XBN 2.1 Alloy is our entry-level road bike – but that’s "
+ "not to say that it’s a basic machine. With an internal weld aluminium frame, a full "
+ "carbon fork, and the slick-shifting Claris gears from Shimano’s, this is a bike which "
+ "doesn’t break the bank and delivers craved performance.\""))
.put("price", parser.createJsonValue("810")).put("condition", parser.createJsonValue("\"new\"")),
parser.createJsonObject().put("brand", parser.createJsonValue("\"ScramBikes\""))
.put("model", parser.createJsonValue("\"WattBike\""))
.put("description",
parser.createJsonValue("\"The WattBike is the best e-bike for people who still "
+ "feel young at heart. It has a Bafang 1000W mid-drive system and a 48V 17.5AH "
+ "Samsung Lithium-Ion battery, allowing you to ride for more than 60 miles on one "
+ "charge. It’s great for tackling hilly terrain or if you just fancy a more "
+ "leisurely ride. With three working modes, you can choose between E-bike, "
+ "assisted bicycle, and normal bike modes.\""))
.put("price", parser.createJsonValue("2300")).put("condition", parser.createJsonValue("\"new\"")),
parser.createJsonObject().put("brand", parser.createJsonValue("\"Peaknetic\""))
.put("model", parser.createJsonValue("\"Secto\""))
.put("description",
parser.createJsonValue("\"If you struggle with stiff fingers or a kinked neck or "
+ "back after a few minutes on the road, this lightweight, aluminum bike alleviates "
+ "those issues and allows you to enjoy the ride. From the ergonomic grips to the "
+ "lumbar-supporting seat position, the Roll Low-Entry offers incredible comfort. "
+ "The rear-inclined seat tube facilitates stability by allowing you to put a foot "
+ "on the ground to balance at a stop, and the low step-over frame makes it "
+ "accessible for all ability and mobility levels. The saddle is very soft, with "
+ "a wide back to support your hip joints and a cutout in the center to redistribute "
+ "that pressure. Rim brakes deliver satisfactory braking control, and the wide tires "
+ "provide a smooth, stable ride on paved roads and gravel. Rack and fender mounts "
+ "facilitate setting up the Roll Low-Entry as your preferred commuter, and the "
+ "BMX-like handlebar offers space for mounting a flashlight, bell, or phone holder.\""))
.put("price", parser.createJsonValue("430")).put("condition", parser.createJsonValue("\"new\"")),
parser.createJsonObject().put("brand", parser.createJsonValue("\"nHill\""))
.put("model", parser.createJsonValue("\"Summit\""))
.put("description",
parser.createJsonValue("\"This budget mountain bike from nHill performs well both "
+ "on bike paths and on the trail. The fork with 100mm of travel absorbs rough "
+ "terrain. Fat Kenda Booster tires give you grip in corners and on wet trails. "
+ "The Shimano Tourney drivetrain offered enough gears for finding a comfortable "
+ "pace to ride uphill, and the Tektro hydraulic disc brakes break smoothly. "
+ "Whether you want an affordable bike that you can take to work, but also take "
+ "trail in mountains on the weekends or you’re just after a stable, comfortable "
+ "ride for the bike path, the Summit gives a good value for money.\""))
.put("price", parser.createJsonValue("1200")).put("condition", parser.createJsonValue("\"new\"")),
parser.createJsonObject().put("brand", parser.createJsonValue("\"ThrillCycle\""))
.put("model", parser.createJsonValue("\"BikeShind\""))
.put("description",
parser.createJsonValue("\"An artsy, retro-inspired bicycle that’s as "
+ "functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. "
+ "A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn’t "
+ "suggest taking it to the mountains. Fenders protect you from mud, and a rear "
+ "basket lets you transport groceries, flowers and books. The ThrillCycle comes "
+ "with a limited lifetime warranty, so this little guy will last you long "
+ "past graduation.\""))
.put("price", parser.createJsonValue("815"))
.put("condition", parser.createJsonValue("\"refurbished\"")));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many lines of code - distracting from the main purpose of the example:
1.Can use this creation method:

List<JsonValue> bicycleJsons = Arrays.asList(
    parser.createJsonValue("{\"brand\":\"Velorim\",\"model\":\"Jigger\","
        + "\"description\":\"Small and powerful...\","
        + "\"price\":270,\"condition\":\"new\"}"),
    ...
);
  1. Even further - can move the jsons in separate .json files and read from them. Or move them in helper methods.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as async

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants