Note: You are viewing the documentation for Version 4View Version 3 Docs

searchwp\index\tokens_max

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.

Parameters

Type Parameter Default Since
Integer $limit 500 4.0.0

Examples

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

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

How to use this code

Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP