Skip to content

Instantly share code, notes, and snippets.

@nticaric
Created April 13, 2016 15:37
Show Gist options
  • Save nticaric/bf6ecfd64300ab9af97a7553bd9d4a0a to your computer and use it in GitHub Desktop.
Save nticaric/bf6ecfd64300ab9af97a7553bd9d4a0a to your computer and use it in GitHub Desktop.
<?php
public function search(Request $request)
{
$this->tnt->loadConfig([
"storage" => storage_path(),
"driver" => 'filesystem',
]);
$this->tnt->selectIndex("docs");
$this->tnt->asYouType = true;
$results = $this->tnt->search($request->get('query'), $request->get('params')['hitsPerPage']);
return $this->processResults($results, $request);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment