How to make Quepid talk to your .NET Search API
A hands-on guide to connecting Quepid, the open-source search-relevance judgement tool, to a custom .NET search API that wraps Solr, so a team can run offline relevance experiments against the search their users actually see.
This write-up was first published at opensourceconnections.com. Below is a summary and what we would add today.
Published on the OpenSource Connections blog in May 2022 and co-written with Bego Terzimustafic and Mark Johnson of Emerson Ecologics, this post solves a practical problem: Quepid speaks Solr and Elasticsearch, but many e-commerce teams put a search API full of business logic between the engine and the user. Judging raw Solr results would measure something nobody sees.
What the article covers
The post opens with the case for offline relevance labs: more experiments correlate with better search, offline testing is faster and cheaper than an A/B test, and a lab gives repeatable measurements. Quepid is the sandbox for that, and it is also part of the Chorus reference stack.
The approach is to add an HTTP GET /quepid endpoint to the .NET search API that behaves like Solr from Quepid's point of view. It wraps the existing search logic, forwards extra Solr parameters such as echoParams and debug, and translates the response back into Solr's JSON format, including the JSONP wrapper Quepid expects when json.wrf is supplied. An API key keeps the endpoint from being an open door.
Most of the article is the list of things that went wrong and how they were fixed, with C# samples. Extra Solr parameters are passed through an optional IDictionary so existing callers are unaffected. The dotted json.wrf name needs a JsonProperty annotation. The response has to go back as a plain string with the wrapper applied, or Quepid reports invalid JSON. Quepid sends the query as q while the API expected SearchTerm, so the parameter is mapped explicitly. And because judges need to see product images, image URLs are stitched into each result document before the response is returned.
Along the way the team reported and resolved three Quepid issues: comma handling in CSV queries, a Solr link that replaced wt=json with wt=xml, and making JSONP versus GET configurable.
What I would add today
The integration details have aged, but the principle has not: evaluate the search your users actually experience, business rules and all, not the bare engine underneath. The same thin "evaluation endpoint" pattern now shows up in front of RAG pipelines and agent tools, where the layer between retriever and user is even thicker. And the judging workflow this enabled is exactly what teams adopting vector or hybrid retrieval need first, before they change anything.
Related talks and articles
- External write-up · 22 Mar 2023Building Vector Search in Chorus: a technical deep dive
- Talk · Community Over Code North America 2023 (Apache Software Foundation), Halifax · 7 Oct 2023Transforming Your Search with Cutting-Edge Techniques and LLM Models
- External write-up · 18 Nov 2024Evaluating Retrieval Augmented Generation using RAGAS