@extends('layouts.app') @section('content')

Search Documents

Search by filename, OCR text, or category
{!! Form::open(['method' => 'GET', 'route' => 'admin.search.index']) !!}
{!! Form::text('q', $term, ['class' => 'form-control', 'placeholder' => 'Search text, filename, category...']) !!}
{!! Form::select('category_id', ['' => 'All categories'] + $categories->toArray(), $categoryId, ['class' => 'form-control']) !!}
{!! Form::select('status', ['' => 'Any status'] + $statuses, $status, ['class' => 'form-control']) !!}
{!! Form::submit('Search', ['class' => 'btn btn-primary btn-block']) !!}
{!! Form::close() !!}
{{ $files->count() }} result(s)
@forelse($files as $file) @empty @endforelse
Filename Folder Category Status Matched text  
{{ $file->getMedia('filename')->first()->name ?? $file->uuid }} {{ $file->folder->name ?? '' }} {{ $file->category->name ?? '—' }} {{ $file->statusLabel() }} @if($term && $file->ocr_text && stripos($file->ocr_text, $term) !== false) @php $pos = max(0, stripos($file->ocr_text, $term) - 40); $snippet = substr($file->ocr_text, $pos, 140); @endphp …{{ $snippet }}… @endif View
No matching documents.
@stop