Reindex a Soup

Use reindexing if you previously altered a soup without reindexing the data, but later you want to make sure all elements in the soup are properly indexed. Both alterSoup() and reindexSoup() perform better for conversion to, or creation of, JSON1 index specs than for other index spec types.

Hybrid Apps 

In hybrid apps, call:

1navigator.smartstore.reIndexSoup(soupName, listOfPaths, successCallback, errorCallback);

In addition to the success and error callback functions, this function takes these arguments:

Parameter NameArgument Description
soupNameString. Pass in the name of the soup.
listOfPathsArray. List of index paths on which you want to re-index.

The success callback supports a single parameter that contains the soup name. For example:

1function(soupName) { alert("Soup " + soupName +
2    " was successfully re-indexed."); }

Android Apps 

In Android apps, call:

1public void reIndexSoup(String soupName, String[] indexPaths, boolean handleTx)

iOS Apps 

Objective-C:

1- (BOOL) reIndexSoup:(NSString*)soupName
2      withIndexPaths:(NSArray*)indexPaths

In Swift, use the Objective-C method.

We've Moved

Welcome to the new home of the Mobile SDK Developer Guide! For now, the Japanese guide can be found in PDF form.