How to increase the search ranking position of search phrases with short tokens

Full text engines can only work (by default) with tokens which are 3 characters or more.

Our search engine obviously still lets you search for things like ‘m2 ssd’ but then only the ‘ssd’ part would get a relevancy score from the fulltext engine.

In these case, the matching short tokens get given a weight/score which is defaulted to 50. If you find that your short token items that you want on page 1 are not high enough then you can adjust the short token weight.

Edit your wp-config.php (yes, not functions.php!) and add the following line above where it says “that’s all, stop editing!”

define( 'SSS_SHORT_TOKEN_WEIGHT_MULTIPLIER', 100 ); // this is roughly equivalent to what the full text search engine will provide for a matched 3 character token, default is 50

Remember – you can view the weights for each item in your search results by hovering over the Super Speedy Search menu in the black admin bar on your search results page and clicking ‘Show Weights’.

So – if you see that the item you want to be in position 1 for example has a score which is 100 less than the item in position 1, then you’d probably want to set the SSS_SHORT_TOKEN_WEIGHT_MULTIPLIER to at least 150 (i.e. an increase of 100).

Once you have saved your wp-config.php, reload the page and observe the positional change and check similar short token searches to ensure they have good results too.

Be the first to comment and we'll reply right away.

Leave a reply

Super Speedy Plugins
Logo