search as-you-type (exact search)

21
SUPPORTING SEARCH-AS-YOU-TYPE USING SQL IN DATABASES Prepared by Bhavik D. Gabani Guided by Kaushik G. Vaghani

Upload: gabani-bhavik

Post on 29-Jun-2015

403 views

Category:

Internet


0 download

DESCRIPTION

This PPT includes Search as you type in database using SQL, and it describes Exact search deeply.

TRANSCRIPT

Page 1: Search as-you-type (Exact search)

SUPPORTING SEARCH-AS-YOU-TYPE

USING SQL IN DATABASES

Prepared by

Bhavik D. Gabani

Guided by

Kaushik G. Vaghani

Page 2: Search as-you-type (Exact search)

Outlines:

Introduction to Search-As-You-Type Preliminaries Exact Search for Single Keyword Result Analysis Conclusion

Page 3: Search as-you-type (Exact search)

Introduction to Search-As-You-Type Many information systems now a days improve user search

experiences by providing instant feedback as users

formulate search queries.

In the most search engines and online search forms

support auto completion, which shows suggested queries

or even answers.

The instant feedback helps the user not only in formulating

the query, but also in understanding the underlying data.

This type of search is generally called search-as-you-type

or type-ahead search.

Page 4: Search as-you-type (Exact search)

The scalability becomes even more unclear if we want to support four useful features in search-as-you-type. Namely,

Single keyword search

Multi-keyword search

Exact search

Fuzzy search

Page 5: Search as-you-type (Exact search)

1) Single keyword search In this search, we allow a user who types in a query “privacy”

to find a publication by “Rakesh Agrawal” with a title including the

keyword “privacy”, even though these keywords are at different

places in the record and also it gives all the records which

publications have “privacy” keyword.

2) Multi-keyword search

In multi-keyword search, we allow a user who types in a query

“privacy mining rak” to find a publication by “Rakesh Agrawal” with

a title including the keywords “privacy” and “mining,” even though

these keywords are at different places in the record.

Page 6: Search as-you-type (Exact search)

3) Exact Search In Exact search, For instance, a partial

query “agr” should find a record with a keyword “agrawal” despite the typo in the query. These features can explain in brief in this seminar.

4) Fuzzy search In fuzzy-search, For instance, a partial

query “aggraw” should find a record with a keyword “agrawal” despite the typo in the query.

Page 7: Search as-you-type (Exact search)

ID Title Booktitle Year

r1 K-Automorphism: A General Framework for Privacy Preserving Network Publication PVLDB 2009

r2 Privacy-Preserving Singular Value Decompositon ICDE 2009

r3 Privacy Preservation of Aggregates in Hidden Databases: Why and How? SIGMOD 2009

r4 Privacy-Preserving Indexing of Documents on the Network VLDBJ 2009

r5 On Anti-Corruption Privacy Preserving Publication ICDE 2008

r6 Preservation of Proximity Privacy in Publishing Numerical Sensitive Data SIGMOD 2008

r7 Hiding in the Crowd: Privacy Preservation on Evolving Streams through Correlation Tracking ICDE 2007

r8 The Boundary Between Privacy and Utility in Data Publishing VLDB 2007

r9 Privacy Protection in Personalized Search SIGIR 2007

r10 Privacy in Database Publishing ICDT 2005

Exact search : SIG

We can easily understand this from below example…..

Page 8: Search as-you-type (Exact search)

ID Title Booktitle Year

r1 K-Automorphism: A General Framework for Privacy Preserving Network Publication PVLDB 2009

r2 Privacy-Preserving Singular Value Decompositon ICDE 2009

r3 Privacy Preservation of Aggregates in Hidden Databases: Why and How? SIGMOD 2009

r4 Privacy-Preserving Indexing of Documents on the Network VLDBJ 2009

r5 On Anti-Corruption Privacy Preserving Publication ICDE 2008

r6 Preservation of Proximity Privacy in Publishing Numerical Sensitive Data SIGMOD 2008

r7 Hiding in the Crowd: Privacy Preservation on Evolving Streams through Correlation Tracking ICDE 2007

