package com.example.myapplication.service;

import android.content.Context;
import android.content.SharedPreferences;

public class SearchService {
    public static void saveKeyword(Context ctx, String keyword) {
        SharedPreferences prefs = ctx.getSharedPreferences("app_prefs", Context.MODE_PRIVATE);
        prefs.edit().putString("searchKeyword", keyword).apply();
    }

    public static java.util.List<com.example.myapplication.domain.Note> search(Context ctx, String query) {
        com.example.myapplication.repository.NoteRepository repo = new com.example.myapplication.repository.NoteRepository(ctx);
        return repo.findNotesByKeywords(query, null);
    }
}