Closed JBennett-WQA closed 3 months ago
^^ Giving this a bump. Otherwise will ask in the main tnt branch
I'm curious. What was wrong?
I know this is old but I didn't want to start a new issue for something so similar.
I'm also finding the results weird. For instance searching for "Mar" returns people called "Matt" before "Marc"
Search with Marc:
Even worse "Rob Hec" returns "James Heyes" before "Robert Heckham" which I can't fathom at all.
"Robert Heckman" should definitely be at the top here
I can't find any information on sorting or how to improve it.
is it still?
Yeah, still facing.
Is it because of any incorrect configuration?
My current set config,
'tntsearch' => [
'storage' => getFileStorePath() . DIRECTORY_SEPARATOR . "TNT",
'fuzziness' => true,
'fuzzy' => [
'prefix_length' => 3,
'max_expansions' => 100,
'distance' => 2
],
'asYouType' => true,
'searchBoolean' => false,
],
My toSearchableArray return,
return array(
'name' => $this->name,
'id' => $this->id,
'category' => $this->category->name ?? '',
);
@nikhilbhatia22 Try to true the boolean search, set the "as you type" to false, and in .env make "fuzzines" auto.
And trym
@MostafaRabia what you mean with and in .env make "fuzzines" auto
? I think it can be true or false.
@thewebartisan7 I saw here one tima i can't remember that you can set it to "auto" and it's best value.
I check code and there is not anything that check agains "auto"
See https://github.com/teamtnt/tntsearch/blob/master/src/TNTSearch.php#L317 and https://github.com/teamtnt/tntsearch/blob/master/src/TNTSearch.php#L250
Seem only in this two place it's used
@thewebartisan7 you are right, thank you, i'm sorry but i searched and get it on elasticsearch not tntsearch: https://qbox.io/blog/elasticsearch-optimization-fuzziness-performance "AUTO should generally be the preferred value for fuzziness."
very thanks to you.
Hi all,
Really like the package but getting some really confusing results that i cannot understand. I'm essentially trying to implement something as simple as
like '%query%
Current config:
For this example i'm using one model with the searchable array set as:
I have used the
tntsearch:import
command to import all of my indexes.If i search for
anx
then i get two models returned from the search:Anxious
andAnxious Or Worried
.If i search in this table for
name like '%anx%
i get 11 results, one of which is a record with a name ofAnxiety
. I've played around with fuzzy search and togglingasYouType
andsearchBoolean
. I've also cleared all config and cache after every change.Even more confusing is that searching
anxie
returnsAnxious
andAnxious Or Worried
but notAnxiety
. I have to searchanxiet
to return anything withAnxiety
in it's name.I have cleared
storage/
of all index files manually to try and rule out any cache issue, but still nothing.Any ideas?