A framework for building Web search-like features in applications. Building search features in applications modeled on Web searches provides users with a familiar and intuitive search interface. It keeps the user interface for searching simple and consist
Tutorial Details:
Most applications include some form of search functionality, and often, application navigation begins with the execution of a search query. Users then navigate around the application after establishing a context by selecting a particular item from the search results. An application\'s usability vastly improves if searching is enabled from different navigational depths.
To make the searching feature ubiquitous in an application, the user interface components must be kept simple and lightweight, thereby making the search dialog easily portable across the application. Many applications provide query options based on specific attributes or a combination thereof. But in this scenario, users are constrained in their queries by the limited set of attributes presented to them on the search page. Plus, the addition of new attributes to a page makes searching less intuitive and, in some cases, clutters the search page. An example of a simple but extremely effective search UI can be found in Web searching. Extending such a concept to application searches is only logical and practical, and is the topic of this article\'s discussion.
This article presents a framework that can be used to develop search features modeled on Web searches. The framework simplifies the client code and is easily extensible in that implementations can extend the framework to provide various application-specific search features. A single application can contain several different implementations of this framework, each corresponding to a search by different business objects.
Goals behind the design
The framework enables the building of search functionality that accepts an arbitrary query string. The string could contain words and/or phrases corresponding to attributes of a business object. The client interface to a search implementation in its simplest form takes in a query string and returns a java.util.Collection of some arbitrary key objects as in the following method signature:
public Collection getKeys(String searchStr);
The key objects in the result set uniquely identify the business objects returned from the search execution and can then be used to retrieve other details of the business objects.
Search functionality in most applications allows only searching a business object by a few attributes. In database applications, this means only a few columns of a given table are used in query predicates, and often, for performance reasons, the table is indexed on these columns. The mechanism used to execute the search could vary from having separate queries for each attribute to building a complex query at runtime that includes all the predicates. Regardless of the querying functionality\'s mechanics, the fact remains that an attribute and a search string are matched at design time by mapping user interface fields to attributes.
In the proposed scheme, however, by providing a single string interface, the association between the search string and the search object\'s attribute has been eliminated. This begs the question: What attribute do I search against? One possible solution for overcoming this lost association is for the search string to query all the attributes with the expectation that one or more queries would return a result set. This would entail executing all the queries all the time.
It is important to note that with this solution, all the attributes are being queried against the same string, more specifically, the entire search string. We will see later how we can be more specific and allow for searching multiple attributes with sets of words/phrases extracted from the search string. Nevertheless, executing these queries sequentially would prove impractical as the response time would be determined by the total of all the individual query execution times. To circumvent this problem, the queries must be executed in multiple threads and the final result set formulated when all query threads return. This way, the response time is determined by the slowest query execution. Since we assume the attributes being searched are indexed, even the slowest query\'s performance must be within an application\'s acceptable responsiveness. Thus, one of the major design goals of this framework is to contain a multithreaded query execution component without burdening the implementer with writing multithreaded code.
To allow for multithreaded query execution, the framework is designed around the notion of \"search methods.\" Each search method corresponds to a query execution and returns a collection of key objects. The search methods run on separate threads and, generally speaking, each method functionally maps to a single attribute search of the business object in question. For example, if the business object being queried is a Customer, then the implementation class would contain methods for searching by name, address, phone, etc.
As result sets are returned by these concurrently executing search threads, the final result set must be formulated after applying some kind of ranking methodology. The ranking methodology must sort, rank, and eliminate duplicate key objects from all the result sets. Higher ranked keys signify the most appropriate search results, while lower ranked keys are least significant, and, obviously, the final result set is ordered from highest ranking to lowest ranking. Therefore, providing the ability to define and implement a ranking method is another design goal.
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: Build application search features modeled on Web searches
View Tutorial: Build application search features modeled on Web searches
Related
Tutorials:
Using XML and JSP together - JavaWorld March 2000
Using XML and JSP together - JavaWorld March 2000 |
The Lucene
search engine: Powerful, flexible, and free - JavaWorld September 2000
The Lucene
search engine: Powerful, flexible, and free - JavaWorld September 2000 |
Add concurrent processing with message-driven beans
Add concurrent processing with message-driven beans |
Once again, only
introduction
Once again, only
introduction |
good
design pattern
good
design pattern |
Sphinx-4 - A speech recognizer
Sphinx-4 - A speech recognizer
General Information about Sphinx-4
Introduction
Sphinx-4 is a state-of-the-art speech recognition system written entirely in the JavaTM programming language. It was created via a joint collaboration between the Sphinx |
JForumFusion
About jForumFusion
JForumFusion is a platform independent discussion board program.
|
Can't beat Jazzy
Introducing the Java platform's Jazzy new spell checker API.
|
JLisa - A Rule Engine for Java
JLisa is a powerful framework for building business rules accessible to Java and it is compatible with JSR94 V, the JavaTM Rule Engine API
JLisa is more powerful than Clips because it has the expanded benefit of having all the features from common lisp a |
Create intelligent Web spiders
Create intelligent Web spiders
This article demonstrates how to create an intelligent Web spider based on standard Java network objects. The heart of this spider is a recursive routine that can perform depth-first Web searches based on keyword/phrase cri |
Lucene in Action
Lucene in Action
Lucene is a gem in the open-source world--a highly scalable, fast search engine. It delivers performance and is disarmingly easy to use. Lucene in Action is the authoritative guide to Lucene. It describes how to index your data, includin |
Overview of Servlets and JSP
Servlets are Java technology's answer to CGI programming. They are programs that run on a Web server and build Web pages. Building Web pages on the fly is useful (and commonly done) for a number of reasons. |
Servlets and JavaServer Pages (JSP) : A Tutorial
An excellent tutorial on JSP and Servlets. |
Running Lucene Search on WebLogic Portal 8.1
Lucene comes with two main services available: indexing and searching. The indexing tasks are done independently from the search tasks. Both the index and search services are available so that developers can extend them to meet their needs. |
Adding search to your applications
The Lucene search engine is an open source, Jakarta project used to build and search indexes. Lucene can index any text-based information you like and then find it later based on various search criteria. |

Free Web Site Hosting Services include "hostsearchbox.php"; ?>
Below is the listing of the hosting providers providing free web hosting services. These services helps you building your sites even if you have no experience in HTML writing.
Zero |
Download Search Engine Code its free and Search engine is developed in Servlets
Download Search Engine Code its free and Search engine is developed in Servlets
Download Search Engine Code
Installation Instruction
Download and unzip the file into your favorite directory.
Create a database on your MySQL Server.
Run all the |
Building Search Engine Applications Using Servlets !
Building Search Engine Applications Using Servlets !
Building Search Engine Applications Using Servlets
Please visit http://www.webappcabaret.com/javadevelopers/search to see running copy of our search engine.
Introduction
This tutorial takes |
Web Hosting Guide. Introduction to Domain Name
Web Hosting Guide. Introduction to Domain Name
Introduction to Domain Name
What is Domain Name?
If we have to send a letter to someone, we must know his/her mailing address. In the same way if we want to visit a website, we also need to know its |
Manual Submission to Search Engines. Hand Submit Website URL Submission to Major Search Engines
Manual Submission to Search Engines. Hand Submit Website URL Submission to Major Search Engines
ATTENTION: Website owners!
Hand Submissions to major search engines for as low as $10.00 per month
Let us introduce you to the services provided by |
|
|
|