1 /*
2 * Copyright 2012-2025 CodeLibs Project and the Others.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13 * either express or implied. See the License for the specific language
14 * governing permissions and limitations under the License.
15 */
16 package org.codelibs.fess;
17
18 import java.util.TimeZone;
19 import java.util.regex.Pattern;
20
21 import org.codelibs.core.CoreLibConstants;
22 import org.codelibs.core.lang.StringUtil;
23
24 /**
25 * Constants class that extends CoreLibConstants and contains application-wide constant values for the Fess search engine.
26 * This class provides constants for system configuration, crawling and indexing defaults, user agent strings,
27 * status values, field names, date/time formats, authentication types, and various reserved words and patterns.
28 *
29 * <p>Key constant categories include:</p>
30 * <ul>
31 * <li>System configuration property keys</li>
32 * <li>Default values for crawling and indexing operations</li>
33 * <li>User agent strings and patterns for web crawling</li>
34 * <li>Status constants for job execution and system states</li>
35 * <li>Field names and keys used throughout the application</li>
36 * <li>Date/time format patterns</li>
37 * <li>Authentication type identifiers</li>
38 * <li>Reserved words and regex patterns for query processing</li>
39 * </ul>
40 */
41 public class Constants extends CoreLibConstants {
42
43 /**
44 * Private constructor to prevent instantiation of this utility class.
45 * This class contains only static constants and should not be instantiated.
46 */
47 private Constants() {
48 // Utility class - no instantiation
49 }
50
51 // ============================================================
52 // System and UI Constants
53 // ============================================================
54
55 /** System line separator character sequence. */
56 public static final String LINE_SEPARATOR = System.lineSeparator();
57
58 /** Default page number for admin interface pagination. */
59 public static final int DEFAULT_ADMIN_PAGE_NUMBER = 1;
60
61 /** String constant representing boolean true value. */
62 public static final String TRUE = "true";
63
64 /** String constant representing boolean false value. */
65 public static final String FALSE = "false";
66
67 /** Boolean constant representing true value. */
68 public static final Boolean T = true;
69
70 /** Boolean constant representing false value. */
71 public static final Boolean F = false;
72
73 /** Constant for score field identifier. */
74 public static final String SCORE = "score";
75
76 /** Constant for searcher identifier. */
77 public static final String SEARCHER = "searcher";
78
79 /** Constant representing "on" state. */
80 public static final String ON = "on";
81
82 // ============================================================
83 // Status Constants
84 // ============================================================
85
86 /** Status constant representing ready state. */
87 public static final String READY = "ready";
88
89 /** Status constant representing running state. */
90 public static final String RUNNING = "running";
91
92 /** Status constant representing done/completed state. */
93 public static final String DONE = "done";
94
95 /** Status constant representing successful operation. */
96 public static final String OK = "ok";
97
98 /** Status constant representing failed operation. */
99 public static final String FAIL = "fail";
100
101 /** Status constant representing stopped state. */
102 public static final String STOP = "stop";
103
104 /** Constant representing automatic mode. */
105 public static final String AUTO = "auto";
106
107 /** Constant representing no value or empty state. */
108 public static final String NONE = "none";
109
110 // ============================================================
111 // Item/Field Identifiers
112 // ============================================================
113
114 /** Item property key for label field. */
115 public static final String ITEM_LABEL = "label";
116
117 /** Item property key for value field. */
118 public static final String ITEM_VALUE = "value";
119
120 /** Item property key for name field. */
121 public static final String ITEM_NAME = "name";
122
123 /** Character encoding constant for Japanese MS932. */
124 public static final String MS932 = "MS932";
125
126 // ============================================================
127 // Default Configuration Values
128 // ============================================================
129
130 /** Default cron expression for general scheduling (daily at midnight). */
131 public static final String DEFAULT_CRON_EXPRESSION = "0 0 * * *";
132
133 /** Default cron expression for search log processing (every minute). */
134 public static final String DEFAULT_SEARCH_LOG_CRON_EXPRESSION = "* * * * *";
135
136 /** Default cron expression for daily tasks (daily at midnight). */
137 public static final String DEFAULT_DAILY_CRON_EXPRESSION = "0 0 * * *";
138
139 /** Default cron expression for hourly tasks (every hour). */
140 public static final String DEFAULT_HOURLY_CRON_EXPRESSION = "0 * * * *";
141
142 /** Default interval time in milliseconds for file system crawling. */
143 public static final int DEFAULT_INTERVAL_TIME_FOR_FS = 1000;
144
145 /** Default interval time in milliseconds for web crawling. */
146 public static final int DEFAULT_INTERVAL_TIME_FOR_WEB = 10000;
147
148 /** Default number of threads for file system crawling. */
149 public static final int DEFAULT_NUM_OF_THREAD_FOR_FS = 5;
150
151 /** Default number of threads for web crawling. */
152 public static final int DEFAULT_NUM_OF_THREAD_FOR_WEB = 1;
153
154 /** Default execution interval in milliseconds for crawling operations. */
155 public static final long DEFAULT_CRAWLING_EXECUTION_INTERVAL = 5000L;
156
157 // ============================================================
158 // User Agent Configuration
159 // ============================================================
160
161 /** Prefix for Fess crawler user agent string. */
162 public static final String CRAWLING_USER_AGENT_PREFIX = "Mozilla/5.0 (compatible; Fess/";
163
164 /** Suffix for Fess crawler user agent string with bot information URL. */
165 public static final String CRAWLING_USER_AGENT_SUFFIX = "; +http://fess.codelibs.org/bot.html)";
166
167 /** Date format pattern for document index suffix generation. */
168 public static final String DOCUMENT_INDEX_SUFFIX_PATTERN = "yyyyMMddHHmmssSSS";
169
170 // ============================================================
171 // System Property Keys
172 // ============================================================
173
174 /** Property key for user information configuration. */
175 public static final String USER_INFO_PROPERTY = "user.info";
176
177 /** Property key for user favorite functionality configuration. */
178 public static final String USER_FAVORITE_PROPERTY = "user.favorite";
179
180 /** Property key for search log configuration. */
181 public static final String SEARCH_LOG_PROPERTY = "search.log";
182
183 /** Property key for appending query parameters configuration. */
184 public static final String APPEND_QUERY_PARAMETER_PROPERTY = "append.query.parameter";
185
186 /** Property key for incremental crawling configuration. */
187 public static final String INCREMENTAL_CRAWLING_PROPERTY = "crawling.incremental";
188
189 /** Property key for crawling thread count configuration. */
190 public static final String CRAWLING_THREAD_COUNT_PROPERTY = "crawling.thread.count";
191
192 /** Property key for crawling user agent configuration. */
193 public static final String CRAWLING_USER_AGENT_PROPERTY = "crawling.user.agent";
194
195 /** Property key for cleanup day interval configuration. */
196 public static final String DAY_FOR_CLEANUP_PROPERTY = "day.for.cleanup";
197
198 // ============================================================
199 // Web API Property Keys
200 // ============================================================
201
202 /** Property key for JSON web API configuration. */
203 public static final String WEB_API_JSON_PROPERTY = "web.api.json";
204
205 /** Property key for suggest web API configuration. */
206 public static final String WEB_API_SUGGEST_PROPERTY = "web.api.suggest";
207
208 /** Property key for GSA web API configuration. */
209 public static final String WEB_API_GSA_PROPERTY = "web.api.gsa";
210
211 /** Property key for popular word web API configuration. */
212 public static final String WEB_API_POPULAR_WORD_PROPERTY = "web.api.popularword";
213
214 /** Property key for system properties configuration. */
215 public static final String APP_VALUE_PROPERTY = "system.properties";
216
217 /** Property key for default label value configuration. */
218 public static final String DEFAULT_LABEL_VALUE_PROPERTY = "label.value";
219
220 /** Property key for default sort value configuration. */
221 public static final String DEFAULT_SORT_VALUE_PROPERTY = "sort.value";
222
223 /** Property key for virtual host value configuration. */
224 public static final String VIRTUAL_HOST_VALUE_PROPERTY = "virtual.host.value";
225
226 /** Property key for login requirement configuration. */
227 public static final String LOGIN_REQUIRED_PROPERTY = "login.required";
228
229 /** Property key for result collapse configuration. */
230 public static final String RESULT_COLLAPSED_PROPERTY = "result.collapsed";
231
232 /** Property key for login link enabled configuration. */
233 public static final String LOGIN_LINK_ENALBED_PROPERTY = "login.link.enabled";
234
235 /** Property key for thumbnail enabled configuration. */
236 public static final String THUMBNAIL_ENALBED_PROPERTY = "thumbnail.enabled";
237
238 /** Property key for failure type ignore configuration. */
239 public static final String IGNORE_FAILURE_TYPE_PROPERTY = "failure.ignoretype";
240
241 /** Property key for failure count threshold configuration. */
242 public static final String FAILURE_COUNT_THRESHOLD_PROPERTY = "failure.countthreshold";
243
244 /** Property key for CSV file encoding configuration. */
245 public static final String CSV_FILE_ENCODING_PROPERTY = "csv.file.encoding";
246
247 // ============================================================
248 // Data Purge Property Keys
249 // ============================================================
250
251 /** Property key for search log purge day configuration. */
252 public static final String PURGE_SEARCH_LOG_DAY_PROPERTY = "purge.searchlog.day";
253
254 /** Property key for user info purge day configuration. */
255 public static final String PURGE_USER_INFO_DAY_PROPERTY = "purge.userinfo.day";
256
257 /** Property key for job log purge day configuration. */
258 public static final String PURGE_JOB_LOG_DAY_PROPERTY = "purge.joblog.day";
259
260 /** Property key for bot-based purge configuration. */
261 public static final String PURGE_BY_BOTS_PROPERTY = "purge.by.bots";
262
263 /** Property key for search file proxy configuration. */
264 public static final String SEARCH_FILE_PROXY_PROPERTY = "search.file.proxy";
265
266 // ============================================================
267 // Notification Property Keys
268 // ============================================================
269
270 /** Property key for notification recipient configuration. */
271 public static final String NOTIFICATION_TO_PROPERTY = "notification.to";
272
273 /** Property key for Slack webhook URLs configuration. */
274 public static final String SLACK_WEBHOOK_URLS_PROPERTY = "slack.webhook.urls";
275
276 /** Property key for Google Chat webhook URLs configuration. */
277 public static final String GOOGLE_CHAT_WEBHOOK_URLS_PROPERTY = "google.chat.webhook.urls";
278
279 /** Property key for log notification enabled configuration. */
280 public static final String LOG_NOTIFICATION_ENABLED_PROPERTY = "log.notification.enabled";
281
282 /** Property key for log notification level configuration. */
283 public static final String LOG_NOTIFICATION_LEVEL_PROPERTY = "fess.log.notification.level";
284
285 /** Property key for browser locale usage in search configuration. */
286 public static final String USE_BROWSER_LOCALE_FOR_SEARCH_PROPERTY = "search.use.browser.locale";
287
288 // ============================================================
289 // Suggest and LTR Property Keys
290 // ============================================================
291
292 /** Property key for suggest search log configuration. */
293 public static final String SUGGEST_SEARCH_LOG_PROPERTY = "suggest.searchlog";
294
295 /** Property key for suggest documents configuration. */
296 public static final String SUGGEST_DOCUMENTS_PROPERTY = "suggest.document";
297
298 /** Property key for suggest search log purge day configuration. */
299 public static final String PURGE_SUGGEST_SEARCH_LOG_DAY_PROPERTY = "purge.suggest.searchlog.day";
300
301 /** Property key for LTR model name configuration. */
302 public static final String LTR_MODEL_NAME_PROPERTY = "ltr.model.name";
303
304 /** Property key for LTR window size configuration. */
305 public static final String LTR_WINDOW_SIZE_PROPERTY = "ltr.window.size";
306
307 /** Property key for SSO type configuration. */
308 public static final String SSO_TYPE_PROPERTY = "sso.type";
309
310 // ============================================================
311 // Request and Field Constants
312 // ============================================================
313
314 /** Request attribute key for storing queries. */
315 public static final String REQUEST_QUERIES = "fess.Queries";
316
317 /** Request attribute key for storing highlight queries. */
318 public static final String HIGHLIGHT_QUERIES = "fess.HighlightQueries";
319
320 /** Request attribute key for storing field logs. */
321 public static final String FIELD_LOGS = "fess.FieldLogs";
322
323 // ============================================================
324 // Date/Time Format Constants
325 // ============================================================
326
327 /** Default datetime format pattern without timezone. */
328 public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
329
330 /** ISO datetime format pattern with milliseconds and UTC timezone. */
331 public static final String ISO_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
332
333 /** Date optional time format identifier. */
334 public static final String DATE_OPTIONAL_TIME = "date_optional_time";
335
336 // ============================================================
337 // Default Values and Status
338 // ============================================================
339
340 /** Status code representing completed/done state. */
341 public static final int DONE_STATUS = 9999;
342
343 /** Default value for ignore failure type (empty string). */
344 public static final String DEFAULT_IGNORE_FAILURE_TYPE = StringUtil.EMPTY;
345
346 /** Default failure count value (-1 indicates no limit). */
347 public static final Integer DEFAULT_FAILURE_COUNT = -1;
348
349 /** Default purge day value (-1 indicates no purging). */
350 public static final String DEFAULT_PURGE_DAY = "-1";
351
352 /** Default suggest purge day value (30 days). */
353 public static final String DEFAULT_SUGGEST_PURGE_DAY = "30";
354
355 /** Default list of bot user agents to purge from logs. */
356 public static final String DEFAULT_PURGE_BY_BOTS =
357 "Crawler,crawler,Bot,bot,Slurp,Yeti,Baidu,Steeler,ichiro,hotpage,Feedfetcher,ia_archiver,Y!J-BRI,Google Desktop,Seznam,Tumblr,YandexBot,Chilkat,CloudFront,Mediapartners,MSIE 6";
358
359 /** Default from email address for notifications. */
360 public static final String DEFAULT_FROM_EMAIL = "Administrator <root@localhost>";
361
362 // ============================================================
363 // Crawler Info Map Keys
364 // ============================================================
365
366 /** Info map key for crawler status information. */
367 public static final String CRAWLER_STATUS = "CrawlerStatus";
368
369 /** Info map key for crawler error information. */
370 public static final String CRAWLER_ERRORS = "CrawlerErrors";
371
372 /** Info map key for crawler start time. */
373 public static final String CRAWLER_START_TIME = "CrawlerStartTime";
374
375 /** Info map key for crawler end time. */
376 public static final String CRAWLER_END_TIME = "CrawlerEndTime";
377
378 /** Info map key for crawler execution time. */
379 public static final String CRAWLER_EXEC_TIME = "CrawlerExecTime";
380
381 /** Info map key for web/file system crawler start time. */
382 public static final String WEB_FS_CRAWLER_START_TIME = "WebFsCrawlStartTime";
383
384 /** Info map key for web/file system crawler end time. */
385 public static final String WEB_FS_CRAWLER_END_TIME = "WebFsCrawlEndTime";
386
387 /** Info map key for data crawler start time. */
388 public static final String DATA_CRAWLER_START_TIME = "DataCrawlStartTime";
389
390 /** Info map key for data crawler end time. */
391 public static final String DATA_CRAWLER_END_TIME = "DataCrawlEndTime";
392
393 /** Info map key for web/file system crawling execution time. */
394 public static final String WEB_FS_CRAWLING_EXEC_TIME = "WebFsCrawlExecTime";
395
396 /** Info map key for web/file system indexing execution time. */
397 public static final String WEB_FS_INDEX_EXEC_TIME = "WebFsIndexExecTime";
398
399 /** Info map key for web/file system index size. */
400 public static final String WEB_FS_INDEX_SIZE = "WebFsIndexSize";
401
402 /** Info map key for data crawling execution time. */
403 public static final String DATA_CRAWLING_EXEC_TIME = "DataCrawlExecTime";
404
405 /** Info map key for data indexing execution time. */
406 public static final String DATA_INDEX_EXEC_TIME = "DataIndexExecTime";
407
408 /** Info map key for data index size. */
409 public static final String DATA_INDEX_SIZE = "DataIndexSize";
410
411 /** Session identifier key. */
412 public static final String SESSION_ID = "sessionId";
413
414 /** Crawling information identifier key. */
415 public static final String CRAWLING_INFO_ID = "crawlingInfoId";
416
417 /** Indexing target identifier key. */
418 public static final String INDEXING_TARGET = "indexingTarget";
419
420 /** Number of threads configuration key. */
421 public static final String NUM_OF_THREADS = "numOfThreads";
422
423 // ============================================================
424 // Authentication Type Constants
425 // ============================================================
426
427 /** Basic authentication type identifier. */
428 public static final String BASIC = "BASIC";
429
430 /** Digest authentication type identifier. */
431 public static final String DIGEST = "DIGEST";
432
433 /** NTLM authentication type identifier. */
434 public static final String NTLM = "NTLM";
435
436 /** Form-based authentication type identifier. */
437 public static final String FORM = "FORM";
438
439 /** Samba authentication type identifier. */
440 public static final String SAMBA = "SAMBA";
441
442 /** FTP authentication type identifier. */
443 public static final String FTP = "FTP";
444
445 // ============================================================
446 // Query Reserved Characters and Patterns
447 // ============================================================
448
449 /** Array of reserved characters for query processing. */
450 public static final String[] RESERVED =
451 { "\\", "+", "-", "&&", "||", "!", "(", ")", "{", "}", "[", "]", "^", "~", "*", "?", ";", ":", "/" };
452
453 /** Pattern for detecting reserved characters in Lucene field queries. */
454 public static final Pattern LUCENE_FIELD_RESERVED_PATTERN = Pattern.compile("([+\\-!\\(\\){}\\[\\]^\"~\\\\:\\p{Zs}]|(&&)|(\\|\\|))"); // "*", "?",
455
456 /** Pattern for detecting reserved characters in Lucene range field queries. */
457 public static final Pattern LUCENE_RANGE_FIELD_RESERVED_PATTERN = Pattern.compile("([!\\(\\){}\\[\\]\"~\\\\:\\p{Zs}]|(&&)|(\\|\\|))");
458
459 // ============================================================
460 // Query and Search Constants
461 // ============================================================
462
463 /** Default query operator configuration key. */
464 public static final String DEFAULT_QUERY_OPERATOR = "fess.DefaultQueryOperator";
465
466 /** Search log access type field name. */
467 public static final String SEARCH_LOG_ACCESS_TYPE = "searchLogAccessType";
468
469 /** Search log access type for JSON API. */
470 public static final String SEARCH_LOG_ACCESS_TYPE_JSON = "json";
471
472 /** Search log access type for GSA API. */
473 public static final String SEARCH_LOG_ACCESS_TYPE_GSA = "gsa";
474
475 /** Search log access type for web interface. */
476 public static final String SEARCH_LOG_ACCESS_TYPE_WEB = "web";
477
478 /** Search log access type for admin interface. */
479 public static final String SEARCH_LOG_ACCESS_TYPE_ADMIN = "admin";
480
481 /** Search log access type for other interfaces. */
482 public static final String SEARCH_LOG_ACCESS_TYPE_OTHER = "other";
483
484 /** Results per page parameter name. */
485 public static final String RESULTS_PER_PAGE = "resultsPerPage";
486
487 /** User code parameter name. */
488 public static final String USER_CODE = "userCode";
489
490 /** Search query field name for logging. */
491 public static final String SEARCH_FIELD_LOG_SEARCH_QUERY = "q";
492
493 /** Statistics report type parameter name. */
494 public static final String STATS_REPORT_TYPE = "reportType";
495
496 /** Result document ID cache key. */
497 public static final String RESULT_DOC_ID_CACHE = "resultDocIds";
498
499 /** System name for crawling information. */
500 public static final String CRAWLING_INFO_SYSTEM_NAME = "system";
501
502 // ============================================================
503 // View Parameters
504 // ============================================================
505
506 /** View parameter for facet query information. */
507 public static final String FACET_QUERY = "fess.FacetQuery";
508
509 /** View parameter for geo query information. */
510 public static final String GEO_QUERY = "fess.GeoQuery";
511
512 /** View parameter for facet form data. */
513 public static final String FACET_FORM = "fess.FacetForm";
514
515 /** View parameter for geo form data. */
516 public static final String GEO_FORM = "fess.GeoForm";
517
518 /** View parameter for label value mapping. */
519 public static final String LABEL_VALUE_MAP = "fess.LabelValueMap";
520
521 /** Query parameter name for main search query. */
522 public static final String OPTION_QUERY_Q = "q";
523
524 /** Query parameter name for constraint query. */
525 public static final String OPTION_QUERY_CQ = "cq";
526
527 /** Query parameter name for optional query. */
528 public static final String OPTION_QUERY_OQ = "oq";
529
530 /** Query parameter name for negative query. */
531 public static final String OPTION_QUERY_NQ = "nq";
532
533 // ============================================================
534 // Job and Process Constants
535 // ============================================================
536
537 /** Scheduled job identifier. */
538 public static final String SCHEDULED_JOB = "scheduledJob";
539
540 /** Job log ID parameter key for passing pre-generated ID to job execution. */
541 public static final String JOB_LOG_ID = "jobLogId";
542
543 /** Default job target value (all configurations). */
544 public static final String DEFAULT_JOB_TARGET = "all";
545
546 /** Default job script type (Groovy). */
547 public static final String DEFAULT_JOB_SCRIPT_TYPE = "groovy";
548
549 /** Exit code for successful operation. */
550 public static final int EXIT_OK = 0;
551
552 /** Exit code for failed operation. */
553 public static final int EXIT_FAIL = 1;
554
555 /** Document crawler format identifier. */
556 public static final String DCF = "dcf";
557
558 /** Constant representing all languages. */
559 public static final String ALL_LANGUAGES = "all";
560
561 /** Invalid numeric parameter value. */
562 public static final String INVALID_NUMERIC_PARAMETER = "-1";
563
564 // ============================================================
565 // Facet and Query Constants
566 // ============================================================
567
568 /** Prefix for facet field identifiers. */
569 public static final String FACET_FIELD_PREFIX = "field:";
570
571 /** Prefix for facet query identifiers. */
572 public static final String FACET_QUERY_PREFIX = "query:";
573
574 /** Query that matches all documents. */
575 public static final String MATCHES_ALL_QUERY = "*:*";
576
577 /** Configuration key for search engine HTTP address. */
578 public static final String FESS_SEARCH_ENGINE_HTTP_ADDRESS = "fess.search_engine.http_address";
579
580 /** Default number of results per page. */
581 public static final int DEFAULT_PAGE_SIZE = 20;
582
583 /** Default starting count for pagination. */
584 public static final int DEFAULT_START_COUNT = 0;
585
586 // ============================================================
587 // Process Type Constants
588 // ============================================================
589
590 /** Process type for replace operations. */
591 public static final String PROCESS_TYPE_REPLACE = "R";
592
593 /** Process type for crawling operations. */
594 public static final String PROCESS_TYPE_CRAWLING = "C";
595
596 /** Process type for displaying operations. */
597 public static final String PROCESS_TYPE_DISPLAYING = "D";
598
599 /** Process type for both crawling and displaying operations. */
600 public static final String PROCESS_TYPE_BOTH = "B";
601
602 /** Number of milliseconds in one day. */
603 public static final long ONE_DAY_IN_MILLIS = 24L * 60L * 60L * 1000L;
604
605 /** Guest user identifier. */
606 public static final String GUEST_USER = "guest";
607
608 /** Conversion rule array for pager components. */
609 public static final String[] PAGER_CONVERSION_RULE =
610 { "allRecordCount", "pageSize", "currentPageNumber", "allPageCount", "existPrePage", "existNextPage" };
611
612 // ============================================================
613 // Crawler Types
614 // ============================================================
615
616 /** Web crawler type identifier. */
617 public static final String WEB_CRAWLER_TYPE = "web_crawling";
618
619 /** File system crawler type identifier. */
620 public static final String FILE_CRAWLER_TYPE = "file_crawling";
621
622 /** Data crawler type identifier. */
623 public static final String DATA_CRAWLER_TYPE = "data_crawling";
624
625 // ============================================================
626 // Conversion Rules
627 // ============================================================
628
629 /** Common conversion rule for entity fields. */
630 public static final String[] COMMON_CONVERSION_RULE = { "crudMode", "createdBy", "createdTime", "updatedBy", "updatedTime" };
631
632 /** Common API conversion rule for CRUD operations. */
633 public static final String[] COMMON_API_CONVERSION_RULE = { "crudMode" };
634
635 // ============================================================
636 // User and Authentication Constants
637 // ============================================================
638
639 /** User information session key. */
640 public static final String USER_INFO = "LoginInfo";
641
642 /** Search engine API access token key. */
643 public static final String SEARCH_ENGINE_API_ACCESS_TOKEN = "searchEngineApiAccessToken";
644
645 /** Default field name identifier. */
646 public static final String DEFAULT_FIELD = "_default";
647
648 /** Default number of days for cleanup operations. */
649 public static final Integer DEFAULT_DAY_FOR_CLEANUP = 3;
650
651 /** Configuration path property key. */
652 public static final String FESS_CONF_PATH = "fess.conf.path";
653
654 /** UTC timezone constant. */
655 public static final TimeZone TIMEZONE_UTC = TimeZone.getTimeZone("UTC");
656
657 // ============================================================
658 // LDAP Configuration Constants
659 // ============================================================
660
661 /** LDAP base DN configuration key. */
662 public static final String LDAP_BASE_DN = "ldap.base.dn";
663
664 /** LDAP security principal configuration key. */
665 public static final String LDAP_SECURITY_PRINCIPAL = "ldap.security.principal";
666
667 /** LDAP admin security principal configuration key. */
668 public static final String LDAP_ADMIN_SECURITY_PRINCIPAL = "ldap.admin.security.principal";
669
670 /** LDAP admin security credentials configuration key. */
671 public static final String LDAP_ADMIN_SECURITY_CREDENTIALS = "ldap.admin.security.credentials";
672
673 /** LDAP provider URL configuration key. */
674 public static final String LDAP_PROVIDER_URL = "ldap.provider.url";
675
676 /** LDAP security authentication configuration key. */
677 public static final String LDAP_SECURITY_AUTHENTICATION = "ldap.security.authentication";
678
679 /** LDAP initial context factory configuration key. */
680 public static final String LDAP_INITIAL_CONTEXT_FACTORY = "ldap.initial.context.factory";
681
682 /** LDAP account filter configuration key. */
683 public static final String LDAP_ACCOUNT_FILTER = "ldap.account.filter";
684
685 /** LDAP group filter configuration key. */
686 public static final String LDAP_GROUP_FILTER = "ldap.group.filter";
687
688 /** LDAP member of attribute configuration key. */
689 public static final String LDAP_MEMBEROF_ATTRIBUTE = "ldap.memberof.attribute";
690
691 // ============================================================
692 // Notification Configuration
693 // ============================================================
694
695 /** Notification configuration for login page. */
696 public static final String NOTIFICATION_LOGIN = "notification.login";
697
698 /** Notification configuration for search top page. */
699 public static final String NOTIFICATION_SEARCH_TOP = "notification.search.top";
700
701 /** Notification configuration for advanced search page. */
702 public static final String NOTIFICATION_ADVANCE_SEARCH = "notification.advance.search";
703
704 // ============================================================
705 // Storage Configuration
706 // ============================================================
707
708 /** Storage endpoint configuration key. */
709 public static final String STORAGE_ENDPOINT = "storage.endpoint";
710
711 /** Storage access key configuration key. */
712 public static final String STORAGE_ACCESS_KEY = "storage.accesskey";
713
714 /** Storage secret key configuration key. */
715 public static final String STORAGE_SECRET_KEY = "storage.secretkey";
716
717 /** Storage bucket configuration key. */
718 public static final String STORAGE_BUCKET = "storage.bucket";
719
720 /** Storage type configuration key (s3, gcs, auto). */
721 public static final String STORAGE_TYPE = "storage.type";
722
723 /** RAG LLM name configuration key. */
724 public static final String RAG_LLM_NAME = "rag.llm.name";
725
726 /** Storage region configuration key (for S3). */
727 public static final String STORAGE_REGION = "storage.region";
728
729 /** Storage project ID configuration key (for GCS). */
730 public static final String STORAGE_PROJECT_ID = "storage.project.id";
731
732 /** Storage credentials path configuration key (for GCS). */
733 public static final String STORAGE_CREDENTIALS_PATH = "storage.credentials.path";
734
735 // ============================================================
736 // Mapping Type Constants
737 // ============================================================
738
739 /** Mapping type for array fields. */
740 public static final String MAPPING_TYPE_ARRAY = "array";
741
742 /** Mapping type for string fields. */
743 public static final String MAPPING_TYPE_STRING = "string";
744
745 /** Mapping type for long fields. */
746 public static final String MAPPING_TYPE_LONG = "long";
747
748 /** Mapping type for double fields. */
749 public static final String MAPPING_TYPE_DOUBLE = "double";
750
751 /** Mapping type for date fields. */
752 public static final String MAPPING_TYPE_DATE = "date";
753
754 /** Mapping type for PDF date fields. */
755 public static final String MAPPING_TYPE_PDF_DATE = "pdf_date";
756
757 // ============================================================
758 // Request and Search Constants
759 // ============================================================
760
761 /** Paging query list parameter name. */
762 public static final String PAGING_QUERY_LIST = "pagingQueryList";
763
764 /** Request languages parameter name. */
765 public static final String REQUEST_LANGUAGES = "requestLanguages";
766
767 /** Request page size parameter name. */
768 public static final String REQUEST_PAGE_SIZE = "requestPageSize";
769
770 /** Search preference for local node. */
771 public static final String SEARCH_PREFERENCE_LOCAL = "_local";
772
773 /** GSA API version identifier. */
774 public static final String GSA_API_VERSION = "3.2";
775
776 /** Permissions field name. */
777 public static final String PERMISSIONS = "permissions";
778
779 /** Queries field name. */
780 public static final String QUERIES = "queries";
781
782 /** Virtual hosts field name. */
783 public static final String VIRTUAL_HOSTS = "virtualHosts";
784
785 /** Prefix for encrypted/ciphered values. */
786 public static final String CIPHER_PREFIX = "{cipher}";
787
788 /** System user identifier. */
789 public static final String SYSTEM_USER = "system";
790
791 /** Empty user ID placeholder. */
792 public static final String EMPTY_USER_ID = "<empty>";
793
794 /** Crawler process command for thread dump. */
795 public static final String CRAWLER_PROCESS_COMMAND_THREAD_DUMP = "thread_dump";
796
797 // ============================================================
798 // Path and Configuration Constants
799 // ============================================================
800
801 /** Fess thumbnail path configuration key. */
802 public static final String FESS_THUMBNAIL_PATH = "fess.thumbnail.path";
803
804 /** Fess variable path configuration key. */
805 public static final String FESS_VAR_PATH = "fess.var.path";
806
807 /** Fess log level configuration key. */
808 public static final String FESS_LOG_LEVEL = "fess.log.level";
809
810 /** Fess LLM log level configuration key. */
811 public static final String FESS_LLM_LOG_LEVEL = "fess.llm.log.level";
812
813 /** Track total hits configuration key. */
814 public static final String TRACK_TOTAL_HITS = "track_total_hits";
815
816 /** System property prefix for Fess configuration. */
817 public static final String SYSTEM_PROP_PREFIX = "fess.system.";
818
819 /** Configuration prefix for Fess settings. */
820 public static final String FESS_CONFIG_PREFIX = "fess.config.";
821
822 /** Xerces feature prefix for XML processing. */
823 public static final String XERCES_FEATURE_PREFIX = "http://apache.org/xml/features/";
824
825 /** Load external DTD feature name. */
826 public static final String LOAD_EXTERNAL_DTD_FEATURE = "nonvalidating/load-external-dtd";
827
828 // ============================================================
829 // Search Engine Type Constants
830 // ============================================================
831
832 /** Cloud-based search engine type. */
833 public static final String FESEN_TYPE_CLOUD = "cloud";
834
835 /** AWS-based search engine type. */
836 public static final String FESEN_TYPE_AWS = "aws";
837
838 /** Search engine username configuration key. */
839 public static final String FESEN_USERNAME = "fesen.username";
840
841 /** Search engine password configuration key. */
842 public static final String FESEN_PASSWORD = "fesen.password";
843
844 // ============================================================
845 // Execution Type Constants
846 // ============================================================
847
848 /** Execution type for crawler operations. */
849 public static final String EXECUTE_TYPE_CRAWLER = "crawler";
850
851 /** Execution type for thumbnail operations. */
852 public static final String EXECUTE_TYPE_THUMBNAIL = "thumbnail";
853
854 /** Execution type for Python script operations. */
855 public static final String EXECUTE_TYPE_PYTHON = "python";
856
857 /** Execution type for suggest operations. */
858 public static final String EXECUTE_TYPE_SUGGEST = "suggest";
859
860 /** Default script type (Groovy). */
861 public static final String DEFAULT_SCRIPT = "groovy";
862
863 // ============================================================
864 // Text Fragment Constants
865 // ============================================================
866
867 /** Text fragments feature identifier. */
868 public static final String TEXT_FRAGMENTS = "text_fragments";
869
870 /** Text fragment type for query highlighting. */
871 public static final String TEXT_FRAGMENT_TYPE_QUERY = "query";
872
873 /** Text fragment type for result highlighting. */
874 public static final String TEXT_FRAGMENT_TYPE_HIGHLIGHT = "highlight";
875
876 /** Crawler statistics key identifier. */
877 public static final String CRAWLER_STATS_KEY = "crawler.stats.key";
878 }