Since: 4.0.0

Table of Contents

By default SearchWP will generate tokens in batches of 500 maximum. If you feel your server is capable of doing more than that, increasing this limit may improve performance of the indexing process.

This hook can also be used to reduce the number of tokens generated per patch in case you are having trouble with the indexing process.


Type Parameter Default Since
Integer $limit 500 4.0.0


All hooks should be added to your custom SearchWP Customizations Plugin.

Reduce the batch size for token generation

To reduce (scale back) the generation of tokens during indexing

// Reduce SearchWP's batch size for token generation.
add_filter( 'searchwp\index\tokens_max', function( $limit ) {
return 200;
} );

How to use this code