JPH05334355A - Optional identity retrieval system - Google Patents

Optional identity retrieval system

Info

Publication number
JPH05334355A
JPH05334355A JP4161993A JP16199392A JPH05334355A JP H05334355 A JPH05334355 A JP H05334355A JP 4161993 A JP4161993 A JP 4161993A JP 16199392 A JP16199392 A JP 16199392A JP H05334355 A JPH05334355 A JP H05334355A
Authority
JP
Japan
Prior art keywords
key
index
arbitrary
match search
search
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP4161993A
Other languages
Japanese (ja)
Inventor
Masaharu Ashihara
雅晴 葦原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP4161993A priority Critical patent/JPH05334355A/en
Publication of JPH05334355A publication Critical patent/JPH05334355A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To shorten the retrieval time of optional identity retrieval. CONSTITUTION:An index word extracting process means 41 extracts an optional identity retrieval key (rear character string having respective characters of index words as initial characters) from the index words of respective records R1-Rn constituting a database and also makes the extracted optional identity retrieval key 21 correspond to a record key 22, a sorting process means 42 sorts the optional identity retrieval key 21 made to correspond to the record key 22 extracted by the index word extracting process means 41, and a merging process means 43 merges sorted optional identity retrieval keys 21 which have identity starting parts into one optional identity retrieval key 21 to generate an optional identity retrieval index 2. A searching means 1 makes a binary search of the optional identity retrieval index 2 by inputting an optional identity retrieval word to search for an optional identity retrieval key 21 whose start part identifies that of the inputted optional identity retrieval word, and outputs a record key 22 corresponding to the optional identity retrieval key 21 which is searched for.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はデータベース検索に関
し、特に任意一致検索を高速に行なうことができる任意
一致検索方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a database search, and more particularly to an arbitrary match search system capable of performing an arbitrary match search at high speed.

【0002】[0002]

【従来の技術】コンピュータの普及に伴ってデータベー
スの利用があらゆる分野に浸透しつつある。しかし、デ
ータ量の増大に伴い、データの検索時間の増加が問題と
なってきている。特に、任意一致検索に於いては、従来
は全文字列サーチ処理が必要になるため、多くの検索時
間が必要であった。
2. Description of the Related Art With the spread of computers, the use of databases is spreading in all fields. However, as the amount of data increases, the increase in data search time has become a problem. Particularly, in the arbitrary match search, since a whole character string search process is conventionally required, much search time is required.

【0003】図6,図7は従来の検索方式を説明するた
めの図であり、以下各図を参照して従来の検索方式を説
明する。
FIGS. 6 and 7 are diagrams for explaining a conventional search method, and the conventional search method will be described below with reference to the drawings.

【0004】図6は検索対象となるデータベースの構成
例を示した図であり、このデータベースは5個のレコー
ドR1〜R5から構成されている。
FIG. 6 is a diagram showing an example of the structure of a database to be searched, and this database is composed of five records R1 to R5.

【0005】各レコードR1〜R5はそれぞれ索引語5
1と、属性の組(a1,a2,…,am)52と、レコ
ードキー53とから構成されている。
Each of the records R1 to R5 is an index word 5
1, a set of attributes (a1, a2, ..., Am) 52, and a record key 53.

【0006】レコードキー53は属性値に対する論理演
算処理やレコードの更新を行なう時に用いられる見出し
であり、レコードと1対1に対応している。この例の場
合、各レコードR1〜R5にはレコードキー53として
DBK−1〜DBK−5が与えられている。
The record key 53 is a headline used when performing logical operation processing on the attribute value and updating the record, and has a one-to-one correspondence with the record. In the case of this example, DBK-1 to DBK-5 are given as record keys 53 to the respective records R1 to R5.

【0007】また、索引語51はデータベース利用者と
のインタフェースを円滑にするために設けられているキ
ーワードである。この例の場合、レコードR1,R2,
R3,R4,R5にはそれぞれ「アイウエオ」,「イウ
エ」,「カキウエオ」,「キウエ」,「サシス」が索引
語51として与えられている。尚、ここでは説明を簡単
にするために、各レコードに索引語が1つしかないとし
たが、一般的には1つのレコードには複数の索引語が存
在するものである。また、この例では各レコードR1〜
R5の索引語は全て異なっているが、異なるレコードが
同じ索引語を持つ場合もある。
The index word 51 is a keyword provided for facilitating the interface with the database user. In the case of this example, the records R1, R2,
R3, R4, and R5 are provided with "aiueo", "iue", "kakiueo", "kiue", and "sis" as index words 51, respectively. Although there is only one index word in each record for simplification of description, one record generally has a plurality of index words. Also, in this example, each record R1
The R5 index words are all different, but different records may have the same index word.

【0008】図7は図6に示したデータベースの検索を
行なう場合に従来使用していたインデックスの構成例を
示した図であり、索引語61と、レコードキー62とか
ら構成されている。
FIG. 7 is a diagram showing an example of the structure of an index that has been conventionally used when searching the database shown in FIG. 6, and is composed of an index word 61 and a record key 62.

