Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find way to enable use of implicit hl.fl Parameter #152

Closed
jbaiter opened this issue Apr 19, 2021 · 2 comments
Closed

Find way to enable use of implicit hl.fl Parameter #152

jbaiter opened this issue Apr 19, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@jbaiter
Copy link
Member

jbaiter commented Apr 19, 2021

Currently we have a limitation in how the highlight fields must be configured during querying:

One unfortunate side effect of the way the plugin works is that you need to pass non-OCR fields to be highlighted explicitly via the hl.fl parameter. By default, Solr falls back on highlighting all stored fields if the parameter is not present, which no longer works if this plugin is used.
https://dbmdz.github.io/solr-ocrhighlighting/query/

This seems to be an issue for at least one user:
kitodo/kitodo-presentation#502 (comment)

It would be great if we could find a way to no longer make this necessary.

@jbaiter jbaiter added the enhancement New feature or request label Apr 19, 2021
@jbaiter
Copy link
Member Author

jbaiter commented Apr 19, 2021

I think I found a way, but I'm still struggling to get it to work in the distributed query case. I'm pretty confident that I can get that to work as well, though, might just take a while :-)

jbaiter added a commit that referenced this issue Apr 28, 2021
This was an ugly limitation of the previous version, due to which users
had always explicitely pass a list of 'regular' highlighting fields via
`hl.fl`. A refactoring of the `OcrHighlightComponent` allows us to
remedy this.

The fix is a bit hacky, but it works reliably: When we detect that
highlighting is enabled, but no `hl.fl` parameter was passed (i.e.
the highlighter will automatically highlight all stored fields), we
create a custom explicit `hl.fl` parameter at runtime, that includes all
of the default highlight fields, except for those fields contained in
the `hl.ocr.fl` field set.
jbaiter added a commit that referenced this issue May 10, 2021
This was an ugly limitation of the previous version, due to which users
had always explicitely pass a list of 'regular' highlighting fields via
`hl.fl`. A refactoring of the `OcrHighlightComponent` allows us to
remedy this.

The fix is a bit hacky, but it works reliably: When we detect that
highlighting is enabled, but no `hl.fl` parameter was passed (i.e.
the highlighter will automatically highlight all stored fields), we
create a custom explicit `hl.fl` parameter at runtime, that includes all
of the default highlight fields, except for those fields contained in
the `hl.ocr.fl` field set.
jbaiter added a commit that referenced this issue May 10, 2021
This was an ugly limitation of the previous version, due to which users
had always explicitely pass a list of 'regular' highlighting fields via
`hl.fl`. A refactoring of the `OcrHighlightComponent` allows us to
remedy this.

The fix is a bit hacky, but it works reliably: When we detect that
highlighting is enabled, but no `hl.fl` parameter was passed (i.e.
the highlighter will automatically highlight all stored fields), we
create a custom explicit `hl.fl` parameter at runtime, that includes all
of the default highlight fields, except for those fields contained in
the `hl.ocr.fl` field set.
@jbaiter
Copy link
Member Author

jbaiter commented May 14, 2021

This is now part of the latest stable release 🥳

@jbaiter jbaiter closed this as completed May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant