Giter VIP home page Giter VIP logo

Comments (7)

karakhanyans avatar karakhanyans commented on May 27, 2024

Hi @CaReS0107

Thanks for reporting this issue, we will prioritise it and solve.

from laravel-scout-typesense-driver.

karakhanyans avatar karakhanyans commented on May 27, 2024

Hi @CaReS0107

When you use $model->delete(...) the model events are not triggering, that's why unsearchable is not working.
To avoid this, you should select the model first, like $model = Model::find($id); and then $model->delete(); in that case, events are getting fired and all works.

Let me know if you have any further questions.

from laravel-scout-typesense-driver.

CaReS0107 avatar CaReS0107 commented on May 27, 2024

Hey, @karakhanyans from my tests I was trying find ()->delete(), also $model->delete(), $model->forceDelete(), for all these cases I fell in the delete event.
In the end, I install typesense/typesense-php package and in my observer delete method. I call their method for deleting

$client->collections[(new MediaSource())->searchableAs()]
    ->documents[$this->mediaSourceId]
    ->delete();      

and all good now. But definitely will be best to use $model-> unsearchable()

from laravel-scout-typesense-driver.

karakhanyans avatar karakhanyans commented on May 27, 2024

@CaReS0107 as I understood, you are using typesense-php package in the laravel project, instead of using scout-typesense-driver, am I right?

from laravel-scout-typesense-driver.

CaReS0107 avatar CaReS0107 commented on May 27, 2024

@karakhanyans I use them both, from typesense/typesense-php I used only the delete method

from laravel-scout-typesense-driver.

karakhanyans avatar karakhanyans commented on May 27, 2024

@CaReS0107 is there any other way we can assist you here in this topic?

from laravel-scout-typesense-driver.

karakhanyans avatar karakhanyans commented on May 27, 2024

The issue has been solved. Closing the PR.

from laravel-scout-typesense-driver.

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.