-
Notifications
You must be signed in to change notification settings - Fork 3
/
singletablefacets.yml.dist
executable file
·299 lines (252 loc) · 13.3 KB
/
singletablefacets.yml.dist
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# Configuration file for SingleTableFacets.
#
# This should be copied somewhere OUTSIDE of the publicly available files. Ie,
# if the docroot is /var/www/htdocs, this file should be somewhere above that,
# such as /var/www, or adjacent, such as /var/www/libraries/singletablefacets.
#
# You can have any number of these files, named differently, to set up multiple
# instances of SingleTableFacets. Each time you invoke SingleTableFacets, either
# on a web page or on the command line (for refreshing the data) you reference
# this configuration file.
#
# Because this is a YAML file, remember that whitespace is important.
# Database credentials: this is the only required section.
database name: myDatabase
database user: myUser
database password: myPassword
database host: localhost
database table: myTable
# Everything else in this document is optional.
# Indicate the columns that are required to have data in order for a row to
# appear in the search results. For example, if you don't want any rows to show
# up without titles, make your title column a required column here.
required columns:
- myDatabaseColumn1
# Choose the order that you would like the columns to show in the facet list,
# and indicate the human-readable labels to display above each one.
facet labels:
myDatabaseColumn1: Filter by something
myDatabaseColumn2: Filter by something else
# Choose the order that you would like the fields to show in search results,
# and indicate the human-readable labels to display above each one. There is
# one special field called "stf_score". This is not an actual column in your
# database/spreadsheet, but you can include it here to display a "relevance"
# field in your search results.
search result labels:
myDatabaseColumn2: Something
myDatabaseColumn1: Something Else
stf_score: Keyword Relevance
# If you would like the search results grouped by the value of a certain column,
# indicate that column here.
#search result grouping column: myDatabaseColumn1
# Choose the priority (order) and default direction for the sortable columns.
# As with search result labels, there is a special field called "stf_score",
# which you can include to allow users to sort by (keyword) relevance.
# ASC = ascending, DESC = descending
sort directions:
myDatabaseColumn1: ASC
myDatabaseColumn2: DESC
stf_score: DESC
# Twig templating can be used to produce the output of the row data. To do this,
# create a template file in the folder indicated here, named according to the
# column name, with an extension of ".html.twig". For example, with the example
# location below, to create a template for the "Title" column, you would create
# a file at /path/to/templates/Title.html.twig. If no template is created for
# a column, it will be output as its raw value. The template is passed a "row"
# variable which contains all of the columns from the database. As an additional
# shortcut, it gets a "value" variable which is the value of the column being
# output.
template folder for search results: /path/to/templates
# The above setting supports templating for the row data as displayed in the
# search results. The setting below is the same, except that it is applied to
# the data when displaying a single facet item.
# For facet items, there is no "row" variable, and the "value" variable contains
# the raw value of a particular item within the facet. In addition, the template
# gets passed a "count" variable which you can use to display the item count.
# Any columns not specified here will have their facet items displayed as a raw
# value, possible with the item count, depending on the setting you have set for
# "show counts next to facet items" below.
# In most cases you probably will not need to use this, except in cases where
# you need to filter the facet items, such as to capitalize them, eg:
# {{ value|capitalize }} ({{ count }})
template folder for facet items: /path/to/templates
# Twig offers the ability to load custom functions. If you would like to take
# advantage of this, you can create a single file with PHP functions in it,
# and reference that file here. Note that you must also list the functions to
# load in "list of twig functions" below. For more information on Twig
# functions, see http://twig.sensiolabs.org/doc/advanced.html.
#file with twig functions: /path/to/my-twig-function-file.php
# If you indicated a file with Twig functions above, you also need to list the
# names of all the functions you want to use.
#list of twig functions:
# - my_first_twig_function
# - my_second_twig_function
# List the columns that contain URLs pointing to files with keywords. The
# keywords in these files will be crawled and indexed. Note, this only works on
# PDF and HTML files.
keywords in files:
- myDatabaseColumn2
# When crawling remote URLs for keywords, add this prefix to any relative URLs.
# For example, if this is set to: "http://example.com/files/", then a relative
# URL of "mydoc.pdf" will be fetched from "http://example.com/files/mydoc.pdf".
prefix for relative keyword URLs: http://example.com/files/
# Along the same sames as "prefix for relative keyword URLs" but a suffix instead.
# Used mainly to add a file extension if needed. Example:
#suffix for relative keyword URLs: .pdf
# List the facet columns that should be collapsed at a certain point. Use 0 to
# collapse all items, or for example, 5 to collapse items in excess of 5.
collapse facet items:
myDatabaseColumn1: 0
myDatabaseColumn2: 5
# List the columns that should function as additional values for another facet.
# For example, if you have a Tag and Tag2 column, you could indicate that Tag2
# is just additional values for Tag, and they would both appear together.
# This is the ONLY way to give one item multiple values in a single facet.
columns for additional values:
# Extra column: Main column
myDatabaseColumn1: myDatabaseColumn2
# Date granularity can be set for each column. This determines how far the date
# facets will "drill down". The choices are: "year", "month", "day". The default
# is "month", for any columns not specified here.
#date facet granularity:
# myDatabaseColumn1: year
# myDatabaseColumn2: month
# List the facet columns that depend on other facets. For example, if you don't
# want "Sub Category" to appear unless "Category" is active, you can set that
# here. This is the only way to imitate a hierarchical setup, and works well
# with "show dependents indented to the right" below.
dependent columns:
# Child column: Main column
myDatabaseColumn1: myDatabaseColumn2
# Indent dependents to the right and hide their titles. This gives the effect
# that they are being shown in a hierarchical way.
show dependents indented to the right: true
# Choose a type of display for the search results. The choices are:
# "list", "table". Default is "table".
search result display: table
# List the HTML table columns you would like to give a minimum width (CSS).
# This can be used to cut down on undesirable text wrapping.
minimum column widths:
myDatabaseColumn1: 75px
# Next to facet items, show the totals in parenthesis.
show counts next to facet items: true
# Choose the text for the keyword search button.
search button text: Search
# Choose the text for the message that shows when there are no results.
no results message: |
<p>
Sorry, no results could be found for those keywords.
</p>
# Display the facet items as checkboxes instead of links.
use checkboxes for facets instead of links: true
# For each page of results, show this many results.
number of items per page: 20
# In the pager, show direct links to this many pages. (Besides the normal
# "Next" and "Previous" buttons.)
number of pager links to show: 5
# Show this blurb in an expandable section beneath the keyword search.
keyword help: |
<ul>
<li>Use the checkboxes on the left to refine your search, or enter new keywords to start over.</li>
<li>Enter multiple keywords to get fewer results, eg: cat dogs</li>
<li>Use OR to get more results, eg: cats OR dogs</li>
<li>Put a dash (-) before a keyword to exclude it, eg: dogs -lazy</li>
<li>Use "" (double-quotes) to match specific phrases, eg: "the quick brown fox"</li>
</ul>
# Users will click this label to expand the help text above.
keyword help label: "Need help searching?"
# Show the text on keyword input box before enter any character.
keyword placeholder: "Search ..."
# The items within a given facet are normally sorted alphabetically, but setting
# this to true will sort them by their counts, in descending order.
sort facet items by popularity: false
# Optionally specify the minimum counts a facet item must have in order to display.
#minimum facet counts:
# myDatabaseColumn1: 10
# myDatabaseColumn2: 5
# Optionally override the minimum counts set above whenever the user is performing a search.
#minimum facet counts during search:
# myDatabaseColumn1: 1
# myDatabaseColumn2: 1
# As mentioned above, the items within a given facet are normally sorted
# alphabetically, as are the search results in a table layout when a particular
# column is click-sorted. This can be a problem when a more "natural" sort is
# needed. For example, computers will place "Foo10" before "Foo2", because of
# the fact that "1" comes before "2". (The computer doesn't care about the extra
# "0" after the "1".) If you would like more natural sorting for particular
# columns, you can indicate those here. However, be aware that the mechanism
# used to make it "natural" is the length of each item. So, "Foo2" would come
# before "Foo10" because of the fact that it's only 4 character long instead of
# 5. So, only turn this on for columns where you are sure that the length of the
# items a suitable criteria for the sorting.
#columns with natural sorting:
# - myDatabaseColumn1
# Normally when users do a keyword search, the full text (crawled) data is
# included. However if you would like to exclude the full text by default, and
# give the user the option to include it, set this to true.
allow user to exclude full text from keyword search: false
# Out of the box, the system uses MySQL's "Boolean" full-text search system.
# You can read about its supported operators here:
# https://dev.mysql.com/doc/refman/5.5/en/fulltext-boolean.html
# You may find you want different behavior, though, from what MySQL decided on.
# Here a couple of ways to tweak the behavior.
# By default, multiple keywords are treated as an "OR" query. If users want to
# get "AND" behavior, they have to put "+" in front of each word. If you would
# like the default to be "AND", set this value to true. To demonstrate this
# behavior, the following two keyword searches would give identical results:
# - this setting set to false: +dogs +cats
# - this setting set to true: dogs cats
# As another demonstration, the following two keyword searches would also give
# identical results:
# - this setting set to false: dogs cats
# - this setting set to true: dogs OR cats
use AND for keyword logic by default: false
# By default the partial word matches will not give results. For example, if
# a row's keywords are all "cats", a search for "cat" will not find results.
# Users can deal with this by putting asterisks at the end of words. For example
# a search for "cat*" would match both "cat" and "cats" (and any other word
# that starts with c-a-t). If you would like all user keywords to be treated
# in this way (automatically getting an asterisk at the end) then set this value
# to true.
automatically put wildcards on keywords entered: false
# If the environment needs to use a proxy, uncomment and fill out this section.
# proxy: 192.168.1.1:8080
# To prevent the use of the proxy for certain URLs, enter partial patterns here.
# proxy exceptions:
# - .example.com
# If there are any special characters or phrases that need to be altered when
# importing the data from the CSV file, indicate those here. For example, to
# change all occurences of § with § uncomment the lines below.
#text alterations:
# "§": "§"
# Additionally you can specify alterations for a particular column only.
#text alterations per column:
# myDatabaseColumn1:
# "§": "§"
# This specifies an alternate location to look for the javascript and CSS files.
# The default is to look in an "assets" folder in same directory as the search
# page.
location of assets: /assets
# Set this to true if you would like to hide search results until at least one
# facet items is active or keywords have been submitted.
require input for search results: false
# If you would like any of the facets to be single-choice only, list them here.
#facets limited to one choice:
# - myDatabaseColumn1
# If you would like the search results to start with any facet values already
# selected, enter those values here. Probably most useful along with the above
# option for "facets limited to one choice".
#prepopulated facet values:
# myDatabaseColumn1: 'my value'
# Set the delimiter for CSV imports. Defaults to a comma.
csv delimiter: ','
# Set the enclosure for CSV imports Defaults to a double-quote.
csv enclosure: '"'
# Prepare keywords search with regex replacements
#regex input alterations:
# Replace all - to be a space
# '/\-/': ' '
# Replace all . to be a space
# '/\./': ' '
# For phone number support, look for 10 digits and format to 3 3 4, eg: 1234567890 -> 123 456 778
# '/^([\d]{3})([\d]{3})([\d]{4})$/': '$1 $2 $3'