Prepare the Secret Sauce: In a small bowl, mix together the mayonnaise, ketchup, Dijon mustard, and sweet pickle relish. Set aside.
Cook the Onions: In a skillet, heat the olive oil over medium heat. Add the sliced onions and a pinch of salt. Cook until the onions are caramelized, about 10-15 minutes, stirring occasionally. Remove from the skillet and set aside.
Form the Patties: In a bowl, season the ground beef with salt and pepper. Divide it into four equal portions and shape them into patties.
Cook the Patties: In the same skillet used for the onions, add a bit more oil if needed. Cook the beef patties over medium-high heat for about 4-5 minutes on each side, or until they reach your desired doneness. Add a slice of Swiss cheese on top during the last minute of cooking to melt.
Assemble the Melt: While the cheese is melting, butter one side of each slice of rye bread. On the unbuttered side of two slices, spread a generous amount of the secret sauce. Layer the cheesy patty on top, followed by the caramelized onions, and then top with another slice of bread (buttered side out).
Grill the Sandwich: In the skillet, grill the sandwich on medium heat for about 3-4 minutes on each side, or until golden brown and crispy. Press down gently with a spatula while grilling for even browning.
Serve: Once the patty melt is golden and crispy, remove it from the skillet. Let it sit for a minute, then slice in half and enjoy.
Notes
For extra flavor, use a mix of different cheeses or add some spices to the beef.