【0009】索引語61には図6に示したデータベース
中の各レコードR1,R2,R3,R4,R5の索引語
「アイウエオ」,「イウエ」,「カキウエオ」,「キウ
エ」,「サシス」が完全な形で格納されている。また、
レコードキー62には各レコードR1,R2,R3,R
4,R5のレコードキーDBK−1,DBK−2,DB
K−3,DBK−4,DBK−5が索引語「アイウエ
オ」,「イウエ」,「カキウエオ」,「キウエ」,「サ
シス」に対応して格納されている。尚、インデックス中
の索引語61は通常、昇順にソートされているものであ
り、図7に示すように、索引語が数字以外の文字列であ
る場合は、例えば50音順にソートされる。
In the index word 61, the index words "aiueo", "iue", "kakiueo", "kiue", "sasis" of the records R1, R2, R3, R4 and R5 in the database shown in FIG. Stored in complete form. Also,
The record key 62 has each record R1, R2, R3, R
4, R5 record keys DBK-1, DBK-2, DB
K-3, DBK-4, and DBK-5 are stored in correspondence with the index words "aiueo", "iue", "kakiueo", "kiue", and "sis". Note that the index words 61 in the index are usually sorted in ascending order. If the index words are character strings other than numbers as shown in FIG. 7, they are sorted in the Japanese syllabary order, for example.

【0010】次に、図6,図7を参照して従来の検索方
式について説明する。
Next, a conventional search method will be described with reference to FIGS.

【0011】先ず、前方一致検索を行なう場合の動作を
説明する。
First, the operation when performing a prefix match search will be described.

【0012】前方一致検索は検索語が先頭部分に存在す
る索引語を検索対象とするものであり、検索語「カキウ
エオ」が指定されたとすると、図7のインデックスの検
索語61の欄をサーチして検索語「カキウエオ」を探
し、それに対応してレコードキー62の欄に格納されて
いるレコードキー「DBK−3」を取得する。その後、
図6に示したデータベース中のレコードR1〜R5から
上記レコードキー「DBK−3」を有するレコードR3
を選択する。ここで、図7のインデックスの索引文字は
昇順にソートされているので、バイナリサーチを行なう
ことにより、サーチ時間を大幅に短縮することが可能に
なる。
In the prefix match search, an index word having a search word at the beginning is to be searched. If the search word "Kakiueo" is specified, the column of the search word 61 in the index of FIG. 7 is searched. Then, the search word "Kakiueo" is searched for, and the record key "DBK-3" stored in the column of the record key 62 is acquired correspondingly. afterwards,
From record R1 to R5 in the database shown in FIG. 6 to record R3 having the above record key "DBK-3"
Select. Here, since the index characters of the index of FIG. 7 are sorted in ascending order, it is possible to significantly reduce the search time by performing a binary search.

【0013】次に、任意一致検索を行なう場合の動作を
説明する。
Next, the operation when performing an arbitrary match search will be described.

【0014】任意一致検索は検索語を任意の部分に含む
索引語を全て検索対象とするものであり、例えば、検索
語「ギジュツ」で任意一致検索を行なう場合、「ギジュ
ツ」を含む「コウクウギジュツカイハツ」,「ドボクギ
ジュツカイハツ」等の索引語が全て検索の対象となる。
In the arbitrary match search, all index words including a search word in an arbitrary part are to be searched. For example, when performing an arbitrary match search with the search word "Gijutsu", "Koukyu" including "Gijutsu" All index terms such as “Gijutsukaihatsu” and “Dokubokujijutsukaihatsu” are searched.

【0015】今、例えば、任意一致検索を行なう検索語
として「ウエオ」が指定されたとすると、図5のインデ
ックスの索引語61の欄をサーチして、任意の位置に指
定された検索語「ウエオ」が含む検索語を全て探し出
す。ここで、索引語61は完全な文字列についてソート
されているので、索引語の任意の部分に含まれている検
索語を探し出すにはバイナリサーチを適用することがで
きない。従って、任意一致検索を行なう場合、従来はイ
ンデックスの端から全サーチを行ない、索引語が「アイ
ウエオ」のレコードキー「DBK−1」と、索引語が
「カキウエオ」のレコードキー「DBK−3」とを探し
出すことが必要であった。
Now, for example, if "ueo" is specified as the search word for performing the arbitrary match search, the column of the index word 61 of the index of FIG. 5 is searched, and the search word "ueo" specified at an arbitrary position is searched. Find all the search terms that include ". Here, since the index word 61 is sorted with respect to the complete character string, the binary search cannot be applied to search for the search word included in any part of the index word. Therefore, when performing an arbitrary match search, conventionally, the entire search is performed from the end of the index, and the record key "DBK-1" with the index word "aiueo" and the record key "DBK-3" with the index word "kakiueo" are used. It was necessary to find out.

【0016】[0016]

【発明が解決しようとする課題】上述したように、従来
のインデックスは前方一致検索を念頭において作られて
おり、任意一致検索を行なう場合にはバイナリサーチを
行なうことができないため、索引語数が数10万から数
100万にもなる実用データベースに於いて任意一致検
索を行なう場合、検索時間が非常に長くなるという問題
があった。
As described above, the conventional index is created with the prefix search in mind, and since the binary search cannot be performed when performing the arbitrary match search, the number of index words is small. When performing an arbitrary match search in 100,000 to several million practical databases, there is a problem that the search time becomes very long.

【0017】本発明の目的は、任意一致検索に於ける検
索時間を大幅に短縮させることができる任意一致検索方
式を提供することにある。
An object of the present invention is to provide an arbitrary match search method capable of significantly shortening the search time in the arbitrary match search.

【0018】[0018]

【課題を解決するための手段】本発明は上記目的を達成
するため、(A)索引語を有する複数のレコードから構
成されるデータベースと、前記各索引語から索引語中の
各文字を先頭文字とする後方の文字列を任意一致検索キ
ーとして抽出し、抽出した任意一致検索キーとそれを抽
出した索引語を含んでいるレコードのレコードキーとの
対応付けを行なう索引語抽出処理手段と、該索引語抽出
処理手段で抽出され、レコードキーとの対応付けが行な
われた任意一致検索キーをソートすることにより、前記
レコードキーとの対応付けが行なわれた任意一致検索キ
ーが所定の順序で並んだ任意一致検索インデックスを作
成するソート処理手段と、任意一致検索語が入力される
ことにより、前記任意一致検索インデックスをバイナリ
サーチし、前記任意一致検索語と前方一致する任意一致
検索キーを探し出し、探し出した任意一致検索キーに対
応するレコードキーを出力するサーチ手段とを設けたも
のである。
In order to achieve the above object, the present invention provides (A) a database composed of a plurality of records each having an index word, and each character in the index word is the first character from the index word. And an index word extraction processing means for associating the extracted arbitrary match search key with the record key of the record containing the extracted index word. By sorting the arbitrary match search keys extracted by the index word extraction processing means and associated with the record keys, the arbitrary match search keys associated with the record keys are arranged in a predetermined order. By inputting a sort processing means for creating an arbitrary match search index and an arbitrary match search word, the arbitrary match search index is binary-searched and Find any match search key that matches the search term and the prefix match, but provided a search means for outputting a record key corresponding to any matching search key searched.

【0019】また、本発明は更に検索時間を短縮させる
ために、(B)索引語を有する複数のレコードから構成
されるデータベースと、前記各索引語から索引語中の各
文字を先頭文字とする後方の文字列を任意一致検索キー
として抽出し、抽出した任意一致検索キーとそれを抽出
した索引語を含んでいるレコードのレコードキーとの対
応付けを行なう索引語抽出処理手段と、該索引語抽出処
理手段で抽出され、レコードキーとの対応付けが行なわ
れた任意一致検索キーをソートすることにより、前記レ
コードキーとの対応付けが行なわれた任意一致検索キー
が所定の順序で並んだ集合を作成するソート処理手段
と、該ソート処理手段で作成された集合に含まれている
任意一致検索キーの内、前方一致する任意一致検索キー
同士をマージすることにより、前記レコードキーとの対
応付けが行なわれたマージされた任意一致検索キー及び
マージされなかった任意一致検索キーが所定の順序で並
んだ任意一致検索インデックスを作成するマージ処理手
段と、任意一致検索語が入力されることにより、前記任
意一致検索インデックスをバイナリサーチし、前記任意
一致検索語と前方一致する任意一致検索キーを探し出
し、探し出した任意一致検索キーに対応するレコードキ
ーを出力するサーチ手段とを設けたものである。
Further, according to the present invention, in order to further shorten the search time, (B) a database composed of a plurality of records each having an index word, and each character in the index word from each of the index words is set as the first character. Index word extraction processing means for extracting a rearward character string as an arbitrary match search key, and associating the extracted arbitrary match search key with a record key of a record including the extracted index word, and the index word A set in which the arbitrary match search keys extracted by the extraction processing means and associated with the record key are sorted to sort the arbitrary match search keys associated with the record key in a predetermined order. Of the arbitrary matching search keys included in the set created by the sorting processing means and the forward matching arbitrary matching search keys are merged. And a merge processing means for creating an arbitrary match search index in which a merged arbitrary match search key that is associated with the record key and an unmerged arbitrary match search key are arranged in a predetermined order, and an arbitrary match A search for inputting a search word to perform a binary search on the arbitrary match search index, find an arbitrary match search key that prefix-matches the arbitrary match search word, and output a record key corresponding to the found arbitrary match search key. And means are provided.

【0020】[0020]

【作用】(A)の構成に於いては、索引語抽出処理手段
によって各索引語から索引語中の各文字を先頭文字とす
る後方の文字列が任意一致検索キーとして抽出され、且
つ抽出した任意一致検索キーとレコードキーとの対応付
けが行なわれる。
In the configuration of (A), the index word extraction processing means extracts and extracts a backward character string from each index word with each character in the index word as a leading character as an arbitrary match search key. The arbitrary match search key and the record key are associated with each other.

【0021】更に、ソート処理手段に於いて索引語抽出
処理手段で抽出され、レコードキーとの対応付けが行な
われた任意一致検索キーのソートが行なわれ、レコード
キーとの対応付けが行なわれた任意一致検索キーが所定
の順序で並んだ任意一致検索インデックスが作成され
る。
Further, in the sort processing means, the arbitrary match search key extracted by the index word extraction processing means and associated with the record key is sorted, and associated with the record key. An arbitrary match search index in which arbitrary match search keys are arranged in a predetermined order is created.

【0022】サーチ手段は任意一致検索語が入力される
と、ソート処理手段によって作成された任意一致検索イ
ンデックスをバイナリサーチし、任意一致検索語と前方
一致する任意一致検索キーを探し出し、探し出した任意
一致検索キーと対応付けされているレコードキーを出力
する。
When the arbitrary matching search word is input, the searching means performs a binary search on the arbitrary matching search index created by the sort processing means, finds an arbitrary matching search key that prefix-matches the arbitrary matching search word, and finds the arbitrary matching search key. Outputs the record key associated with the match search key.

【0023】(B)の構成に於いては、ソート処理手段
で作成されたレコードキーとの対応付けが行なわれた任
意一致検索キーが所定の順序で並んだ集合に対して、マ
ージ処理手段が前方一致する任意一致検索キー同士をマ
ージし、レコードキーとの対応付けが行なわれたマージ
された任意一致検索キー及びマージされなかった任意一
致検索キーが所定の順序で並んだ任意一致検索インデッ
クスを作成する。
In the configuration of (B), the merge processing means is provided for the set in which the arbitrary match search keys associated with the record keys created by the sort processing means are arranged in a predetermined order. An arbitrary match search index is created by merging arbitrary matching search keys that are prefixed and matching the record key with the merged arbitrary match search key and the unmerged arbitrary match search key in a predetermined order. create.

【0024】[0024]

【実施例】次に本発明の実施例について図面を参照して
詳細に説明する。
Embodiments of the present invention will now be described in detail with reference to the drawings.

【0025】図1は本発明の実施例のブロック図であ
り、サーチ手段1と、任意一致検索インデックス2と、
データベースマネージメントシステム3と、任意一致検
索インデックス作成手段4とから構成されている。
FIG. 1 is a block diagram of an embodiment of the present invention, in which a search means 1, an arbitrary match search index 2 and
It comprises a database management system 3 and an arbitrary match search index creating means 4.

【0026】任意一致検索インデックス2は図2に示す
ように、任意一致検索キー21と、レコードキー22と
を有している。
The arbitrary match search index 2 has an arbitrary match search key 21 and a record key 22, as shown in FIG.

【0027】任意一致検索キー21の各欄には任意一致
検索キーWK−i(i=1,2,…,p)が、レコード
キー22の各欄には任意一致検索キーWK−iを有する
レコードのレコードキーDBK−j(j=1,2,…,
q)が格納されている。
Each column of the arbitrary match search key 21 has an arbitrary match search key WK-i (i = 1, 2, ..., P), and each column of the record key 22 has an arbitrary match search key WK-i. Record key DBK-j (j = 1, 2, ..., Of record)
q) is stored.

【0028】図2の例は、任意一致検索キーWK−1を
有するレコードは3つあり、そのレコードキーはDBK
−1,DBK−2,DBK−3であることを示してい
る。他の行も同様のことを示している。
In the example of FIG. 2, there are three records having the arbitrary match search key WK-1, and the record key is DBK.
-1, DBK-2, and DBK-3 are shown. The other lines show the same.

【0029】サーチ手段1は任意一致検索インデックス
2の任意一致検索キー21の欄をサーチして入力された
検索語と前方一致する文字列を有する任意一致検索キー
を探し出し、探し出した任意一致検索キーと対応して任
意一致検索インデックス2に格納されているレコードキ
ーをデータベースマネージメントシステム3に出力す
る。
The search means 1 searches the field of the arbitrary match search key 21 of the arbitrary match search index 2 to find an arbitrary match search key having a character string that prefix-matches the input search word, and finds the arbitrary match search key found. Corresponding to, the record key stored in the arbitrary match search index 2 is output to the database management system 3.

【0030】データベースマネージメントシステム3は
レコードR1〜Rnによって構成されるデータベース及
びデータベースの管理機能を含むものであり、サーチ手
段1から出力されたレコードキーを受け取って、このレ
コードキーを持つレコードの属性を出力する。
The database management system 3 includes a database composed of the records R1 to Rn and a database management function. The database management system 3 receives the record key output from the search means 1 and displays the attribute of the record having this record key. Output.

【0031】データベースを構成する各レコードR1〜
Rnは索引語31と、属性の組32と、レコードキー3
3とから構成されている。
Each record R1 constituting the database
Rn is an index word 31, an attribute set 32, and a record key 3
3 and 3.

