azure-search-openai-demo
azure-search-openai-demo copied to clipboard
Return All Relevant Documents
Please provide us with the following information:
This issue is for a: (mark with an x)
- [ ] bug report -> please search issues before submitting
- [x ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
OS and Version?
Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
azd version?
run
azd versionand copy paste here.
Versions
Mention any other details that might be useful
I am looking for guidance on how to integrate something like a "Search" tab into the web application that would return a list of all documents that match a given search query (or all that meet a certain threshold if using vector search) and provide similar links and previews as in the chat app. The use case we have in mind is the user uses the chat app to find some information, but then wants to be able to query the index and find all relevant documents (without sending them off to the GPT model) to review for additional information that may be relevant not contained in the "best" 3 or 5 matches used for RAG.
Thanks! We'll be in touch soon.
You would add a new route in app.py, and that new route would just call the search() method of the SearchClient with the user's query and return the documents. You'd also need to add a new frontend path and component that calls that route. Let me know if there's something in particular you're looking for guidance on.
I am a beginner at this sort of stuff, so don't have any specific guidance I need, but this is really helpful to get a better sense of how the components work together. At a high level then:
- I need to update app.py with a new search route
- In the api.ts file, create a searchApi that can be called from the Search page I create. This API call would direct requests from the search page to the search route.
- create a new "search" page in the frontend folder, mimicking what is there for "ask" and "chat" with but modified to call the searchAPI and format results as I would like.
I think that gives me enough to try to piece something together though. I'll reach out though if I hit any specific roadblocks. Thank you for time and help.
Yep, that sounds like a good start!