...
In fact, the BITMAP index in Doris is a simple inverted index. But it lack text tokenization, efficient dictionary, search query syntax to support mature fulltext search.
Detailed Design
...
Functionality
- add a new index type INVERTED index
- support create INVERTED index with tokenizer and fast fulltext search on text column with type char/varchar/string.
- support create INVERTED index without tokenizer and fast equal, range operators on text column with type char/varchar/string.
- support create INVERTED index without tokenizer and fast equal, range operators on numeric column with type int*/float*/date/datetime.
User interface
- create table with INVERTED index
| Code Block |
|---|
|
CREATE TABLE httplogs (
ts datetime,
clientip varchar(20),
request string,
status smallint,
size int,
INDEX idx_size (size) USING INVERTED,
INDEX idx_status (status) USING INVERTED,
INDEX idx_clientip (clientip) USING INVERTED PROPERTIES("tokenizer"="none"),
) ENGINE=OLAP
DUPLICATE KEY(ts);
|
- add an INVERTED index to a table
| Code Block |
|---|
|
CREATE INDEX idx_request ON httplogs(request) USING INVERTED PROPERTIES("tokenizer"="english") |
| Code Block |
|---|
|
SELECT * FROM httplogs WHERE request MATCH 'login'; |
| Code Block |
|---|
|
SELECT * FROM httplogs WHERE status = 404; |
| Code Block |
|---|
|
SELECT COUNT() FROM httplogs WHERE size > 1024; |
Implementation
Scheduling
specific implementation steps and approximate scheduling.