usdigitalresponse / usdr-gost

USDR-hosted grants management tools
http://grants.usdigitalresponse.org
Apache License 2.0
30 stars 21 forks source link

Exclude keyword not working #2061

Open ClaireValdivia opened 11 months ago

ClaireValdivia commented 11 months ago

Why is this issue important?

reported by Madi Rogers

Current State

To reproduce:

Results include grants with the word clinical. This does not seem case sensitive (have tried excluding clinical and Clinical)

Additional Notes: it seems like exclude keywords isn't working for keywords that are within parentheses. These are other searches that don't properly exclude the keywords:

Include: innovation; Exclude: trials; Opportunity Statuses: posted

Include: innovation; Exclude: U2C; Opportunity Statuses: posted

Expected State

grants should not return if they include words on the exclude list

Implementation Plan

The following functions need to be added...

Relevant Code Snippets

No response

replicantSocks commented 11 months ago

The parentheses turned out to be a red herring. In the current state, if the query is matches a row for either the title or the description of the grant, it will be returned. For example, if we search to include 'A' and exclude 'B'. If the title of a grant only contains 'A' but not 'B' that's sufficient for it to be returned even if 'B' is included in the description. For the above, even though 'clinical' appears in the title, it doesn't appear in the description, but 'innovative' occurs in the description and therefore that grant is included.