You are here: Running solutions in production > The Monitor > Searching

Searching

 

In the MDLink Monitor, using the "Search query" text field near the top of the window, you can perform searches in any one of the History Log, Input Queue, or Output Messages tabs. Search does not apply to the Summary tab. The syntax for searches is based on entire words. This whole word syntax was introduced in MDLink 6.2. For MDLink's purposes, it considers words to be any string of letters and/or numbers, and not including punctuation or other characters. For example you can search for ADT or A01 but there is no way to search for the string ADT^A01 exactly, because the "^" character is neither a letter nor a number. (You can however search for both ADT and A01 - more on this later.) The whole word syntax rules out certain kinds of searches that were possible before MDLink 6.2, but it also opens up new possibilities.

 

Search Syntax Basics

 

All searches are case insensitive. A search for assessment will match all messages containing the words assessment, ASSESSMENT, Assessment, and so on.

Wildcard patterns are supported with * and ?. For example, if you search for J0*, that would show messages containing J01, J02, J010, J020, J0110, J0111, or anything else that starts with J0. Searching for J0? would show J01 and J02 but not J010, J020, J0110, or J0111. J0*0 would show J010, J020, and J0110, but not J01, J02, or J0111. J0?0 would show J010 and J020 but not J01, J02, J0110, or J0111. The * and ? operators do not work at the start of a query - for example if you search for *01, however sensible that is, it is not supported by MDLink and will show no results.

If you use a search query that contains non-letter, non-number characters such as ADT^A01, OB/GYN, or 24.00, that will probably not show the results that you want, because MDLink's search syntax is based on whole words as of version 6.2, and so the "^" "/" and "." characters (and many others) are not supported in search queries. Therefore some users might be surprised at the search results (or lack thereof) when they use the same kind of search query that they're used to using in MDLink 6.0 and earlier in version 6.2 and above. The reason is usually that the query contains characters such as "^", "/", ".", "|", or "^", or anything else that is neither a letter nor a number. If you include any of these unsupported characters in your search, the results will often be undesirable, because those characters might represent special search syntax that means something very different from the literal character that you were trying to search for. In other cases those characters will be ignored by the search engine and you might get results deceptively close to what you intended. Either way, the results can be difficult to predict. Therefore we recommend that you omit non-letter, non-number characters from your search, unless you intend to use any special syntax as described in this document.

If you use more than one word in your query - for example, MFN M07 - then all messages which contain either MFN or M07 will be shown - for example, both MFN^M07 and MFR^M07 messages. To search for MFN^M07 only, use the plus sign: +MFN +M07.

 

Brackets and negation

 

You can combine terms in brackets to do some basic boolean logic. For example (+A04 +McDOUGALL) (A03) will show all messages which either contain both A04 and McDOUGALL, or A03.

You can negate a search term using the minus sign. For example -A03 will show all messages that do not contain A03. You can combine a negative with a positive, for example McDOUGALL -A03 will show all messages that contain McDOUGALL, except for those that also contain A03.

 

Fuzzy Searches

 

Use the tilde operator, you can perform fuzzy searches. This is useful for searching for misspellings. For example if you search for McDOUGALL~ that will match McDOUGALL as well as McDOUGAL and MacDOUGALL. Furthermore, there is an optional parameter called the "edit distance" which controls the level of fuzziness - that is, many characters are allowed to be different between the word in your query and your word in the message. For example McDOUGALL~1 will match McDOUGAL (one L removed) but not McDOUGA (2 Ls removed). McDOUGALL~2 will match both McDOUGAL and McDOUGA. The maximum edit distance is limited. The parameter is silently capped at 2, so searching for McDOUGALL~3, McDOUGALL~4, and so on is the same as searching for McDOUGALL~2. The default parameter value is 2 - so searching for McDOUGALL~ is the same as searching for McDOUGALL~2.

 

Performance and the "fast search" feature

 

Your searches in the Monitor will finish much sooner if you enable the "Index component output for fast searching" solution-level property, for all of your solutions.

You can perform a search with any of the syntax described above no matter which kind of node you have selected in the Monitor's tree - server, solution, or event/task. Selecting the "fast search" checkbox in your solutions will make your searches finish faster regardless of which kind of tree node you have selected, but the gains will be most significant if you have a solution or component node selected (not a server node). Therefore we recommend that you do searches with a solution or event/task node (not a server node) selected in the tree whenever possible.

 

Implementation details

 

MDLink's "fast search" feature uses the Apache Lucene project as its backend. The syntax described in this document is a subset of Lucene's query syntax. The syntax is always the same regardless of your solution settings or which part of the Monitor you are working in.

If you are using some advanced query syntax and your syntax is incorrect, your search will fail silently and return no matches. There will be no error message that helps you diagnose what is wrong with your query.

MDLink does not sort search results by best match. Search results are always sorted by time in the MDLink Monitor. MDLink does not show you any match ranking either. Each message in the server's database either matches your query, or it doesn't.

You can only search on message content in the search query text field - not time or other fields. If you happen to look up Apache Lucene search syntax yourself, independently of this MDLink documentation, you might find some examples that won't work with MDLink. Examples of Lucene features that aren't supported by MDLink are phrase queries (searching for words in sequence using quotes) and proximity searches.