【0032】任意一致検索インデックス作成手段4は任
意一致検索インデックス2を作成するものであり、索引
語抽出処理手段41と、ソート処理手段42と、マージ
処理手段43とから構成されている。
The arbitrary match search index creating means 4 is for creating the optional match search index 2, and comprises an index word extraction processing means 41, a sort processing means 42, and a merge processing means 43.

【0033】次に、本実施例の動作を説明する。尚、以
下の説明に於いては、データベースマネージメントシス
テム3内のレコードR1〜Rnのレコード数は5個(n
=5)であり、各レコードR1〜R5の内容はそれぞれ
図6に示したレコードR1〜R5と同一であるとする。
Next, the operation of this embodiment will be described. In the following description, the number of records R1 to Rn in the database management system 3 is 5 (n
= 5), and the contents of the records R1 to R5 are the same as those of the records R1 to R5 shown in FIG. 6, respectively.

【0034】先ず、任意一致検索インデックス作成手段
4の動作を説明する。
First, the operation of the arbitrary match search index creating means 4 will be described.

【0035】任意一致検索インデックス作成手段4内の
索引語抽出処理手段41はデータベースマネージメント
システム3から開始指示が加えられると、レコードR1
〜R5の索引語31それぞれに対して、索引語中の各文
字を先頭文字とする後方の文字列を任意一致検索キーと
して抽出する処理を行ない、更に、抽出した任意一致検
索キーにそれを抽出した索引語を含んでいるレコードの
レコードキーを付加する処理を行なう。尚、データベー
スマネージメントシステム3はデータベースが更新され
た場合、上記開始指示を出力するものである。
When a start instruction is added from the database management system 3 to the index word extraction processing means 41 in the arbitrary match search index creation means 4, a record R1 is issued.
~ For each of the index words 31 of R5, a process of extracting a backward character string having each character in the index word as a first character as an arbitrary match search key, and further extracting it to the extracted arbitrary match search key The process of adding the record key of the record including the index word is performed. The database management system 3 outputs the start instruction when the database is updated.

【0036】例えば、レコードR1の索引語「アイウエ
オ」について上述した処理を行なうことにより、任意一
致検索キー「アイウエオ」,「イウエオ」,「ウエ
オ」,「エオ」,「オ」が抽出され、抽出された各任意
一致検索キーにレコードR1のレコードキーDBK−1
が付加される。
For example, by performing the above-mentioned processing on the index word "aiueo" of the record R1, the arbitrary matching search keys "aiueo", "iueo", "ueo", "eo", and "o" are extracted and extracted. The record key DBK-1 of the record R1 is added to each of the generated arbitrary match search keys.
Is added.

【0037】以上の処理を全てのレコードR1〜R5の
索引語に対して行なうことにより、図3に示すレコード
キーが付加された任意一致検索キーの集合が得られる。
By performing the above processing on the index words of all the records R1 to R5, a set of arbitrary matching search keys to which the record keys shown in FIG. 3 are added can be obtained.

【0038】ソート処理手段42は索引語抽出処理手段
41が作成した図3の集合中のレコードキーの付加され
た任意一致検索キーに対して昇順のソート(50音順)
を行なう。
The sort processing means 42 sorts in ascending order (in the order of Japanese syllabary) with respect to the arbitrary match search keys to which the record keys in the set of FIG. 3 created by the index word extraction processing means 41 are added.
Do.

【0039】これにより、図4に示す集合が得られる。As a result, the set shown in FIG. 4 is obtained.

【0040】マージ処理手段43はソート処理手段42
が作成した図4の集合に対して以下の処理を行なう。
The merge processing means 43 is a sort processing means 42.
The following processing is performed on the set of FIG.

【0041】マージ処理手段43は、先ず、集合内の先
頭の任意一致検索キーを選択し、それと前方一致する任
意一致検索キーを探す。
The merge processing means 43 first selects an arbitrary matching search key at the head of the set, and searches for an arbitrary matching search key that prefix-matches it.

【0042】前方一致する任意一致検索キーを探し出せ
なかった場合は、上記選択した任意一致検索キーを任意
一致検索インデックス2の任意一致検索キー21の先頭
領域に格納すると共に、上記選択した任意一致検索キー
に付加されているレコードキーを任意一致検索インデッ
クス2のレコードキー22の先頭領域に格納する。
If the forward matching arbitrary matching search key cannot be found, the selected arbitrary matching search key is stored in the head area of the arbitrary matching search key 21 of the arbitrary matching search index 2 and the selected arbitrary matching search is performed. The record key added to the key is stored in the head area of the record key 22 of the arbitrary match search index 2.

