If having a Configure element, react-instantsearch will trigger a request when mouting, depsite we don't do any thing with search feature yet.
<InstantSearch appId={appId} apiKey={apiKey} indexName={indexName}>
<Configure {...configureAlgolia()} />
</InstantSearch>
Do you want to request a feature or report a bug?
Bug
Bug: What is the current behavior?
A redundant request

Bug: What is the expected behavior?
Should not have
Bug: What browsers are impacted? Which versions?
Chrome 60
What is the version you are using? Always use the latest one before opening a bug issue.
4.1.1
Hi @vinhlh,
As for now there's no API to disable the first query but that's something on the RIS backlog to consider.
I'd prefer to go for this kind of API than coding a particular use-case. (ie: when only Configure type widget, do not search). But let's discuss about it!
@mthuret Also came here to report the same issue. Is there a way to disable that extra search query (unless it is needed by the widget)? Or is that the API you were thinking of adding?
FWIW, apart from extra operation, it makes debugging initially confusing and complicates logic. One can't rely on hits being empty when there is no search query (when using withAutoComplete).
@oyeanuj, in most search UIs you'll want the first launch to have the results for an empty query, which can be used for browsing. In autocomplete cases you can show or hide the results based on how long the query is.
The API Marie was thinking of was indeed something to prevent a search request from firing on a condition that you decide.
In practice this one extra request shouldn't affect you too much, since in the worst case, it'll simply warm up your DNS cache for the real requests
@Haroenv Got it, thanks for the context.
Most helpful comment
Hi @vinhlh,
As for now there's no API to disable the first query but that's something on the RIS backlog to consider.
I'd prefer to go for this kind of API than coding a particular use-case. (ie: when only Configure type widget, do not search). But let's discuss about it!