I am a QA. This is the software chart:
Search Engine (Apache Solr) <-> Server (expose itself to UI by an API) <-> UI.
The server makes queries on the search engine and send the returned data to the UI. I want to test the correctness of the data, to make sure that the returned values is the expected returned values.
I don't manage the Search Engine. I do have an access for manage the data inside it, and making queries on that Search Engine.
As a tester I can use the server's API.
I see two options:
Implementing the query on my own and make sure its the same results as the results of the developer’s query (which does not make sense in tens of tests and doesn't indicates 100% of correctness.).
Insert specific data to the search enginge and check the retured values from the server or from the UI knowing the desired returned values for query in advance (which seems very fragile because sometimes new data would be inserted for new tests, and the new data may cause a failure to the existing results because of changing the assert's ecpected value).
What is the best practice from those options? I feel like I'm missing something because both of those ways are not perfect, is there a better way for doing this?