UUDigitalHumanitieslab / I-analyzer

The great textmining tool that obviates all others
https://ianalyzer.hum.uu.nl
MIT License
6 stars 2 forks source link

Bugfix/compare queries (incomplete) #1602

Open lukavdplas opened 3 weeks ago

lukavdplas commented 3 weeks ago

@JeltevanBoheemen / @Meesch in case one of you picks up #1564 / #1563 / #1562 / #1561, my work in this branch may be of use.

Since there are several bugs surrounding the query comparison function, I started some work on refactoring it (instead of patching the specific errors). At present, query comparison is based on the ParamSync class, which is deprecated; this implements a ComparedQueries model that is based on StoreSync instead.

Notes for development

Currently (as in, on the main branch), the routes for compared queries always repeat the original query as a compared term. (See the linked issues for some examples of urls). As I describe in the issues, counting the original query as a "compared term" can invite unpredictable behaviour (e.g., what should happen if the user deletes that term from the comparison).

I also ran into the issue that routes will currently contain multiple compareTerm parameters (one for each term). However, the RouterStoreService does not support multiple query parameters with the same key. It should be possible to change this, but I did not (yet) do so.

Because of these two issues, the branch breaks the format for URLs; e.g. this URL:

https://ianalyzer.hum.uu.nl/search/dbnl?query=woord&visualize=resultscount&visualizedField=periodical&compareTerm=woord&compareTerm=zin&compareTerm=paragraaf

would now be formatted as

https://ianalyzer.hum.uu.nl/search/dbnl?query=woord&visualize=resultscount&visualizedField=periodical&compareTerms=zin,paragraaf

(Note: comma-separation in the URL is safe here, since typing a comma in the input field will break up the query. So compared queries cannot contain commas.)

To do: