How to make an ajax search by exact phrase/word / full value?

I currently have this

jQuery.ajax({
    url: '<?php echo admin_url('admin-ajax.php'); ?>',
    type: 'post',
    data: { action: 'data_fetch', words:  jQuery('#usp-title').val() }...

But that will search for any matching word within the jQuery('#usp-title').val()

I need to search fro the exact final phrase/word/full value within that.

Tried the following but it still searching for any words

mytext = jQuery('#usp-title').val();
jQuery.ajax({
    url: '<?php echo admin_url('admin-ajax.php'); ?>',
    type: 'post',
    data: { action: 'data_fetch', exactwords:  mytext },

Read more here: How to make an ajax search by exact phrase/word / full value?

Leave a Reply

Your email address will not be published. Required fields are marked *