Mobile Free Text Search
The search action item
In most activities' action bars (except for not directly content-related ones like the info activity or the settings activity), a search action item in form of a magnifying glass icon is available. Pressing it results into the action bar changing to a search text input field. Here, you can enter your free text criteria you want to search for. Upon confirming the input, a search result activity will open, and the search will run in the background. The action item is only available after login.
The search result activity
After having started the search, a result activity will be shown. If results are found, they are shown in a list, sorted by relevance and alphabetically. Clicking on such a result object will show it in the Content Browser.
Online and offline search
A mobile free text search is always performed based on data available on the device. Additionally, an online server search is executed if possible.
The requirements for an online search are:
- The server is reachable and online or manual mode are active (not available in offline mode); see Sync Mode for more details.
- A free text search query is provided by the server
Search result quality
The estimated quality of the search result (and each object's order in the result list) depends on how many search criteria you entered were found for an object. E.g., if two out of two criteria were matched successfully, the respective object is regarded a "full match". If only part of the criteria were found, it is a "partial match". Every object coming from the server is of unknown quality. Therefore, full matches are shown first, then come objects received from the server and finally the partial matches.
The text you provide in the input field is processed into search criteria objects before actually executing the search. An understanding of this mechanism and how to write a search query that is comprehensive for it will benefit your ability to find objects.
Pressure 32.8- Will find objects having a property "Pressure" with the value 32.8.
"Pump inspection" 2015-05-27- Will find objects named "Pump inspection" with date property values anywhere on the May 27th, 2015.
"Fault notification" "2015-5-27 7:35"- Will find objects named "Fault notification" with date values between 7:35:00 and 7:35:59 o'clock on May 27th, 2015.
7:00- Will find objects having a date value between 07:00 and 07:59 o'clock on the current day.
Individual words and connected phrases
The search text interpreter will try to split up your query into words that are separated by a blank character (
Hello, Bob will result in a search for the criteria "Hello," and "Bob", independently.
But what if I want to search for something belonging together that contains a space character, e.g.
2015-05-27 20:34 or
In this case, wrap your connected phrase into quotation marks (
") - the search text interpreter will handle it as a single criterion.
Chuck "He who needs no nickname" Norris will result into three criteria (one of them being the phrase "He who needs no nickname").
What does this mean? For example, let's say we have an object named "Mount", another one named "Everest" and a third one named "Mount Everest".
If you search for
Mount Everest, all three objects will be found. If you search for
"Mount Everest" instead, only the last object (with a name containing the whole phrase) is found.
If a meta property is found that matches a criterion, all found property values are filtered by it. This way, you can specify your search efficiently.
For example, imagine searching for a value like "2". It will be found extremely often, so without further specification, you will get all kinds of results. Adding the meta property name "Layer ID" will result in a way better result.
The query then looks like the following:
"Layer ID" 2
Numbers can be entered depending on your locale (e.g. using a comma instead of a point for the decimal separator). Your device must be configured for that locale though, or the search will assume your locale and culture wrong.
However, all numeric input is also searched for as pure text.
Dates and times
All around the world, people tend to write dates and times in all different manners imaginable. Our free text search uses one simple format:
You can also specify date only or time only. Also, you do not need to provide the seconds or the days (the latter is valid for date-only arguments). In a more precise manner, the supported formats are:
If you specify a search date, you probably don't mean a moment in time exactly that millisecond, but rather something like "on that day" or "during this hour".
Therefore, the free text search will always search for the time span you didn't specify concretely. E.g., if you search for
2015-05-27, every result containing dates for this day will be found.
Also, a pure text search for your input will be done additionally. By the way, this means that you also can specify dates the way your UBIK objects do, because it might match at text-level even without the search understanding your date input.
The search recognizes the words "True" and "False" as boolean values. A pure text search is done as well.
All text input is also searched for without modification. This includes occurences of a text in a Geo specification (lat/long/alt).
The only thing you can't search for currently are UUID/Guid criteria (but you probably don't want to enter one by hand anyway).