【0043】また、前方一致する任意一致検索キーを探
し出せた場合は、探し出した任意一致検索キーの中で最
も文字数の多いものを任意一致検索インデックス2の任
意一致検索キー21の先頭領域に格納すると共に、上記
前方一致した任意一致検索キーに付加されているレコー
ドキーを全て任意一致検索インデックス2のレコードキ
ー22の先頭領域に格納する。
If an arbitrary match search key that matches the prefix can be found, the one having the largest number of characters among the searched arbitrary match search keys is stored in the head area of the arbitrary match search key 21 of the arbitrary match search index 2. At the same time, all the record keys added to the above-mentioned forward matching arbitrary matching search key are stored in the head area of the record key 22 of the arbitrary matching search index 2.

【0044】図4の集合の場合、先頭の任意一致検索キ
ーは「アイウエオ」あり、それと前方一致する任意一致
検索キーは集合内に存在しないので、図5に示すよう
に、任意一致検索インデックス2の任意一致検索キー2
1の先頭領域には任意一致検索キー「アイウエオ」が、
レコードキー22の先頭領域にはレコードキー「DBK
−1」が格納される。
In the case of the set shown in FIG. 4, since the arbitrary matching search key at the head is "aiueo" and there is no arbitrary matching search key prefixed with it, the arbitrary matching search index 2 as shown in FIG. Arbitrary match search key 2
Arbitrary match search key "aiueo" in the first area
In the head area of the record key 22, the record key "DBK
"-1" is stored.

【0045】その後、マージ手段43は集合内の未処理
の任意一致検索キーの内の先頭に最も近いものを選択
し、前述したと同様の処理を行なう。
After that, the merging means 43 selects the unprocessed arbitrary match search key in the set which is closest to the head, and performs the same process as described above.

【0046】図4の集合の場合、未処理の任意一致検索
キーの内の先頭に最も近い任意一致検索キーは「イウ
エ」であるので、それと前方一致する任意一致検索キー
として任意一致検索キー「イウエオ」が探し出される。
また、前方一致する任意一致検索キーの内で最も文字数
の多い任意一致検索キーは「イウエオ」であるので、図
5に示すように、任意一致検索キー21の第2番目の領
域に任意一致検索キー「イウエオ」が格納され、レコー
ドキー22の第2番目の領域に任意一致検索キー「イウ
エオ」,「イウエ」に付加されているレコードキー「D
BK−1,DBK−2」が格納される。
In the case of the set of FIG. 4, since the closest arbitrary match search key among the unprocessed arbitrary match search keys is "Iue", the arbitrary match search key "Iue" is prefixed to it. Iueo "is sought out.
Moreover, since the arbitrary match search key having the largest number of characters among the prefix-matching arbitrary match search keys is “Iueo”, the arbitrary match search key is searched in the second area of the arbitrary match search key 21 as shown in FIG. The key "Iueo" is stored, and the record key "D" added to the arbitrary match search keys "Iueo" and "Iue" is stored in the second area of the record key 22.
BK-1, DBK-2 "is stored.

【0047】以下、未処理の任意一致検索キーがなくな
るまで、前述した処理が行なわれ、図5に示す任意一致
検索インデックス2が作成される。
Thereafter, the above-described processing is performed until the unprocessed arbitrary match search key is exhausted, and the arbitrary match search index 2 shown in FIG. 5 is created.

【0048】次に、任意一致検索を行なう場合の動作を
説明する。
Next, the operation when performing an arbitrary match search will be described.

【0049】サーチ手段1は任意一致検索語が入力され
ると、任意一致検索インデックス2の任意一致検索キー
21の欄に対してバイナリサーチを行ない、入力された
任意一致検索語と前方一致する任意一致検索キーを探し
出し、探し出した任意一致検索キーと対応してレコード
キー22の欄に格納されているレコードキーをデータベ
ースマネージメントシステム3に出力する。
When an arbitrary matching search word is input, the searching means 1 performs a binary search on the column of the arbitrary matching search key 21 of the arbitrary matching search index 2 to find an arbitrary prefix that matches the input arbitrary matching search word. The matching search key is searched for, and the record key stored in the column of the record key 22 corresponding to the searched arbitrary matching search key is output to the database management system 3.

【0050】データベースマネージメントシステム3は
サーチ手段1からレコードキーが加えられると、そのレ
コードキーを有するレコードを出力する。
When the record key is added from the search means 1, the database management system 3 outputs the record having the record key.

【0051】今、例えば、任意一致検索語として「ウ
エ」がサーチ手段1に入力されたとすると、サーチ手段
1は任意一致検索インデックス2の任意一致検索キー2
1の欄に対してバイナリサーチを行ない、任意一致検索
語「ウエ」と前方一致する任意一致検索キー「ウエオ」
を探し出し、探し出した任意一致検索キー「ウエオ」と
対応してレコードキー22の欄に格納されているレコー
ドキー「DBK−1」,「DBK−2」,「DBK−
3」,「DBK−4」をデータベースマネージメントシ
ステム3に出力することになる。
Now, for example, if "u" is input to the search means 1 as an arbitrary match search word, the search means 1 will use the arbitrary match search key 2 of the arbitrary match search index 2.
Performs a binary search on the column 1 and searches for an arbitrary match search key "Ueo" that prefix-matches the arbitrary match search word "Wa"
And the record keys "DBK-1", "DBK-2", and "DBK-" stored in the column of the record key 22 in association with the found arbitrary match search key "WEO".
3 ”and“ DBK-4 ”are output to the database management system 3.