r8 The Boundary Between Privacy and Utility in Data Publishing VLDB 2007

r9 Privacy Protection in Personalized Search SIGIR 2007

r10 Privacy in Database Publishing ICDT 2005

Fuzzy search : IBDM

Page 9: Search as-you-type (Exact search)

Preliminaries

This seminar first formulates the problem of search-as-you-type in DBMS and then discuss different ways to support search-as-you-type. We will learn two queries that is Single keyword and second is Multi-keyword queries. This two queries have two searches that is Exact search and Fuzzy search.

Page 10: Search as-you-type (Exact search)

This two queries, we will understand by bellow table.

Page 11: Search as-you-type (Exact search)

Exact Search for Single Keyword

Two types of methods is there in exact search.

1) No-index-Based method

2) Index-Based method

Page 12: Search as-you-type (Exact search)

1) No-Index based method

In no-index based method the pointer moves or scans whole the database that consumes very much time. There are two ways to do the checking.

1) Calling User-Defined functions(UDFs),

2)Using LIKE predicate.

Page 13: Search as-you-type (Exact search)

2) Index-based method

In Index-based method, it build auxiliary tables as index structures to facilitate prefix search. In Index method, it invents two tables from given database.

1) Inverted-Index Table

2) Prefix Table

Page 14: Search as-you-type (Exact search)
Page 15: Search as-you-type (Exact search)

Given a partial keyword w, we first get its keyword range [lkid, ukid] using the prefix table PT, and then find the records that have a keyword in the range through the inverted-index table IT as shown in Figure 1. We use the following SQL to answer the prefix-search query w:

SELECT T .* FROM PT , IT , T WHERE PT .prefix = “w” AND PT .ukid ≥ IT .kid AND PT .lkid ≤ IT .kid AND IT .rid = T.rid.

Page 16: Search as-you-type (Exact search)

For example, assuming a user types in a partial query “sig” on table dblp (Table 1), we issue the following SQL:

SELECT dblp.* FROM Pdblp, Idblp, dblp

WHERE Pdblp.prefix = “sig” AND

Pdblp.ukid ≥ Idblp.kid AND Pdblp.lkid ≤ Idblp.kid AND

Idblp.rid = dblp.rid,

Page 17: Search as-you-type (Exact search)

ID Booktitle

r1 PVLDB

r2 ICDE

r3 SIGMOD

r4 VLDBJ

r5 ICDE

r6 SIGMOD

r7 ICDE

r8 VLDB

r9 SIGIR

r10 ICDT

… …

kid rid

k2 r10

k5 r6

k5 r8

k5 r10

k6 r1

k7 r9

k8 r3

K8 r6

k9 r8

k10 r4

… …

prefix lkid ukid

ic k1 k2

p k3 k6

pr k3 k4

pri k4 k4

pu k5 k5

pv k6 k6

pvl k6 k6

sig k7 k8

v k9 k10

vl k9 k10

… … …

TableInverted-index TablePrefix Table

Page 18: Search as-you-type (Exact search)

The SQL returns records r3, r6, and r9. The SQL query first finds the keyword range [k7, k8] based on the prefix table. Then it finds the records containing a keyword with ID in [k7, k8] using the inverted-index table.

Page 19: Search as-you-type (Exact search)

To answer the SQL query efficiently, we create built-in indexes on attributes prefix, kid, and rid.

The SQL could first use the index on prefix to find the keyword range, and then compute the answers using the indexes on kid and rid.

For example, assuming a user types in a partial query “sig” on table dblp (Table 1), we first get the keyword range of “sig” ([k7, k8]) using the index on prefix and then find records r3, r6, and r9 using the index on kid.

Page 20: Search as-you-type (Exact search)

Result Analysis

Page 21: Search as-you-type (Exact search)

Conclusion

In this Seminar, we studied the problem of using SQL to support search-as-you- type in databases. We focused on the challenge of how to leverage existing DBMS functionalities to meet the high-performance requirement to achieve a interactive speed. To support prefix matching, we proposed solutions that use auxiliary tables as index structures and SQL queries to support search-as-you-type.