| 11 | * The search action will respect the current [wikitr:/Help/Dialog/Filter filters] meaning it wouldn't return any of the filtered objects. |
| 12 | * Colons (`:`) within ''keys'' and ''values'' need to be wrapped with quotation marks (`"`). |
| 13 | * Hover over a keyword in the search hints section to get a explanation and special examples. |
| 14 | * Double click on a preset listed in the search window to add the query to search for objects that match this preset. |
| 15 | |
| 16 | [[Image(Search.png,link=,70%)]] |
| 17 | |
| 18 | == Expert mode ==#ExpertMode |
| 19 | In [wikitr:/Help/ExpertMode expert mode], the following options are added: |
| 20 | * more keywords are listed (they work also in non-expert mode, but are hidden in the dialog) |
| 21 | * **standard/regular expression/MapCSS selector** radio button, see sections below for details |
| 22 | * **all objects** check box to include **''deleted''** and **''incomplete''** objects in the search |
| 23 | * **add toolbar button** see [wikitr:/Help/Action/Search#SavesearchqueryinMaintoolbar save search query in main toolbar] below. |
| 24 | |
| 25 | [[Image(Search_expert.png,link=,70%)]] |
| 26 | |
| 27 | == Examples ==#Examples |
| 29 | * `type:way` selects all ways |
| 30 | * `name:Herrengasse` selects all elements with the given name |
| 31 | * `name=Herrengasse` same as above, but case sensitive |
| 32 | * `"addr:street"="Baker Street"` if special characters (in this case `:` in the key and white space in the value) are used, the key resp. the value needs to be enclosed in `""` |
| 33 | * `tag1=yes tag2=yes` is equivalent to `tag1=yes & tag2=yes` |
| 34 | * `type:way name:-` selects all ways that do not have a name |
| 35 | * `id:123465678` selects an object (way or node) with a particular id |
| 36 | * `timestamp:2010-11-01/2010-12-01` selects object with last change in November 2010 |
| 37 | * `preset:"Craft/Beekeeper"` selects objects that match the beekeeper preset |
| 38 | * See also [wikitr:/Help/Dialog/Filter#Examples Examples] |
11 | | * type:way selects all ways |
12 | | * name:Herrengasse selects all elements with the given name |
13 | | * type:way name:- selects all ways that do not have a name |
14 | | * id:123465678 selects an object (way or node) with a particular id |
| 40 | == Save search query in [wikitr:/Help/MainToolbar main toolbar] ==#SavesearchqueryinMaintoolbar |
| 41 | To ''save search as a button'' if you check **add toolbar button** checkbox, as soon as you click on [[JOSMImage(dialogs/search)]] **Start Search**, a button will be added to the main toolbar. which will execute the defined search expression each time, you press the button. |
16 | | There is also a very under-used and under-documented feature that lets you enter a web URL (file://, http://, https://, ftp://) |
17 | | in the search field. JOSM will then attempt to load that URL, and select any objects that it finds referenced in that file. JOSM will |
18 | | look for XML tags "way", "node", and "relation" in the document, and use their id attribute. This means you can |
19 | | access another OSM file on your hard disk this way and have JOSM select all objects that are present in the file (provided they are present in JOSM's dataset too). |
| 43 | * [[JOSMImage(preferences/toolbar,link=,24,middle)]] [wikitr:/Help/Preferences/Toolbar#Previouslysavedsearchresults Toolbar Customization] will let you modify icon, search query and tooltip. |
| 44 | * As with any button you can always assign a shortcut to it in [[JOSMImage(preferences/shortcuts,link=,24,middle)]] [wikitr:/Help/Preferences/Shortcuts Shortcut Preferences]. |