Typesense Laravel Scout: Search – Case Insensitivity and Diacritics Handling

Problem

I’m experiencing difficulties with Vietnamese language search using Typesense and Laravel Scout. The current implementation fails to handle two search scenarios:

1. Case Sensitivity

When searching for xịt chống nắng, I only get exact case matches:

  • ✖️ Current: Returns only xịt chống nắng, Xịt chống nắng
  • ✔️ Expected: Should return lowercase and uppercase as well: xịt chống nắng, Xịt chống nắng, XỊT CHỐNG NẮNG

2. Diacritics Handling

When searching using a non-accented version xit chong nang, no results are returned:

  • ✖️ Current: No matches found
  • ✔️ Expected: Should return xịt chống nắng, Xịt chống nắng, XỊT CHỐNG NẮNG

Example

$results = Product::search('xit chong nang')->get();
// or
$results = Product::search('XỊT CHỐNG NẮNG')->get();

How can I configure Typesense to handle Vietnamese text search with:

  • Case-insensitive matching
  • Diacritics-insensitive search

Are there built-in methods or configurations in Typesense for Vietnamese language normalization, or anything else can handle my issue?