Why do project search results match on field description?

In order to make the Discord bot’s iNat search results comprehensible, I’m trying to understand why certain search results match when the reason for the match is not evident from anything displayed. So, for example, if you do a project source search (via /search on the website, or /v1/search API) for “carp”, the first page of results includes this entry for Istmo Salvaje project:

I at first supposed that “carp” matched somewhere in the description, but the excerpt for the match didn’t show it for some reason. However, what I found instead when I clicked on the project is that there are terms that aren’t shown on the project page that could be matched in a search. In this case, it appears to be matching on “carpelos” from the “Flores” project field description:

        "project_observation_fields": [
...
          {
            "id": 12130,
            "required": false,
            "observation_field": {
              "id": 4722,
              "name": "Flores",
              "name_autocomplete": "Flores",
              "description": "Caliz, corola, androceo, gineceo, número de pétalos, sépalos, estambres, carpelos, color, libres o soldados, fruto,...",
              "description_autocomplete": "Caliz, corola, androceo, gineceo, número de pétalos, sépalos, estambres, carpelos, color, libres o soldados, fruto,...",
              "datatype": "text",
              "allowed_values": "",
              "values_count": 57,
              "users_count": 30
            },
            "position": 1
          },

I have no quibble with it possibly needing to matching this for some reason, but if it’s by design, shouldn’t the preview text match the project field? For that matter, if it’s important enough to match in a search, shouldn’t the project page itself also show its observation fields so that users can understand the matching result in context when they land on that page from a search?

Or if it’s not by design, perhaps observation field descriptions shouldn’t be included in the terms searched.

My goal is not necessarily to have the iNat developers make changes to how this works, but simply to explain how it works. Then I can proceed with ensuring our bot users can understand why certain search results are shown. For example, if I need to explain in the help that “project observation fields can match, and may not be shown”, that is an acceptable outcome. But I don’t want to document unintended behaviours if this isn’t supposed to be happening (in which case this post may belong in Bug Reports instead).

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.