A search field is a common user interface element in web applications, mobile apps, and software interfaces that allow users to find specific information within a dataset or content. The operations or features associated with a search field enhance the user experience and make it more efficient. The CAM product provides a search operation in a number of locations within the UI. Here are some useful operations of the search field:
- Basic Text Search: The primary operation of a search field is to allow users to enter text queries. Users can type keywords, phrases, or terms related to what they are looking for.
- Autocomplete: Implementing autocomplete or suggestions as users type can help users find relevant results more quickly. The search field can provide a dropdown list of suggested queries or results that match the entered text.
- Search Filters: Enable users to refine their search by applying filters such as date ranges, categories, or other criteria. Filters help users narrow down results and find what they need more precisely.
This well-designed search feature will significantly enhance the usability of the CAM application.
Location of Search Functionality
The main CAM UI has the global search box (Item 1) permanently available for use. This is the primary field being described here. Some sub-menus also have an additional search menu (All Servers lists, for example, provide this functionality with item 2)
The search operation can use one of two approaches:
- Simple string queries
- Typed string queries
Simple String Queries
The query string is parsed into a series of terms and operators. A term can be a single word — quick or brown — or a phrase, surrounded by double quotes — "quick brown" — which searches for all the words in the phrase, in the same order.
The one additional item to remember is that the simple search is being applied to all objects within the backend DB (which will have multiple attributes associated with them). The simple search is by definition an untyped search (it doesn’t specify which attribute of an object is to be searched) and thus will return results where the string matches any attributes within an object. For example, if you provided a string e.g. “JNBSFSP06V” and executed a search on this value then all objects that have an attribute with a value that is an exact (token) match for the “JNBSFSP06V” will be returned.
The following diagram identifies the exact search item (1), the result class, and label (2) and highlights the matching string location (3).
The use of a wildcard can also generalize a search operation but this has the potential to return values from lots of object classes stored in the search index. For example, if you provided a string e.g. “JNBSFSP*” and executed a search on this value then all objects that have an attribute with a value that is a match for the “JNBSFSP*” will be returned.
As identified in the above diagram, there is now a varied set of object classes (where previously only a single ComputerSystem class) are identified.
Typed String Queries
A typed search allows the field of an object that is to be searched. This limits the number of attributes that will be searched for the value provided.
The syntax for this type of search is:
field: value
An example of this would be if we wished to search for an object that has a hostName of a specific value:
hostName: JNBSFSP06V
The use of wildcards is also permitted in typed search strings. To search for hostnames with a specific prefix pattern the following is permitted
hostName: JNBSFSP*
The per-character match can be limited to the search for hostnames with a character pattern; the following is permitted to look for hostnames that have the prefix JNBSFSP and three (3) additional characters
hostName: JNBSFSP???
If numeric values are provided then range searching is also possible. An example would be to search for ComputerSystems that have 8 or more CPUs
nbOfCPUs:[8 TO *]
If numeric values are provided then ranges with one side unbounded can use the following syntax:
nbOfCPUs:>10
nbOfCPUs:>=10
nbOfCPUs:<10
nbOfCPUs:<=10
If date values are provided then range searching is also possible. An example would be to search for ComputerSystems that have been last scaned during a specific period:
lastScanDate:[2023-09-22 TO 2023-12-31]
Example Attributes for Queries
The following attributes are provided for a computer System (with some example values) and thus can be used in a typed search. The following example provide a list of attribute names and example values. The Date/time values used epoch values.
scanInfo: 0
model:"VMware Virtual Platform"
scanType:"Full"
hostName:"ZAELSXMBP001"
domainName:"cloudsphere.com"
systemType:"Virtual"
totalPhysicalMemory: 38654169088
extrapolatedCPUSPECInt: 1
locationName:"SA-OPS-EL"
totalAvailableMemory:38654169088
OSSerialNumber:"00252-70000-00000-AA535"
IPAddressList:"10.43.10.62,fe80::fc63:9f67:ea98:a07c"
licenseExpiryDate:15999725760000
metricStatus:"Unavailable"
containerCount:0
OSLanguage:"English - United States"
nbOfCoresPerCPU:1
nbOfCPUs:8
nbOfLocalDisks:11
VMTechnology:"VMware, Inc."
totalLocalDiskCapacity:6388747706880
lastScanDate:1695329454825
oid:"17a82d369af355befffb79aae82be2be"
OSManufacturer:"Microsoft Corporation"
OSInstallDate:1575379073000
OSUpdate:6.0.0
CPUMaxSpeed:2095
CPUModel:"Intel(R) Xeon(R) Silver 4208 CPU @ 2.10GHz"
productKey:"48QRH-WKY83-MCDW3-6B9H3-GGRG6"
shortDescr:"ZAELSXMBP001.cloudsphere.com"
VMState:"Active"
CPUSocketCount:0
id:"ComputerSystem:17a82d369af355befffb79aae82be2be"
className:ComputerSystem
nbOfLogicalCPUsPerCore:1
orgOid:"cloudsphere"
CPUArchitecture:"x64"
creationDate:1692227306627
OSVersion:"6.3.9600"
serverCount:0
OSEdition:"Server"
OSModel:"Microsoft Windows Server 2012 R2 Standard"
manufacturer:"VMware, Inc."
type:"Server"
discoveryIPDNSName:"zaelsxmbp001.cloudsphere.com"
totalFreeLocalDiskSpace:1980793905152
CPUManufacturer:"GenuineIntel"
piCount:0
modificationDate:1695326814322
OSFamily:"Windows"
Additional Information
The search operation described above is derived from the syntaxes supported by Elastic Search (r). If you are interested in additional documentation then please refer: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax .
Please be aware that all syntaxes described in this reference may not be supported.