# 22. Implement Android search service (FTS)

meta:
  id: native-business-logic-migration-22
  feature: native-business-logic-migration
  priority: P1
  depends_on: [native-business-logic-migration-16]
  tags: [implementation, android, search]

objective:
- Implement full-text search service using Room FTS

deliverables:
- SearchService.kt
- SearchQuery.kt
- SearchResultProvider.kt
- FTS index management
- Search history storage

tests:
- Unit: Test query parsing
- Unit: Test FTS queries
- Unit: Test result ranking
- Integration: Test search with real data

acceptance_criteria:
- Full-text search working
- Search history maintained
- Results ranked by relevance
- Performance: <200ms for search
- Fuzzy matching supported

validation:
- Run `./gradlew test`
- Test with large dataset

notes:
- Use Room FTS5
- Implement search suggestions
- Cache frequent queries
