INL / corpus-frontend

BlackLab Frontend, a feature-rich corpus search interface for BlackLab.
16 stars 7 forks source link

Simplifying the options for searches by allowing CQL searches in the default tab and removing "Advanced" and "Expert" #453

Closed stcoats closed 1 year ago

stcoats commented 1 year ago

Hoi!

I would like to be able to enter CQL searches directly into the default search ("Simple"), as has been done by a few of the sites that are using BlackLab, so that both see and [word="see"] have the same results.

This would make the "Expert" tab unnecessary - how can this be hidden? I understand that the "Advanced" tab can be removed with vuexModules.ui.actions.search.advanced.enable(false), but the same syntax does not seem to remove the "Expert" tab.

KCMertens commented 1 year ago

Heya! Sorry to disappoint, but that's not supported at the moment

There's some hardcoded stuff going on with the simple search, think splitting multiple words into multiple [] cql tokens, regex escaping, and adding case-sensitivity modifiers. There's also differences between how selections in a dropdown vs a basic text input vs the n-gram search form is handled, etc. It's somewhere on the list of little nags to take a look at and improve some time, but pretty low prio. I don't expect it will ever happen short of a full rework of the application.

Here's a little summary of how the query is generated in case you're interested:

KCMertens commented 1 year ago

Oh yeah, what you can do is replace the entire simple search widget with a custom input, but unfortunately its output will still be processed in the regular way, i.e. hacked up into words, regex-escaped and surrounced with cql brackets. https://github.com/INL/corpus-frontend#custom-js:~:text=Write%20your%20own%20(annotation)%20search%20fields

stcoats commented 1 year ago

Okay, no worries. Thank you for the additional information -- if I have the time and energy I may dive into the typescript files and take a closer look!