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

Debugging and adding a failing test. #108

Merged
merged 4 commits into from
Sep 18, 2024

Conversation

THOR300
Copy link
Collaborator

@THOR300 THOR300 commented Sep 17, 2024

Description

This test is just to make it super clear that we are not getting geographies back from vespa (not necessarily looking to merge).

image

Proposed version

Please select the option below that is most relevant from the list below. This
will be used to generate the next tag version name during auto-tagging.

  • Skip auto-tagging
  • [] Patch
  • Minor version
  • Major version

Visit the Semver website to understand the
difference between MAJOR, MINOR, and PATCH versions.

Notes:

  • If none of these options are selected, auto-tagging will fail (integrated soon)
  • Where multiple options are selected, the most senior option ticked will be
    used -- e.g. Major > Minor > Patch
  • If you are selecting the version in the list above using the textbox, make
    sure your selected option is marked [x] with no spaces in between the
    brackets and the x

Type of change

Please select the option(s) below that are most relevant:

  • Bug fix
  • New feature
  • Breaking change

How Has This Been Tested?

Please describe the tests that you added to verify your changes.

Before submitting

  • I've read and followed all steps in the Making a pull request
    section of the CONTRIBUTING docs.
  • I've updated or added any relevant docstrings following the syntax described in the
    Writing docstrings section of the CONTRIBUTING docs.
  • If this PR fixes a bug, I've added a test that will fail without my fix.
  • If this PR adds a new feature, I've added tests that sufficiently cover my new functionality.

@THOR300
Copy link
Collaborator Author

THOR300 commented Sep 18, 2024

Bug

No geographies in search response on staging when using “exact match, region, query”

We have test coverage for this so how did this get through?

  • I’ve added a failing test that mimics this permutation of search filters on the app.
  • The issue comes from the query returning only passage hits and not document hits. Passages seem to be coming back with no geographies field.
    • Why this occurs I’m not sure.
  • I’ve validated locally by stepping through the code that we are getting geographies back for the relevant tests in the backend and cpr_sdk.
    • Geographies is present for these as we do get document hits.

So why does this failing test get no document hits whereas others do?

  • I’m searching for ‘e’ in the test that fails to return document type responses, that text definitely exists in the titles of the documents?

No document type hits = No geographies in response

CPR_SDK
Calling staging:

  • Confirmed that on staging we are getting no hits with geographies present in the vespa_response
    • This means that when we try and create Passage type hits there’s no geographies present.
    • How? By using the sdk with the correct certs and putting in a breakpoint in the code before we post process
  • Confirmed that we are only getting passage and not document hits when calling the staging instance.

Tests:

  • Confirmed that there are no document type hits and no geographies in the response using this test:
    • tests/test_search_adaptors.py::test_vespa_search_response__geographies
  • Confirmed that there are document type hits and geographies present in this test:
    • tests/test_search_adaptors.py::test_vespa_search_adaptor__filters

BACKEND

  • Confirmed that on main in the backend we are getting geographies in results in tests and this is why they are passing.
    • Using this test and adding a breakpoint: tests/search/vespa/test_vespa_search.py::test_metadata_filter

Potential Fixes:

Two options:

  1. Get geographies back for all query behaviour

This is confusing as it should be a join on the family!

  • Adding geographies to the document_passage summary does not fix this either!
  1. Try and understand why some query behaviour only returns passages and change it to always return geographies.

We spotted issues inf iltering that have turned out to originate from
these being missing. Essentially the yql was skipping searching passages
because these fields where not there. So in the case of an exact match
query, we give it an impossible task of searching for text blocks, which
are passage specific AND for geographies which are document specific.

The issue seems to have been there on other queries but was masked by
the way the other queries balance other items being searched.
This returned no hits previously. We missed it because the for loop never
got to any asserts.
@olaughter olaughter force-pushed the bugfix/no-geographies-with-exact-match branch from c3efb41 to f76263f Compare September 18, 2024 10:47
@olaughter olaughter marked this pull request as ready for review September 18, 2024 10:50
@olaughter olaughter requested a review from a team as a code owner September 18, 2024 10:50
Copy link
Contributor

@jesse-c jesse-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Took me a second to appreciate the asserts in the test. 😅

@olaughter olaughter merged commit a63fb00 into main Sep 18, 2024
6 checks passed
@olaughter olaughter deleted the bugfix/no-geographies-with-exact-match branch September 18, 2024 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants