Opened 15 years ago
Closed 15 years ago
#4163 closed defect (fixed)
[PATCH] [2510] broke key-value search against values which weren't all lower case or values where the user provided an upper-case search string
Reported by: | stoecker | Owned by: | team |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core | Version: | latest |
Keywords: | patch | Cc: |
Description
Search xxx:yyy should search for key xxx with value yyy somewhere in text. This does not work anymore.
Attachments (1)
Change History (5)
comment:1 by , 15 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Version: | → latest |
follow-up: 3 comment:2 by , 15 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
xxx:yyy finds many results, but not the ones I searched for. The search is totally broken. Please don't close reports without really verifying.
- Download http://www.openstreetmap.org/?lat=51.1293&lon=14.1873&zoom=12
- Search for "name:mark" --> Doesn't find e.g. "Altmarkt"
I can't create an testcase for that, but a search for "name:..." in a previous dataset yielded to totally wrong results.
comment:3 by , 15 years ago
Keywords: | patch added |
---|---|
Summary: | Search xxx:yyy does no longer work → [PATCH] [2510] broke key-value search against values which weren't all lower case or values where the user provided an upper-case search string |
Replying to stoecker:
xxx:yyy finds many results, but not the ones I searched for. The search is totally broken. Please don't close reports without really verifying.
- Download http://www.openstreetmap.org/?lat=51.1293&lon=14.1873&zoom=12
- Search for "name:mark" --> Doesn't find e.g. "Altmarkt"
I can't create an testcase for that, but a search for "name:..." in a previous dataset yielded to totally wrong results.
I did test it actually but with the xxx:yyy testcase you provided. However it was really broken and the breakage was initially introduced in I did test it actually, but with the testcase you provided. Anyway it was broken in [2510]. The problem was mixing up class variables so the compiler would check if Altmarkt contained altmarkt instead of checking if altmarkt contained mark.
In addition [2510] removed the lower-casing of the user-provided value so name:MARK wouldn't match name=mark either. That's also fixed by this patch
by , 15 years ago
Attachment: | josm-fix-case-insensitive-key-value-search.patch added |
---|
Move variables around to avoid mixing up class/local variables and restore lower-casing of the user-supplied value removed in [2510]
comment:4 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Yes it does (on r2627). E.g. if you set the tag yes=itdoes on an object and search for yes:doe the search will find the object you just created since it uses str.indexOf(value) != -1.
What doesn't work is searching for es:doe for the above. That's because when you use the colon operator it'll do a hash lookup on the key. Arguably this shouldn't be done since we now have the = operator but previously changing this behavior would have made JOSM search a lot slower for the common case.
If you want to search for es:doe and have it work just tick the "regex search" box.
Or we could just change the behavior of : to loop through all the keys of every object in the dataset and do entry.indexOf(key) != -1 on them. This is essentially what the regex search does.