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

improved function searching in qgsexpressionbuilder #46672

Closed
wants to merge 2 commits into from

Conversation

roya0045
Copy link
Contributor

@roya0045 roya0045 commented Jan 1, 2022

Thanks to the work by @3nids I expanded upon it in order to also part the helptext, I was also thinking about adding synonyms/aliases but that could be done py improving the helptext.

Description

The helptext are included in the items as a new attribute/column/key.

The filter is split by space and validation is done on each element of the filter. This allows to use multiple partial strings and disregard the order, and still yield good results.

Increasing the number of possible results is a good thing instead of having to guess the proper name of a function and think of the right synonim.

Makes the following possible :
image

@github-actions github-actions bot added this to the 3.24.0 milestone Jan 1, 2022
@roya0045 roya0045 changed the title improved function searching in dialog improved function searching in qgsexpressionbuilder Jan 1, 2022
@uclaros
Copy link
Contributor

uclaros commented Jan 3, 2022

This can result in spammy results. I think it would be better to properly apply tags to all functions. Only string_to_array is tagged at the moment!

@roya0045
Copy link
Contributor Author

roya0045 commented Jan 3, 2022

This can result in spammy results. I think it would be better to properly apply tags to all functions. Only string_to_array is tagged at the moment!

I don't think both approach are exclusive. The difference is that I don't want to write tags for functions. The results could be ranked of the filtering could be tweaked with level of relevancy (1: exact name, 2: name & tags, 3: everything) The used helptext could also be filtered and rendered as a list to speed up search and remove words that are too common to skin down the results.

But in the meantime I think that more reasults lead to discoverability or functions.

But I'll let the others decide and worst case I'll only use it in my custom builds when I create the new one.

@nyalldawson
Copy link
Collaborator

I share @uclaros concern here -- tags would be a better approach to avoid the search results becoming flooded with unhelpful results

@roya0045
Copy link
Contributor Author

roya0045 commented Jan 4, 2022

I share @uclaros concern here -- tags would be a better approach to avoid the search results becoming flooded with unhelpful results

I could add something to the UI to toggle it. Otherwise as it stands the only way is to read them one by one or find them through stackexchange.

@roya0045
Copy link
Contributor Author

roya0045 commented Jan 4, 2022

@uclaros @nyalldawson Another option would be to toggle the extended search when enter is pressed and only return name and tags filter on a 'shallow' search, as this is the case with some search options.

A popup box could appear and simply state 'press enter for more results' or something similar, it's doable and there's plenty of space at the top (see https://doc.qt.io/archives/qt-4.8/qt-network-googlesuggest-example.html , but without the autosearch/list)

@roya0045
Copy link
Contributor Author

roya0045 commented Jan 5, 2022

@uclaros @nyalldawson would you be ok with an extended search when pressing enter? That's a common approach and I still think this approach is validate, especially until the tags are fully implemented (who knows when that will be) and possibly after. I also think others from the community would appreciate it, hence why I'm reluctant to closing it as there can be a good middle-ground.
Worst case scenario, this can be removed down the line if the tags are good and also not too spammy.

@nyalldawson
Copy link
Collaborator

would you be ok with an extended search when pressing enter

No, I'm still -1. That's not a standard QGIS UI paradigm and I don't think it solves the underlying issue.

I'd suggest using the effort instead to make a script to auto-add ALL words from the json help as tags, excluding common words like the/and/etc. Then we could refine the tags from there...

@roya0045
Copy link
Contributor Author

roya0045 commented Jan 6, 2022

would you be ok with an extended search when pressing enter

No, I'm still -1. That's not a standard QGIS UI paradigm and I don't think it solves the underlying issue.

I'd suggest using the effort instead to make a script to auto-add ALL words from the json help as tags, excluding common words like the/and/etc. Then we could refine the tags from there...

I've thought of that, but it's a fine line, that can end up providing the same level of spammy-ness than with this approach. That still leaves the question of synonyms that would be good to have in tags, but making a python script to edit the json is doable. Just not bespoke tags.

roya0045 and others added 2 commits January 6, 2022 09:42
Co-authored-by: Harrissou Sant-anna <delazj@gmail.com>
@roya0045
Copy link
Contributor Author

roya0045 commented Jan 6, 2022

@nyalldawson Proposal tag branch should be up tomorrow, still need to do some minor improvement on the tagger.

@uclaros
Copy link
Contributor

uclaros commented Jan 7, 2022

Just pick your favorite functions and add some useful tags! Then we can open a feature request with a "good first issue" tag.
Also, let's require new functions to have some tags filled in order to merge.

@roya0045
Copy link
Contributor Author

roya0045 commented Jan 7, 2022

@uclaros I fail to see how doing things that way would have any meaningful impact on the user experience.

@roya0045
Copy link
Contributor Author

roya0045 commented Jan 8, 2022

Closing to see if the tag pr will be merged.

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

Successfully merging this pull request may close these issues.

4 participants