1

I'm using Laravel Scout with TNTSearch Engine at it's working fine but with one little problem. I have the following records.

| ID      | Name     |
+---------+----------+
| 9030100 | Car      |
| 9030150 | Car2     |
| 9030200 | Radio    |

Here is my query:

CatalogProducts::search( $query )->paginate( 15 );

When I'm looking for 'car,' it's returning all records with 'car' in the name.

When I'm looking for '9030100', it's returning the product 'Car.'

But when I'm looking for '9030', I don't have any results. Why? How do I fix it?

Karl Hill
  • 12,937
  • 5
  • 58
  • 95
Damian
  • 525
  • 2
  • 11
  • 24

1 Answers1

0

try changing the fuzziness. set fuzziness to true.

'tntsearch' => [
'storage'  => storage_path(), //place where the index files will be stored
'fuzziness' => true,
'fuzzy' => [
    'prefix_length' => 2,
    'max_expansions' => 50,
    'distance' => 2
],
'asYouType' => false,
Manish Champaneri
  • 654
  • 3
  • 8
  • 28