Modify

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)

josm-fix-case-insensitive-key-value-search.patch (1.4 KB ) - added by avarab@… 15 years ago.
Move variables around to avoid mixing up class/local variables and restore lower-casing of the user-supplied value removed in [2510]

Download all attachments as: .zip

Change History (5)

comment:1 by avarab@…, 15 years ago

Resolution: worksforme
Status: newclosed
Version: latest

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.

comment:2 by stoecker, 15 years ago

Resolution: worksforme
Status: closedreopened

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.

I can't create an testcase for that, but a search for "name:..." in a previous dataset yielded to totally wrong results.

in reply to:  2 comment:3 by avarab@…, 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.

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 avarab@…, 15 years ago

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 stoecker, 15 years ago

Resolution: fixed
Status: reopenedclosed

(In [2636]) fixed #4163 - patch by avar - fixed searching

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.