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

Create proper Keywords MetaField #61

Closed
drn05r opened this issue May 24, 2020 · 2 comments
Closed

Create proper Keywords MetaField #61

drn05r opened this issue May 24, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@drn05r
Copy link
Contributor

drn05r commented May 24, 2020

EPrints has a keywords field but under the hood it is just a Longtext field and therefore searching on keywords is not very reliable. In particular keywords that don't confirm to normal words (e.g. covid-19) or your keywords are multiple word phrases (e.g. "fast forward") would not be looked up in a useful way. If you set to ALL match this probably would not be too bad but ANY match would find potentially tens of times more items than what is really being looked for.

@drn05r drn05r added the enhancement New feature or request label May 24, 2020
@drn05r drn05r added this to the 3.4.2 milestone May 24, 2020
@drn05r drn05r self-assigned this May 24, 2020
@drn05r
Copy link
Contributor Author

drn05r commented May 24, 2020

f3406a9 is my first attempt at trying to produce a Keywords MetaField.

It should improve the sensitivity and particularly specificity of matching multiple word terms.

It should be backwards compatible with EPrints allowing the existing keywords field to be changed form longtext to keywords.

Its database query efficiency is not great. It would be possible to make the query more effiicient in later versions of MySQL/MariaDB but I have not looked into the feasibility for different SQL generation dependent on database version in EPrints.

The way the field works allows you to enter terms separates by a comma (by default but customisable with the separator field attribute) into the keywords field for an item. Then similarly with search enter terms separated by commas (or whatever separator was chosen for the field). The listing terms allows for spaces or not between the separator I(e.g. comma) and the next term. However, due to limits with earlier MySQL versions only one space like this is permitted when adding keywords for an item. Multiple spaces are permitted when entering terms in the search form.

@drn05r
Copy link
Contributor Author

drn05r commented May 30, 2020

I think this sufficiently provides the functionality required of a keywords field from a search perspective. Improvements to allow case-sensitivity to be enabled might be useful.

@drn05r drn05r closed this as completed May 30, 2020
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