Coder Social home page Coder Social logo

Comments (7)

nticaric avatar nticaric commented on September 15, 2024 1

It took me some while but finally we have a fix for this in v1.0.1

from tntsearch.

nticaric avatar nticaric commented on September 15, 2024

A very good observation!! I'm working on a fix for this

from tntsearch.

bbprojectnet avatar bbprojectnet commented on September 15, 2024

Hi,

I think there is still a bug in total_documents counter.

I'm also using tnt with laravel scout, and when i multiple times import all records, total_documents increase everytime (number of records in DB is still the same).

For example, i have users table with 46 records.
First import: total_documents = 46
Second: total_documents = 47
Third: total_documents = 48
...

for another table total_documents increase by dozen for every import.

I think the problem may be in this part of code:

        $this->prepareAndExecuteStatement("DELETE FROM doclist WHERE doc_id = :documentId;", [
            ['key' => ':documentId', 'value' => $documentId]
        ]);

        $res = $this->prepareAndExecuteStatement("DELETE FROM wordlist WHERE num_hits = 0");

        $affected = $res->rowCount();

Shouldn't $affected depend on the first statment? not for second one?

If i fix this in that way:

        $res = $this->prepareAndExecuteStatement("DELETE FROM doclist WHERE doc_id = :documentId;", [
            ['key' => ':documentId', 'value' => $documentId]
        ]);

        $this->prepareAndExecuteStatement("DELETE FROM wordlist WHERE num_hits = 0");

        $affected = $res->rowCount();

it works as expected.

from tntsearch.

nticaric avatar nticaric commented on September 15, 2024

Can you create a PR request please for this

from tntsearch.

bbprojectnet avatar bbprojectnet commented on September 15, 2024

Yes, sure.

But, is the change I proposed correct? I didn't analyze all the code in depth.

from tntsearch.

nticaric avatar nticaric commented on September 15, 2024

Try to run the unit tests and see if all tests pass

from tntsearch.

bbprojectnet avatar bbprojectnet commented on September 15, 2024

Not pass, but also not pass without the fix :\

#269

from tntsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.