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

Search should only search for license key or license name #16

Open
Tracked by #58 ...
chinyeungli opened this issue Oct 21, 2021 · 2 comments
Open
Tracked by #58 ...

Search should only search for license key or license name #16

chinyeungli opened this issue Oct 21, 2021 · 2 comments
Labels
good first issue Good for newcomers

Comments

@chinyeungli
Copy link
Contributor

Searching 'mit' in the licensedb returns 307 licenses.
https://scancode-licensedb.aboutcode.org/?search=mit
It is because the search pick up the Copyleft Li"mit"ed in the Category field. However, I think the search should only apply to license_key/license_name, all other fields should not be in the query for the search.

@AyanSinhaMahapatra AyanSinhaMahapatra added the good first issue Good for newcomers label Feb 9, 2023
@mjherzog mjherzog changed the title Search should only search for licesne key or license name Search should only search for license key or license name Feb 9, 2023
@m-g-rathod
Copy link

Hello sir, here's my approach to this issue:

Currently for querying the Datatable in scancode-toolkit\src\licensedcode\templates\license_list.html we have :
table.search().draw() function in js which queries the entire datatable.

For applying search to only first 2 columns i.e. key and short_name columns we can use columns() method and pass the respective column names or indexes as argument in the function like:
table.columns([0,1]).search().draw()
OR
table.columns(column_names or id).search().draw()

I referred to this Link for solving this issue.

Please check and suggest whether my approach to this issue is correct or there's something more to do.

@AyanSinhaMahapatra
Copy link
Member

@m-g-rathod yes that makes sense to me. See also #30 (comment) and follow the conversation there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants