Take the community feedback survey now.
Take the community feedback survey now.
In your case I would prefer to make the six queries in a single multi-search request.
How about constructing multiple queries in one go? Here's the documentation if you want to check it out: https://docs.developers.optimizely.com/content-management-system/v1.1.0-search-and-navigation/docs/multiple-searches-in-one-request
It depends on your desired performence and results .
if you make 6 little queries and get the results (faster way ).
if you want to make single queries which will give big result (litttle slow then 1st ) but you have the results combined now you have to filter after getting that .
As per me it should be per page a query .
Regards,
Deepak Dubey
I would use the Multi-Search functionality as Stefan and Deepak suggested. I actually use this multi-search functionality with an existing client who needs to show the top 3 results for 16 individual queries. We batch this up into two Multi-Search API calls due to the 10 Queries in one Multi-Query limit.
As you need to perform 6 queries, you will have better performance with Multi-Search because you only have 1 set of latency rather than 6 sets of latency for server to server communications. It will also be more performant because of the amount of data being transmitted between the search server and the CMS. If you go the multi-search route, then you'll only be transmitting 18 results and you will have ALL the results you need. If you used the single query with 1000 items, then that is 1000 items requested from the search api and you may still not get all the results you need to display.
We have a scenario where need to select top 3 results for six different page types post a search.
Performance wise -
a) Is it better to load 1000 results and then filter and sort by each page type and pick the top 3 from each result set.
This approach has a memory impact as we are loading 1000 resuts on every page load.
b) Or is it better to make 6 different queries to get only 3 results from each result set.
This approach makes 6 search requests instead of 1. But only get 18 relevant results