【0052】尚、上述した実施例に於いては、マージ処
理手段43の処理結果を任意一致検索インデックス2と
したが、ソート処理手段42の処理結果(図4に示す集
合)を任意一致検索インデックス2とすることもでき
る。この場合は、マージされていないので、任意一致検
索インデックス2の項目数が多く、マージ処理手段43
の処理結果を任意一致検索インデックス2とした場合に
比べて検索速度は遅くなるが、任意一致検索に於いてバ
イナリサーチを行なうことができるので、従来例に比較
すれば、検索時間は非常に短くなる。
In the above-described embodiment, the processing result of the merge processing means 43 is the arbitrary match search index 2, but the processing result of the sort processing means 42 (the set shown in FIG. 4) is the arbitrary match search index. It can also be 2. In this case, since the merge has not been performed, the number of items in the arbitrary match search index 2 is large, and the merge processing means 43 is used.
Although the search speed is slower than when the processing result of (1) is set to the arbitrary match search index 2, the binary search can be performed in the arbitrary match search, so the search time is very short compared to the conventional example. Become.

【0053】[0053]

【発明の効果】以上説明したように、本発明は各索引語
から索引語中の各文字を先頭文字とする後方の文字列を
抽出することにより得た任意一致検索キーをソートした
任意一致検索インデックスを用いて任意一致検索を行な
うものであり、任意一致検索に於いてもバイナリサーチ
を行なうことができるので、任意一致検索時に於ける検
索時間を短縮することができる効果がある。
As described above, the present invention is an arbitrary match search in which the arbitrary match search keys obtained by extracting a backward character string starting from each character in the index word from each index word are sorted. Since the arbitrary match search is performed using the index, and the binary search can be performed also in the arbitrary match search, there is an effect that the search time in the arbitrary match search can be shortened.

【0054】また、本発明はマージ処理手段により前方
一致する任意一致検索キー同士を1つにマージするの
で、任意一致検索インデックスの項目数を少なくするこ
とができ、従って検索時間を更に短縮することが可能に
なる効果がある。
Further, according to the present invention, since the merge processing means merges the prefix matching arbitrary matching search keys into one, it is possible to reduce the number of items of the optional matching search index, and thus further shorten the searching time. There is an effect that can be.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の実施例のブロック図である。FIG. 1 is a block diagram of an embodiment of the present invention.

【図2】任意一致検索インデックス2の論理構成図であ
る。
FIG. 2 is a logical configuration diagram of an arbitrary match search index 2.

【図3】索引語抽出処理手段41の処理結果の一例を示
す図である。
FIG. 3 is a diagram showing an example of a processing result of an index word extraction processing means 41.

【図4】ソート処理手段42の処理結果の一例を示す図
である。
FIG. 4 is a diagram illustrating an example of a processing result of a sort processing unit 42.

【図5】マージ処理手段43の処理結果の一例を示す図
である。
FIG. 5 is a diagram showing an example of a processing result of a merge processing unit 43.

【図6】データベースの構成例を示す図である。FIG. 6 is a diagram showing a configuration example of a database.

【図7】従来使用されていたインデックスの構成例を示
す図である。
FIG. 7 is a diagram showing a configuration example of an index that has been conventionally used.

【符号の説明】[Explanation of symbols]

