I want to just search on 2000 records only
@Sonu I don’t understand this. Which particular 2000 records…?
I want to know that there is any way to limit the search query.
Actually i have 10 Lakh records in Db. For example if a user search chicken then its search from all data base and generate the pagination. so its generate alot of pages.
I want to just search on 2000 records only. How can i do that. Here is my search function
$input = trim(Input::get('diet_search'));
$exp = explode(' ', $input);
$s = '';
$c = 1;
foreach ($exp AS $e)
{
$s .= "+$e*";
if ($c + 1 == count($exp))
$s .= ' ';
$c++;
}
$query = "MATCH (diet_name) AGAINST ('$s' IN BOOLEAN MODE)";
$result = Diets::whereRaw($query)->paginate(10);
return view('Front.my_health.health')->with('result',$result);
Please or to participate in this conversation.