Algolia with two input: AroundLatLng and Phrases/Words

I’m using Algolia with Laravel for my engine search. I have two input fields:

  1. ‘Where input’ principal search AroundLatLng
  2. ‘What input’ using ‘faceFilters’ for search words or phrases

My problem is that the second input with ‘FacetFilter’ only works with exact match.

There is an alternative way for have a ‘%LIKE%’ search on second input?

This is my code:

$shops = Shop::search('', function ($algolia, $query, $options) use ($lat, $lng, $radius) //query is empty for enable AroundLatLng
    {
        $custom = [
            'aroundLatLng' => $lat.','.$lng,
            'aroundRadius' => $radius * 1000,
            'getRankingInfo' => true
        ];

        $options = array_merge($options, $custom);
        $algolia_search = $algolia->search($query, $options);
        $results = collect($algolia_search);
        return $algolia_search;

    })->with([
        'filters' => 'status = 1',
        'facetFilters' => [
                ["name:$this->searchByWords" , "services:$this->searchByWords"] //theese works only with perfect match!
        ],
        'typoTolerance' => true,  //this works only with main query
        'minWordSizefor1Typo' => 4, //this works only with main query
        'minWordSizefor2Typos' => 6, //this works only with main query
        'ignorePlurals' => true, //this works only with main query
        'removeStopWords' => true //this works only with main query
    ])->paginate(10)
      ->appends('query', null);

return view('frontend.pages.shops.results', ['shops' => $shops]);

thanks!

Hi @cloude, facetFilters only work with exact matches.

I solved using main query with words/phrases and aroundLatLng like custom option.