1…サーチ手段 2…任意一致検索インデックス 21…任意一致検索キー 22…レコードキー 3…データベースマネージメントシステム 31…索引語 32…属性の組 33…レコードキー 4…任意一致検索インデックス作成手段 41…索引語抽出処理手段 42…ソート処理手段 43…マージ処理手段 1 ... Search means 2 ... Arbitrary match search index 21 ... Arbitrary match search key 22 ... Record key 3 ... Database management system 31 ... Index word 32 ... Attribute set 33 ... Record key 4 ... Arbitrary match search index creation means 41 ... Index word Extraction processing means 42 ... Sort processing means 43 ... Merge processing means

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 索引語を有する複数のレコードから構成
されるデータベースと、 前記各索引語から索引語中の各文字を先頭文字とする後
方の文字列を任意一致検索キーとして抽出し、抽出した
任意一致検索キーとそれを抽出した索引語を含んでいる
レコードのレコードキーとの対応付けを行なう索引語抽
出処理手段と、 該索引語抽出処理手段で抽出され、レコードキーとの対
応付けが行なわれた任意一致検索キーをソートすること
により、前記レコードキーとの対応付けが行なわれた任
意一致検索キーが所定の順序で並んだ任意一致検索イン
デックスを作成するソート処理手段と、 任意一致検索語が入力されることにより、前記任意一致
検索インデックスをバイナリサーチし、前記任意一致検
索語と前方一致する任意一致検索キーを探し出し、探し
出した任意一致検索キーに対応するレコードキーを出力
するサーチ手段とを含むことを特徴とする任意一致検索
方式。
1. A database composed of a plurality of records having index words, and a character string at the back of each index word having each character in the index word as a leading character is extracted as an arbitrary match search key and extracted. Index word extraction processing means for associating the arbitrary match search key with the record key of the record containing the extracted index word, and the association with the record key extracted by the index word extraction processing means Sort processing means for creating an arbitrary match search index in which the arbitrary match search keys associated with the record key are arranged in a predetermined order by sorting the arbitrary match search keys. Is input, a binary search is performed on the arbitrary match search index to find an arbitrary match search key that prefix-matches the arbitrary match search word. An arbitrary match search method, comprising: a search unit that outputs a record key corresponding to the found arbitrary match search key.
【請求項2】 索引語を有する複数のレコードから構成
されるデータベースと、 前記各索引語から索引語中の各文字を先頭文字とする後
方の文字列を任意一致検索キーとして抽出し、抽出した
任意一致検索キーとそれを抽出した索引語を含んでいる
レコードのレコードキーとの対応付けを行なう索引語抽
出処理手段と、該索引語抽出処理手段で抽出され、レコ
ードキーとの対応付けが行なわれた任意一致検索キーを
ソートすることにより、前記レコードキーとの対応付け
が行なわれた任意一致検索キーが所定の順序で並んだ集
合を作成するソート処理手段と、 該ソート処理手段で作成された集合に含まれている任意
一致検索キーの内、前方一致する任意一致検索キー同士
をマージすることにより、前記レコードキーとの対応付
けが行なわれたマージされた任意一致検索キー及びマー
ジされなかった任意一致検索キーが所定の順序で並んだ
任意一致検索インデックスを作成するマージ処理手段
と、 任意一致検索語が入力されることにより、前記任意一致
検索インデックスをバイナリサーチし、前記任意一致検
索語と前方一致する任意一致検索キーを探し出し、探し
出した任意一致検索キーに対応するレコードキーを出力
するサーチ手段とを含むことを特徴とする任意一致検索
方式。
2. A database composed of a plurality of records having index words, and a character string behind each index word having each character in the index word as a leading character is extracted as an arbitrary match search key and extracted. Index word extraction processing means for associating the arbitrary match search key with the record key of the record containing the extracted index word, and the association with the record key extracted by the index word extraction processing means Sort processing means for creating a set in which the arbitrary match search keys associated with the record keys are arranged in a predetermined order by sorting the selected arbitrary match search keys, and the sort processing means Of the arbitrary match search keys included in the set, the forward matching arbitrary match search keys are merged to be associated with the record key. Merge processing means for creating an arbitrary match search index in which a paged arbitrary match search key and a non-merged arbitrary match search key are arranged in a predetermined order; Arbitrary match search characterized by including a search means for performing a binary search on the search index to find an arbitrary match search key that prefix-matches the arbitrary match search word and output a record key corresponding to the found arbitrary match search key. method.
JP4161993A 1992-05-28 1992-05-28 Optional identity retrieval system Pending JPH05334355A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4161993A JPH05334355A (en) 1992-05-28 1992-05-28 Optional identity retrieval system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4161993A JPH05334355A (en) 1992-05-28 1992-05-28 Optional identity retrieval system

Publications (1)

Publication Number Publication Date
JPH05334355A true JPH05334355A (en) 1993-12-17

Family

ID=15745999

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4161993A Pending JPH05334355A (en) 1992-05-28 1992-05-28 Optional identity retrieval system

Country Status (1)

Country Link
JP (1) JPH05334355A (en)

Similar Documents

Publication Publication Date Title
JP2670383B2 (en) Prefix search tree with partial key branch function
US6138114A (en) Sort system for merging database entries
US20200073863A1 (en) System and method for facilitating efficient indexing in a database system
JP2669601B2 (en) Information retrieval method and system
JP2833580B2 (en) Full-text index creation device and full-text database search device
JP2001331509A (en) Relational database processing device, relational database processing method, and computer-readable recording medium recording relational database processing program
CN105404677A (en) Tree structure based retrieval method
JP3258063B2 (en) Database search system and method
US20050065947A1 (en) Thesaurus maintaining system and method
JP3151730B2 (en) Database search system
JPH05334355A (en) Optional identity retrieval system
JP2519130B2 (en) Multi-word information retrieval processing method and retrieval file creation device
JPS617936A (en) Information retrieving system
JP2519129B2 (en) Multi-word information retrieval processing method and retrieval file creation device
JPH11110408A (en) Information retrieval apparatus and method
JP3288063B2 (en) Variable length data storage and reference system
JPH03286371A (en) Document information search device
JP3259781B2 (en) Database search system and database search method
JPS63136224A (en) Automatic key word extracting device
JPH07210565A (en) Information retrieval method and device
JPH04337867A (en) Data base retrieval system
JPH02287876A (en) Text type data base device
KR100440906B1 (en) Method and system for indexing document
WO1992009960A1 (en) Data retrieving device
JPH04270450A (en) document creation device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees