Full Database Search
Full database search is about scanning your complete system for single items and facts, such as scanning for
"sue" whether this means a Customer, Staff Member, or even part of a reference number. The meaning of search is not just
to find the items, but also to allow exploration of connections from the items found.
This page contains technical information for developers who wish to search and process the results, not end users
Jump to: Concepts | Worked Example
Full search detachs from normal database models in order to scan every field and row (where enabled) and find
results. The following key concepts are important to understand full search.
When you search for a string, the search engine returns "DataNodes" which represent the individual items found.
DataNodes are usually returned in groups, such that the engine returns a group of customers and a group of products. Typically when
searching, only a finite number will be returned for each group.
There are two main types of search, data search and information search. Data Search is about finding values in the data,
such as "sue" or even "7.95". An alternative type of search is "sales to sue", which is a desire to see a list of the sales made to
sue. This second query is no longer searching for the exact string but rather the idea of what is required. This second type of
search is named "NLQ", or natural language query within the search engine.
When searching you often have context to pass to the search engine. Context assists the search engine by giving hints as to what
the user is expecting based on where they are in the system or even who they are. This context information is typically not part of the query string entered by the user directly
Individual items can relate to other items where they have a common connection. The search engine can search a large number of relationships
automatically and return "connected" or "related" datanodes. For example, if we are looking at the single customer "sue", we can return related data such as
- Other customers/staff members/supplies/products named "sue".
- Sales transactions made by "sue" (using her Customer#)
- Geographic/Demographic information (using her address)
Not all related data will be useful or be relevant in all circumstances. Relationships between data are created using universal domains
A universal domain defines what a database field is holding, rather than how. How is defined using database types such as
string, number, date etc. Universal domains hold the fact that this field holds a "name" or "description" or "Customer#", or "monetary total" or "telephone number", and
so on. Tables the have fields with corresponding universal domains may then be related (although it is more complex than this simple mapping).
Universal domains are defined at the global level (address, description), or at the database level for concepts that are only valid within the database.
universal domains allow you to rapidly extend a database to global data. For example, you can take "address" in the database, map it to the global domain "street-address" and
potentially retrieve demographic information for this address.
Typically, you will want to retrieve more information about a single search result datanode. The search engine
allows you to take a single datanode and request what it is connected too, which is a relationship.
- Collect the search string from the user ("qu" in this example)
- Construct a request to the URL /gnap/srch?1=qu&11=qu (for XML results) or /gnap/j/srch?1=qu&11=qu (for JSON results)
- The server will respond with the following information (shown in stylised/editted XML)
<f23>DISHWASH LIQUID CHAMOMILE</f23>
<f72>DISHWASH LIQUID CHAMOMILE<br>PLU: 8001</f72>
<f101>DISHWASH LIQUID CHAMOMILE</f101>
<f23>TEA FENNEL LIQUORICE</f23>
<f72>TEA FENNEL LIQUORICE<br>PLU: 8721</f72>
- Take the datanode key, which is returned in "f70" of the SITM packet. for example "bretailmax.elink.products$f100,0,6036"
- Construct a query of the form /gnap/srch?70=bretailmax.elink.products$f100,0,6036 (for XML) or /gnap/j/srch?70=bretailmax.elink.products$f100,0,6036 (for JSON)
- The server will return with the following results (shown in stylised/editted XML)
<f101>DISHWASH LIQUID CHAMOMILE</f101>
- The search results show
- If we search for barcodes connected to the product, there are two
- If we search for sales of this product, there are many (first few returned)
- If we search for products with the same retail price, there are several
- If we search for products from this same supplier, there are several