Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Dataset name text filtering #485

Merged
merged 6 commits into from
Feb 5, 2018
Merged

Conversation

matthewma7
Copy link

2018-01-30_15-08-33

@matthewma7 matthewma7 changed the base branch from master to draw_boundary_dataset_and_boundary_filtering January 30, 2018 20:35
@matthewma7 matthewma7 changed the base branch from draw_boundary_dataset_and_boundary_filtering to master February 2, 2018 13:54
var regex = new RegExp(keyword, 'i');
match = !!regex.exec(dataset.get('name'));
} catch (ex) {
match = dataset.get('name').toLocaleLowerCase().indexOf(keyword) !== -1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend moving this below of the catch as match |= dataset.get('name').toLocaleLowerCase().indexOf(keyword) !== -1;. Otherwise, if I have a dataset called "foo.bar" and search for "foo.b", it won't be found (because as a regex that doesn't match), which would be surprising to a user.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clearer:

                    var match = false;
                    try {
                        var regex = new RegExp(keyword, 'i');
                        match = !!regex.exec(dataset.get('name'));
                    } catch (ex) {}
                    match |= dataset.get('name').toLocaleLowerCase().indexOf(keyword) !== -1;
                    if (match) {
                        ids.push(dataset.get('_id'));
                    }
                    return ids;

@aashish24
Copy link
Contributor

@matthewma7 @manthey as discussed in the meeting, we would like to extend it to search through the metadata as well. Are we planning on doing that in this branch or another one?

@matthewma7
Copy link
Author

@aashish24 I personally is thinking to do it in another PR because we kind want this to release soon, and I also have a concern that searching meta may end up with too many records, so some mechanism to indicate might be needed (a checkbox, a sorted result, etc)

@aashish24
Copy link
Contributor

@aashish24 I personally is thinking to do it in another PR because we kind want this to release soon, and I also have a concern that searching meta may end up with too many records, so some mechanism to indicate might be needed (a checkbox, a sorted result, etc)

Sounds good. We should start tagging releases (thoughts?)

@aashish24
Copy link
Contributor

@matthewma7 @manthey how do we enable coverage reporting on PR's?

@manthey
Copy link
Member

manthey commented Feb 5, 2018

Girder changed where coverage files are stored. I just made PR #487 to fix the reporting.

@@ -336,6 +336,7 @@ const MapPanel = Panel.extend({
layer.removeAllAnnotations();
}
});
prompt.find('.bootbox-body input').attr('maxlength', '30');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why 30? I know wiredTiger supports up to 1023 bytes "including structural overhead"; probably half that would be pretty safe.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be wrong. I was thinking other characters from other language takes more bytes than English letters, so I choose it to make it safe. But if 30 is too limiting, I think we change it to a bigger number. (A failed creating boundary is not that devastating)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure -- I think wiredTiger uses UTF-8, which would mean that in theory a codepoint could take 6 bytes, but in practice 4 is sufficient. How about we make it 250? It is large enough most people shouldn't have an issue and small enough Mongo shouldn't have an issue. I only discovered this because I intentionally paste absurd data into forms.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. New commit pushed.

@matthewma7 matthewma7 merged commit 4cac672 into master Feb 5, 2018
@matthewma7 matthewma7 deleted the dataset_name_text_filtering branch February 5, 2018 19:31
@matthewma7
Copy link
Author

@manthey Thank you for the review all the edge case you found.

@manthey
Copy link
Member

manthey commented Feb 5, 2018

👍

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

Successfully merging this pull request may close these issues.

None yet

3 participants