Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Commit a411f12

Browse files
author
Clément Le Provost
committed
[offline] Disable preventive offline search by default
1 parent e0bdd76 commit a411f12

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

algoliasearch/src/offline/java/com/algolia/search/saas/MirroredIndex.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@
6767
*
6868
* <h3>Preventive offline searches</h3>
6969
*
70+
* <p>This behavior is optional and disabled by default. It may be enabled by calling
71+
* {@link #setPreventiveOfflineSearch(boolean)}.</p>
72+
7073
* <p>When the index is mirrored, it may launch a "preventive" request to the offline mirror for every online search
7174
* request. <strong>This may result in the completion handler being called twice:</strong> a first time with the
72-
* offline results, and a second time with the online results. This behavior may be turned off by calling
73-
* {@link #setPreventiveOfflineSearch(boolean)}.</p>
75+
* offline results, and a second time with the online results.</p>
7476
*
7577
* <p> To avoid wasting CPU when the network connection is good, the offline request is only launched after a certain
7678
* delay. This delay can be adjusted by calling {@link #setPreventiveOfflineSearchDelay(long)}. The default is
@@ -99,7 +101,7 @@ public class MirroredIndex extends Index
99101
* Whether to launch a preventive offline search for every online search.
100102
* Only valid when the index is mirrored.
101103
*/
102-
private boolean preventiveOfflineSearch = true;
104+
private boolean preventiveOfflineSearch = false;
103105

104106
/** The delay before a preventive offline search is launched. */
105107
private long preventiveOfflineSearchDelay = DEFAULT_PREVENTIVE_OFFLINE_SEARCH_DELAY;

0 commit comments

Comments
 (0)