1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="utf-8 ">
5
+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
7
+ <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
8
+ < title > IBM Cloud Data Services | Simple Autocomplete Service</ title >
9
+
10
+ < link href ="css/master.css " rel ="stylesheet ">
11
+ < link href ="css/sas.css " rel ="stylesheet ">
12
+ </ head >
13
+
14
+ < body class ="capped-layout ">
15
+ < header class ="capped-layout_cap app-banner ">
16
+ < a class ="app-banner_title " rel ="home " href ="https://developer.ibm.com/clouddataservices "> IBM Cloud Data Services // Dev</ a >
17
+ </ header >
18
+
19
+ < div class ="capped-layout_body bookend-layout ">
20
+ < nav class ="bookend-layout_bookend theme_dark ">
21
+ < ul class ="tree-nav ">
22
+ < li class ="tree-nav_item ">
23
+ < a class ="tree-nav_link " href ="/ "> Simple Autocomplete Service</ a >
24
+ < ul class ="tree-nav ">
25
+ < li class ="tree-nav_item "> < a class ="tree-nav_link " href ="/autocomplete.html "> Autocomplete Indexes</ a > </ li >
26
+ < li class ="tree-nav_item "> < a class ="tree-nav_link " href ="#indexadd "> Create an Index</ a > </ li >
27
+ </ ul >
28
+ </ li >
29
+ < li class ="tree-nav_item ">
30
+ < a class ="tree-nav_link " href ="/doc.html "> Documentation</ a >
31
+ < ul class ="tree-nav ">
32
+ < li class ="tree-nav_item "> < a class ="tree-nav_link " href ="/doc.html#apilist "> API</ a > </ li >
33
+ < li class ="tree-nav_item "> < a class ="tree-nav_link " href ="/doc.html#lockdown "> Lockdown Mode</ a > </ li >
34
+ < li class ="tree-nav_item "> < a class ="tree-nav_link " href ="/doc.html#codesamples "> Code Samples</ a > </ li >
35
+ </ ul >
36
+ </ li >
37
+ </ ul >
38
+ </ nav >
39
+
40
+ < div class ="bookend-layout_body theme_light bg_white ">
41
+ < header class ="layout_section theme_light ">
42
+ < h1 class ="type_heading "> Autocomplete Indexes</ h1 >
43
+ < p class ="type_copy ">
44
+ A Node.js app that uses an attached Redis database to provide an autocomplete API for
45
+ data uploaded as text files. Multiple separate autocomplete indexes are supported.
46
+ </ p >
47
+ </ header >
48
+
49
+ <!-- start index listing -->
50
+ < section class ="layout_section ">
51
+ < div id ="indexlist "> </ div >
52
+ < h2 class ="type_heading type_mark "> Current Indexes</ h2 >
53
+ < p class ="type_copy "> The following indexes are currently available</ p >
54
+ < div id ="thetable " class ="table_basic-container ">
55
+ <!-- table of indexes goes here -->
56
+ </ div >
57
+ </ section >
58
+ <!-- end index listing -->
59
+
60
+ <!-- start create index -->
61
+ < section class ="layout_section ">
62
+ < hr >
63
+ < div id ="indexadd "> </ div >
64
+ < h2 class ="type_heading type_mark "> Create an Index</ h2 >
65
+ < p class ="type_copy "> Indexes can be created by uploading a local file or adding a remote URL</ p >
66
+
67
+ < div class ="tabbed-panel ">
68
+ < ul class ="tabbed-panel_tab-group ">
69
+ < li class ="tabbed-panel_tab "> < a href ="#indexfromfileupload "> Local File</ a > </ li >
70
+ < li class ="tabbed-panel_tab "> < a href ="#indexfromfileurl "> Remote File</ a > </ li >
71
+ </ ul >
72
+ <!-- start upload file panel -->
73
+ < div id ="indexfromfileupload " class ="tabbed-panel_panel bg_light-tint ">
74
+ < form id ="uploadform " class ="form " action ="/api/upload " method ="post " enctype ="multipart/form-data ">
75
+ < fieldset class ="form_field ">
76
+ < label class ="form_label " for ="name "> Index name</ label >
77
+ < input id ="name " class ="input_text " type =text name ="name " value ="test " required >
78
+ </ fieldset >
79
+ < fieldset class ="form_field ">
80
+ < label class ="form_label " for ="file "> File</ label >
81
+ < input id ="file " class ="input_file " type ="file " name ="file " required >
82
+ < label class ="input_file-handle " for ="file "> Select a File</ label >
83
+ </ fieldset >
84
+ < div class ="button_group ">
85
+ < button id ="submitbutton " type ="submit " class ="button_primary "> Upload</ button >
86
+ </ div >
87
+ </ form >
88
+ </ div >
89
+ <!-- end upload file panel -->
90
+ <!-- start add url panel -->
91
+ < div id ="indexfromfileurl " class ="tabbed-panel_panel bg_light-tint ">
92
+ < p class ="type_copy ">
93
+ No data. No problem. < button class ="type_link " onclick ="toggle('.remote-files') "> We got you covered.</ button >
94
+ </ p >
95
+ < div class ="button_group remote-files hidden ">
96
+ < button type ="button " class ="button_secondary btn-shortcut "
97
+ data-url ="https://raw.githubusercontent.com/glynnbird/simple-autocomplete-service/master/data/countries.txt "
98
+ data-name ="countries "> Countries (194)</ button >
99
+ < button type ="button " class ="button_secondary btn-shortcut "
100
+ data-url ="https://raw.githubusercontent.com/glynnbird/simple-autocomplete-service/master/data/uktowns.txt "
101
+ data-name ="towns "> UK Towns (992)</ button >
102
+ < button type ="button " class ="button_secondary btn-shortcut "
103
+ data-url ="https://raw.githubusercontent.com/glynnbird/simple-autocomplete-service/master/data/uspresidents.txt "
104
+ data-name ="presidents "> US Presidents (43)</ button >
105
+ < button type ="button " class ="button_secondary btn-shortcut "
106
+ data-url ="https://raw.githubusercontent.com/glynnbird/simple-autocomplete-service/master/data/names.txt "
107
+ data-name ="names "> Names (4995)</ button >
108
+ </ div >
109
+ < form id ="submiturlform " class ="form " action ="/api/uploadurl " method ="post " enctype ="multipart/form-data ">
110
+ < fieldset class ="form_field ">
111
+ < label class ="form_label " for ="urlname "> Index name</ label >
112
+ < input id ="urlname " class ="input_text " type =text name ="name " value ="test " required >
113
+ </ fieldset >
114
+ < fieldset class ="form_field ">
115
+ < label class ="form_label " for ="url "> URL</ label >
116
+ < input id ="url " class ="input_text " type ="url " name ="url " placeholder ="Enter a URL " required >
117
+ </ fieldset >
118
+ < div class ="button_group ">
119
+ < button id ="submiturlbutton " type ="submit " class ="button_primary "> Add</ button >
120
+ </ div >
121
+ </ form >
122
+ </ div >
123
+ <!-- end add url panel -->
124
+ </ div >
125
+ </ section >
126
+ <!-- end create index -->
127
+
128
+ </ div >
129
+ </ div >
130
+
131
+ < script src ="https://code.jquery.com/jquery-2.2.2.min.js "> </ script >
132
+ < script src ="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js "> </ script >
133
+ < script src ="js/sas.js "> </ script >
134
+ </ body >
135
+ </ html >
0 commit comments