I used fulltext
index in a column in my table.
Here is simple html.
<form>
<input type="text" name='search' placeholder="Enter your search" id="input" onKeyUp="update()" onChange="update()" autocomplete="off" >
<input type="text" style="display: none">
<input type="button" name="tp" id="tr" value="search" >
</form>
I searched in database using ajax. When i just typed a character it fire off the function update() because of onKeyUp
event in search input. But it doesn't fetch any data from the database until I typed a fulltext (meaning like 'hemant' ).
I want to fetch the data when i just type (even a single character), I don't want to use LIKE
keyword to use because it doesn't allow me to search in two or more column and also it doesn't give me nearby words option.
$sql = "SELECT * FROM data WHERE MATCH (name, email) AGAINST ('$search') ";
I also want to know that by using fulltext index. Does it search fast?