Baltimore's Trey Mancini is tagged out at home in the sixth inning by Washington catcher Spencer Kieboom during the Nationals’ 9-7 win over the Orioles. (John McDonnell/The Washington Post)

Searching for answers, for a spark, for anything to boost his offense from its usual malaise, Dave Martinez turned to the oldest page in the manager’s manual Tuesday: He shuffled his lineup. The Washington Nationals skipper moved Juan Soto up to second, swapped Bryce Harper with Anthony Rendon from third to fourth and dropped Trea Turner to sixth.

Years of data suggest lineup configuration has minimal effect on generating runs over a season, but it was time for a change. They needed some crooked numbers. Nine innings later, after knocking around some shaky Baltimore Orioles pitchers, the Nationals emerged with a 9-7 victory — a veritable offensive explosion — to improve to 4-0 against their regional adversaries and to 39-32 on the season.

Washington used 14 hits — some line drives, some bleeders, and some bloopers — to fuel the scoring. Turner headed the charge with four hits, including a home run and a double, and added a couple dazzling plays in the field. Rendon, Adam Eaton and Wilmer Difo each contributed two hits. Soto reached base three times. Even Harper, whose slump has his batting average hovering dangerously close to .200, supplied an RBI double in the fifth inning — the first of Washington’s two four-run frames.

“I don’t think we tore the cover off the ball tonight by any stretch of the imagination,” Eaton said. “But I think we put some balls in play and in some good places, and good things happened.”

The outburst slid rookie Jefry Rodriguez off the hook in his first career start. Making his second appearance, Rodriguez allowed five runs on four hits across five innings in the spot start before the relief corps, which included the Nationals debut of Kelvin Herrera, limited Baltimore to two runs over the final four innings. Acquired in a trade with the Kansas City Royals on Monday, Herrera needed six pitches to get three outs in the eighth inning. He touched 98 mph.

“It’s a nice little toy to have,” Martinez said.

A couple of two-run home runs stung Rodriguez, but he kept the Nationals in the game even as his pitch count rose — something about which his manager expressed concern. Before the outing, Rodriguez slipped into Martinez’s office and was presented a question.

“What’s the best pitch in baseball?” Martinez asked.

“Strike one,” Rodriguez responded.

It’s an answer Rodriguez knew because it’s the answer the Nationals have pounded into his brain. The 6-foot-6 right-hander boasts the raw stuff. But his command remains inconsistent — an issue for a starter who relies almost exclusively on two fastballs that don’t look too different and a curveball.

The stuff fit the bill early Tuesday. His fastball touched 98 mph a couple times in the first two innings and was sitting in the mid-90s. But he had trouble putting batters away before the Orioles (20-51) pounced on his fastball with some success.

First, Caleb Joseph, Baltimore’s No. 8 hitter, smashed a first-pitch fastball for a double to lead off the third inning. Two batters later, after starter David Hess failed to move Joseph with an adequate bunt, Jace Peterson slammed the first pitch he saw — a 95 mph fastball — to the seats in right field.

In the fourth inning, Rodriguez appeared to have struck out Trey Mancini looking at a curveball for the third out, but it was ruled a ball. Two pitches later, Mancini belted another two-run home run.

“He had a lot 2-2, 2-3 counts, made a couple mistakes, but I like what I saw,” Martinez said. “He’s got electric stuff.”

The homer gave Baltimore a 4-1 lead, which appeared to be plenty against a Nationals lineup that has labored to score. Turner’s second-inning home run was the first by a National not named Soto since June 9. That, coincidentally, was the last time Harper had recorded an extra-base hit of any kind before Tuesday. Harper has battled through his cold spells throughout his career, but his recent slump has reached unprecedented lows. Harper entered Tuesday 1 for 26 with three walks, two hit-by-pitches and nine strikeouts in his previous 29 plate appearances. The output dropped his batting average to .212.

It was more of the same for Harper in his first two plate appearances, which both ended with flyouts to left field, but he finally broke through in the fifth inning. After Eaton sneaked a groundball through the left side for a two-run single and Rendon tacked on another run with a sacrifice fly, Harper stepped into the batter’s box with two on and runners on the corners. Facing a 2-2 count, he tucked a 172-foot blooper inside the left-field line and landed at second base with a game-tying double. It was his first hit since Friday and a timely release for a slugger in need of some luck.

“When you’re going good or bad, those balls that trickle through the hole or fall in between people, that mentally boosts how you feel, how you’re playing,” Turner said. “When each and every person has confidence in themselves, it makes all of us better.”

The Orioles responded to take the lead with a run in the sixth inning, but Washington’s second four-run surge in the seventh, fueled by Rendon’s two-run double, put the Nationals comfortably ahead. The manager shuffled his deck and found a winning hand.