jessecoleman / nsf-viz

visualization of nsf data as bar charts with search
3 stars 0 forks source link

Multiple term highliting for abstracts is buggy #26

Open h1-the-swan opened 2 years ago

h1-the-swan commented 2 years ago

With multiple terms selected, the abstracts are usually only returned with one of the terms highlighted. It looks like the API request is not being formed correctly, e.g.:

backend_1 | INFO: 192.168.240.5:36304 - "GET /data/abstract/bgv24XwB-7TEBFm4FKRs/?terms=cancer&terms=hpv HTTP/1.0" 200 OK

I think maybe the query parameter should instead look something like: ?terms=cancer|hpv

Also, I think we should discuss how "selected" terms are working, and what it means for a term to be "selected". For example, if the "All" option is selected, can you still deselect some of the displayed terms? What does it mean if none of the terms is selected?

jessecoleman commented 2 years ago

Yeah, it does look like the terms argument is wrong. I'm using https://www.npmjs.com/package/query-string for the endpoint serialization, and it has a couple different settings for handling array types. So it's probably a one-liner fix.

Current behavior is that the "all" option only considers the subset of selected terms, and no terms are selected is equivalent to all terms being selected. It's supposed to be a quick way to adjust the query without losing your term set.

h1-the-swan commented 2 years ago

What indicates whether a term is selected or not?

jessecoleman commented 2 years ago

A term is selected if it's highlighted (purple) in the term list. You can click on a term to select it.