Take the community feedback survey now.

Optimizely Find Search - Decision between making multiple smaller queries or loading 1000 results in one go

Vote:
 

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

 

 

#340168
Sep 01, 2025 9:06
Vote:
 

In your case I would prefer to make the six queries in a single multi-search request.

#340180
Sep 02, 2025 2:18
Vote:
 

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  

#340242
Sep 04, 2025 11:16
Vote:
 

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

#340243
Edited, Sep 04, 2025 12:04
Vote:
 

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.

#340293
Sep 08, 2025 10:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.