teamtnt / tntsearch

A fully featured full text search engine written in PHP
https://tnt.studio/solving-the-search-problem-with-laravel-and-tntsearch
MIT License
3.09k stars 292 forks source link

Result not matched #277

Open jatinbphp opened 1 year ago

jatinbphp commented 1 year ago

I have created index file with one of my database table. Than I am searching with one sentence in that index. But result is not giving exact matched with title or in body. Below is my search code which I am using. $tnt->selectIndex("body.index"); $res = $tnt->search($search, 5); $ids = $res['ids'];

Hear for example if i pass "How are you" in $search variable, it not give me result with exact matched title field in database.

I created index file of all fields of database table.

Please kindly help in this.

stokic commented 1 year ago

Without knowing your data and your settings we could only guess…

On Wed, 18 Jan 2023 at 14:56, Jatin Bhatt @.***> wrote:

I have created index file with one of my database table. Than I am searching with one sentence in that index. But result is not giving exact matched with title or in body. Below is my search code which I am using. $tnt->selectIndex("body.index"); $res = $tnt->search($search, 5); $ids = $res['ids'];

Hear for example if i pass "How are you" in $search variable, it not give me result with exact matched title field in database.

I created index file of all fields of database table.

Please kindly help in this.

— Reply to this email directly, view it on GitHub https://github.com/teamtnt/tntsearch/issues/277, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMGWRBWMEK6IMVAW2ZICLWS7ZCTANCNFSM6AAAAAAT7DV2CU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jatinbphp commented 1 year ago

Thanks for quick reply. below is screenshot of my table which for which I created index. localhost _ localhost _ sentinelone _ top_article_gpt _ phpMyAdmin 4 9 5deb2

For settings : I first create index with below code. $indexer = $tnt->createIndex('body.index'); $indexer->query('SELECT * FROM top_article_gpt');t $indexer->run();

Than I am searching in that index with below code.

$tnt->selectIndex("body.index"); $res = $tnt->search($search, 5);

Issue is I am not getting Ids of correct articles. Suppose i search "Incorrect SentinelOne version number listed at registry", I am not getting that search result, while it should be first id as it exact match title field. Hope it is more clear now. Thanks in advance.

stokic commented 1 year ago

and what are your tntsearch settings?

On Wed, Jan 18, 2023 at 3:25 PM Jatin Bhatt @.***> wrote:

Thanks for quick reply. below is screenshot of my table which for which I created index. [image: localhost localhost sentinelone _ top_articlegpt phpMyAdmin 4 9 5deb2] https://user-images.githubusercontent.com/17172695/213195880-632d613b-f953-47fd-bfc6-b8d733df5dc5.png

For settings : I first create index with below code. $indexer = $tnt->createIndex('body.index'); $indexer->query('SELECT * FROM top_article_gpt');t $indexer->run();

Than I am searching in that index with below code.

$tnt->selectIndex("body.index"); $res = $tnt->search($search, 5);

Issue is I am not getting Ids of correct articles. Suppose i search "Incorrect SentinelOne version number listed at registry", I am not getting that search result, while it should be first id as it exact match title field. Hope it is more clear now. Thanks in advance.

— Reply to this email directly, view it on GitHub https://github.com/teamtnt/tntsearch/issues/277#issuecomment-1387159135, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMGWSOD2LNDPJT4ACKMADWS74N7ANCNFSM6AAAAAAT7DV2CU . You are receiving this because you commented.Message ID: @.***>

somegooser commented 1 year ago

What happens when you search on "incorrect number listed" ? or "incorrect sentinel one". See the space between sentinel and one.

jatinbphp commented 1 year ago

incorrect number listed

Not sure regarding which setting you are talking.

Below is my configuration.

$tnt->loadConfig([ 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'database', 'username' => 'username', 'password' => 'password', 'storage' => '/var/www/html/s1sp/storage', 'stemmer' => \TeamTNT\TNTSearch\Stemmer\PorterStemmer::class, //optional ]);

jatinbphp commented 1 year ago

incorrect sentinel one

I searched, but it is not showing correct article.