Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ML similarity contextual filter and facets work #459

Open
DiegoPino opened this issue Aug 8, 2024 · 0 comments
Open

Make ML similarity contextual filter and facets work #459

DiegoPino opened this issue Aug 8, 2024 · 0 comments
Assignees
Labels
Drupal Views Ask and you should receive enhancement New feature or request Facets Safely navigating the too many choices Search and Discovery Mess around and find out Search API Sub Modules When you need more .info.yml files to keep life organized
Milestone

Comments

@DiegoPino
Copy link
Member

DiegoPino commented Aug 8, 2024

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.
@DiegoPino DiegoPino added enhancement New feature or request Search and Discovery Mess around and find out Drupal Views Ask and you should receive Facets Safely navigating the too many choices Search API Sub Modules When you need more .info.yml files to keep life organized labels Aug 8, 2024
@DiegoPino DiegoPino added this to the 1.5.0 milestone Aug 8, 2024
@DiegoPino DiegoPino self-assigned this Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Drupal Views Ask and you should receive enhancement New feature or request Facets Safely navigating the too many choices Search and Discovery Mess around and find out Search API Sub Modules When you need more .info.yml files to keep life organized
Projects
None yet
Development

No branches or pull requests

1 participant