Aiding Autosuggestion Search Using SQL in Databases
Total Page:16
File Type:pdf, Size:1020Kb
DOI 10.4010/2014.176 ISSN-2321 -3361 © 2014 IJESC Research Article May 2014 Issue Aiding Autosuggestion Search Using SQL in Databases B.MuthuAnithai1, J. MaruthuPandi2. Information Technology Department MepcoSchlenk Engineering College, Tamilnadu. [email protected], [email protected] Abstract An autosuggestion search enumerate the suggestion on the go as a user types a query keyword character by character for data saved in the relational database. Now days most of the search engines, web browsers are using the auto suggestion search. Querying or searching, in relational databases becomes one of the most significant issues. The RDBMS accommodate powerful query languages and they do not allow keyword-based search. In this paper the autosuggestion search is going to be practiced in the Relational DBMS.The keywords are constructed and stored as a table and they are queried using the Structured Query Language since the relational database support it. The main intent of this paper is to accomplish the interactive speed and to increase the search performance the auxiliary indexes are constructed as a table for both single query keyword and multi query keyword. For Fuzzy search an innovative technique is refined using SQL in which dissimilarity between the words are allowed. The autosuggestion is practiced on the DBLP dataset in which the techniques are splashed using the Structured Query Language Keyword- Exact search, Fuzzy search, Multi-keyword query, Relational Database, Single keyword query, SQL. I. INTRODUCTION The SQL techniques are convenient to other databases which are Nowadays, relational databases are extensively affirmed by using the same standard. This similar techniques are also used for most of the applications from various domains, and different the approximate and similarity joins which uses SQL [2][3]. users using different search paradigms. Database administrators, demand a search paradigm that will grant them fully functional Two types of search are supported in the Auto suggest Exact accessing abilities and accurate result. In Contradiction most of search and fuzzy search .In exact search the user typed keywords the Internet users have partial knowledge about the data they are are exactly found in the database and in Fuzzy search there will going to search. So in order to improve the searching experience be some mismatches between query keywords and answers. of the users prompt the feedback as users develop search queries. Based upon the single keyword queries and multi keyword Most of the modern web browsers, and search engines like queries they ask for additional index structures which are stored Google, Bing, yahoo etc. support the auto suggestion or the as an auxiliary table. answers “on the go” while user type the query character by character. For Example Consider the Google search engine if a II. SINGLE KEYWORD QUERY SEARCH user types the uncompleted keyword “dat” then it will display all In the Single keyword queries there are two ideas to use SQL the answers which are having “dat” as a prefix. Universally this to assist auto suggest search they are no index based methods and kind of search is known as Autosuggest complete search Index Based Methods. For Index based methods an auxiliary table is built. Many of the search engine and system store their information A. No Index Based Methods in a back end relational databases. So for searching the data residing in the RDBMS the auto suggest search is used.SQL A direct way to aid autosuggest search is to concern an SQL server support the prefix search with these features the auto query that analyze each and every record and gives whether the suggest search is performed. We demand to use the SQL in a record is an answer to the query. Checking is done in two waysby search query to find the answers when the user types the calling UDF and LIKE predicate. In UDF we have to add the keywords character by character. By using the built in query function to verify the records but in LIKE predicates users are engine inside the database we can shorten the programming allowed to perform a string matching to check the keywords with efforts and to practice the autosuggest search type. the query 503 http://ijesc.org/ TABLE 1 rid title Authors Book Title Year r1 Towards a Cooperative Transaction Model - The Cooperative M Rusinkiewicz, W Klas, T VLDB 1995 Activity Model Tesch, J Wäsch, P Muth r2 SQL/XML is Making Good Progress A Eisenberg, J Melton SIGMOD 2002 Record r3 Using Formal Methods to Reason about Semantics-Based P Ammann, S Jajodia, I Ray VLDB 1995 Decompositions of Transactions r4 Editor's Notes L Liu SIGMOD 2002 Record r5 Report on the ACM Fourth International Workshop on Data N/A N/A 2002 Warehousing and OLAP (DOLAP 2001) DBLP: A sample Computer Science Bibliography The Following SQL are used for the LIKE predicate query “tow” D. Prefix Table In the prefix table “pt” they are represented in the form of Select dblp.* from dblp where title LIKE „tow%‟ (PT,lkid,ukid) where p represents the prefix, lkid represents the smallest ids of the keyword with p as a prefix, ukid represents the This gives the records “r1”contain the query keyword “tow”. smallest ids of the keyword with p as a prefix .. If a user type a B. Index Based Methods keyword it will first get the keyword ranges then compute the record id from the prefix table.the following is the SQL query to In this index based method we make an auxiliary table represent the prefix search query as index structures to promote the prefix search. Oracle and SQL server will already support prefix search with this feature we can SELECT T.* FROM PT, IT , T WHERE PT .prefix = “w” perform prefix search. But some of the databases won‟t support AND PT . ukid≥IT.kid this feature so we are developing a new method that can be used in all databases. Two auxiliary index tables are constructed AND PT .lkid ≤ IT .kid AND IT. rid = T. rid. inverted index table and Prefix table. For example if a user types the keyword as “sig” then it will C. Inverted Index table display all the record containing the prefix “sig” .It will display In the inverted index table an unique key is generated for the r1, r4.Here it will get the keyword ranges for the keyword”sig” records. Inverted index table “It” with records are represented in from the prefix table which is k1, k214 with this keyword ranges the form of (kid ,rid) where “kid” represent the unique keyword it will compute the record ids from the inverted index table which and “rid” represent the record id. is r4161, r4640.With this record ids it will display all the details of the recordset which contains the “sig” 504 http://ijesc.org/ TABLE 2 Inverted Index table and Prefix table a) Inverted Index table b) Prefix table c) Keyword Table kid rid prefix lkid ukid kid keyword k1 r4161 IG k1 k214 k1 SIGMOD k1 r4640 /A k2 k2 k2 N/A k3 r121 LD k3 k3 k3 VLDB k3 r346 ar k4 k1390 k4 wards k4 r1 /X k5 k5 k5 L/XML k4 r134 III. SINGLE KEYWORD FOR FUZZY SEARCH For fuzzy search we can‟t use LIKE search since it cannot For eg., given a string w=pvldb; τ = 1. D1(pvldb)={“pvldb,” predicate it. So we are using UDF for fuzzy search. The edit “vldb,” “pldb,” “pvdb,” “pvlb,” “pvld”}.It canbe represented distance are used to calculate the similarities between the two using the SQL query string this can be represented as PED (“eards”, “wards”) =1 the edit distance should be less than the threshold value. The SELECT DISTINCT prefix FROM DT WHERE DT .i-deletion threshold value should between the “1” IN Dτ (w). A. Index Based Method It will Display the “vldb” which is the similar prefix for Inverted index table and the fuzzy search are used to support the “pvldb” fuzzy search as you type. There are two basic steps First we IV. INCREMENTALLY COMPUTING SIMILAR PREFIXES compute its similar prefixes from the prefix table PT ,and get the keyword ranges of these similar prefixes. Compute the answers A character-level incremental method the for a keyword as a user types character by character we can find the similar prefixes based on these ranges using the inverted-index table IT.Using a [4][5]. A similar prefix table is represented in the form of S in UDF we can find the similar prefixes from the prefix table PT T .The following SQL query is used to answer the prefix-search the form {prefix , ed (p, prefix)}which contains all the prefixes query “w” which will scan each prefix in PT and calls the UDF similar to p with their matching edit distances. Suppose if a user to check if the prefix is similar to “w”. types an extra character cx+1 and gives the new query the similar prefix table ST‟ is constructed using the ST. The following SQL ‟ SELECT T.* FROM PT , IT,T WHERE PEDTH(w, PT . query is used to answer the single-keyword query T . prefix ,τ) AND PT .ukid≥ IT .kid AND PT . lkid ≤ IT . kid AND IT . SELECT T.*FROM S w‟,P ,I ,T WHERE S w‟.prefix= P .prefix rid = T. rid. T T T T T AND PT .ukid≥ IT .kid AND PT . lkid ≤ IT . kid AND B. Neighborhood Generation Based Method I .r = T. r . For approximate string search we use this Neighborhood T id id Generation Based Method [7]Di(w) denote the set of i-deletion A.