bcgov / MFIN-Data-Catalogue

The Finance Data Catalogue enables users to discover data holdings at the BC Ministry of Finance and offers information and functionality that benefits consumers of data for business purposes. The product is built using Drupal and adheres to the Government of BC's Core Administrative and Descriptive etadata Standard.
Other
6 stars 0 forks source link

search results are not accurate #528

Open NicoledeGreef opened 3 months ago

NicoledeGreef commented 3 months ago

Describe the bug

When searches are performed the results are not including text matches in the title of the metadata record.

Expected behaviour

Based on past discussion and this ticket, search results should be taking into account matches found in the title text as well as the description.

Additional context

Example: in Test env there is a record titled "fruitsations test check" https://test.cat.data.fin.gov.bc.ca/fruitsations-test-check

When you search for fruit or fruitstations the record is not returned. If you search for "test check" it is returned because those words also exist in the Description/Summary field.

This was first noticed in Production when searching for bca; the following records are not returned: https://cat.data.fin.gov.bc.ca/bca-residential-property-inventory https://cat.data.fin.gov.bc.ca/bca-commercial-property-inventory

CC: @ChristaBull

danhgov commented 2 months ago

I think I've solved this. In the search settings, it was very mysterious, because everything appeared to be configured correctly, including the "21x boost' that OP had given the title field. I reindexed it several times, and tried adding my own test record, which suffered the same problem as the Fruitsations.

Then I searched the Google, and found this thread, suggesting "Are you using views? Did you add the filed to the list of fields to be searched there?".

And sure enough, we are using views. In our site_search view, there is this:

Image

... inside of which was this: Image I have now unselected "Rendered HTML output" (which I think is the full rendered Node minus the title), such that it now searches "all available fulltext fields".

Et voila! The Fruitsation search, on Test Image

If this seems to work correctly now in your opinion, @NicoledeGreef, I can make the same change directly on the prod server via the UI.

In the meantime, I've submitted a PR with the fix in it: https://github.com/bcgov/MFIN-Data-Catalogue/pull/531

NicoledeGreef commented 2 months ago

Great sleuthing, @danhgov Thanks!

The only thing I noticed was that searching for "fruit", "fruits", and "fruitsa" did not yield the Fruitsations record result. It did show up when I searched for "fruitsat"; does this mean there is a minimum character requirement for matches, I wonder?

danhgov commented 2 months ago

Moving this ticket back from "Done", as the PR is not actually merged yet.

danhgov commented 1 month ago

The PR for this ticket is now merged.

danhgov commented 1 month ago

@NicoledeGreef, this code is on dev/test now.

chrislaick commented 1 month ago

Deployed to PROD.