-
Notifications
You must be signed in to change notification settings - Fork 10
Description
What?
Facts: we refresh the View on a passed encoded Image + Node + File and fetch a vector from the NLP. We alter the query, we get the similarity results. This all happens via Ajax. We refresh the View and we refresh the Facets. Because these are different HTTP requests the facets don't have the results object anymore available, so they re-query (I dislike this a lot, so inefficient ..) and call the View again.
The view, if not cached, will re-query, but the original Contextual filter is no longer present in the request (bc we are filtering/making sure the requests are only done via Ajax/not public, etc) so the facets run without the KNN filter and that means in fact we always get the same facets back. As if KNN would have never run
Options we have:
- If Ajax enabled for the View we can "remember" in a session the Contextual filter parameters. ideally already the vector, so we do less backend processing. This is possible since All this ML tricks really can only run for logged in users.
- Then on re-query we fetch the session. I can here check if the request was done via AJAX. so a "reload" of the page will never use the session. Good
- We need to be sure we actually clear the session on RESET.