This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathimdb_search.layer.lkml
65 lines (55 loc) · 1.62 KB
/
imdb_search.layer.lkml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# Unfied Single Filter
#
include: "imdb_bigquery.model"
include: "//search_block/lib/search.block"
include: "//search_block/lib/search_bigquery.block"
explore: +title_base {
extends: [search_explore]
}
view: +title_base {
extends: [search_view]
filter: search {
suggest_explore: title_base_search
}
}
# the explore to build suggestions from...
explore: build_suggest {
extends: [title_base]
from: title
view_name: title
hidden: yes
}
explore: title_base_search {
extends: [search_suggest]
}
view: +search_map {
dimension: map {
hidden: yes
sql:
[
STRUCT('title.kind_of_title' as search_field, ${title.kind_of_title} as search_value),
STRUCT('name.person_name', ${name.person_name}),
STRUCT('char_name.character_name', ${char_name.character_name}),
STRUCT('company_name.company_name', ${company_name.company_name}),
STRUCT('movie_genre.genre', ${movie_genre.genre}),
STRUCT('movie_keyword.keyword', ${movie_keyword.keyword}),
STRUCT('tv_series.tv_series_title', ${tv_series.tv_series_title}),
STRUCT('title.title', ${title.title}),
STRUCT('cast_info.role', ${cast_info.role})
]
;;
}
#dimension: search_primary_key {sql: ${title_base.id2} ;; }
#dimension: search_date {sql: DATE_TRUNC(${title_base.production_year}, MONTH) ;; }
measure: search_weight {
label: "Title Count"
type: count_distinct
sql: ${title.id} ;;
drill_fields: [title.id, title.title, title.production_year]
}
dimension: search_primary_key {sql: ${title.id} ;;}
}
view: +search_suggest {
dimension: search_date {type:date_month}
}