├── .gitattributes
├── .gitignore
├── CHANGES.txt
├── GRADLE.CHEATSHEET
├── LICENSE.txt
├── NOTICE.txt
├── README.md
├── build.gradle
├── docs
├── assets
│ ├── css
│ │ ├── bootstrap.min.css
│ │ └── prettify.css
│ ├── img
│ │ ├── glyphicons-halflings-white.png
│ │ ├── glyphicons-halflings.png
│ │ ├── mapping.odg
│ │ └── mapping.png
│ └── js
│ │ ├── carrotsearch.circles.js
│ │ ├── carrotsearch.foamtree.js
│ │ ├── config.js
│ │ ├── jquery-2.0.2.min.js
│ │ ├── prettify.js
│ │ └── sample-data.js
├── curl
│ ├── 01-index-data.sh
│ ├── 02-simple-clustering.sh
│ ├── 03-field-mapping.sh
│ └── 04-delete-test-index.sh
├── examples.html
└── index.html
├── gradle
├── publishing.gradle
├── validation
│ ├── spotless.gradle
│ └── spotless
│ │ └── source-header.txt
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── src
├── javaRestTest
├── java
│ └── org
│ │ └── carrot2
│ │ └── elasticsearch
│ │ ├── ClusteringActionIT.java
│ │ ├── ClusteringActionRestIT.java
│ │ ├── ListAlgorithmsActionIT.java
│ │ ├── MultithreadedClusteringIT.java
│ │ ├── SampleIndexTestCase.java
│ │ └── TestInfra.java
└── resources
│ ├── log4j.properties
│ └── org
│ └── carrot2
│ └── elasticsearch
│ ├── _ClusteringActionRestIT
│ ├── post_invalid_attribute_value.json
│ ├── post_invalid_query.json
│ ├── post_language_field.json
│ ├── post_multiple_field_mapping.json
│ ├── post_nonexistent_algorithmId.json
│ ├── post_nonexistent_fields.json
│ ├── post_runtime_attributes.json
│ ├── post_with_clusters.json
│ ├── post_with_fields.json
│ ├── post_with_highlighted_fields.json
│ └── post_with_source_fields.json
│ └── _TestInfra
│ └── datamining.json
├── main
├── config
│ └── config.yml
├── java
│ └── org
│ │ └── carrot2
│ │ └── elasticsearch
│ │ ├── ClusteringAction.java
│ │ ├── ClusteringActionRequest.java
│ │ ├── ClusteringActionRequestBuilder.java
│ │ ├── ClusteringActionResponse.java
│ │ ├── ClusteringActionTransport.java
│ │ ├── ClusteringContext.java
│ │ ├── ClusteringException.java
│ │ ├── ClusteringPlugin.java
│ │ ├── DocumentGroup.java
│ │ ├── FieldMappingSpec.java
│ │ ├── FieldSource.java
│ │ ├── InputDocument.java
│ │ ├── ListAlgorithmsAction.java
│ │ ├── LoggerUtils.java
│ │ ├── LogicalField.java
│ │ ├── OptionalQueryHintSetterVisitor.java
│ │ ├── PathResourceLookup.java
│ │ ├── Preconditions.java
│ │ └── ToString.java
└── plugin-metadata
│ └── plugin-security.policy
└── yamlRestTest
├── java
└── org
│ └── carrot2
│ └── elasticsearch
│ └── ListAlgorithmsActionRestIT.java
└── resources
└── rest-api-spec
├── api
└── algorithms.json
└── test
└── elasticsearch-carrot2
├── 00_sanity.yml
└── 01_list_algorithms.yml
/.gitattributes:
--------------------------------------------------------------------------------
1 | versions.lock text eol=lf
2 | *.gradle text eol=lf
3 | *.java text eol=lf
4 | *.txt text eol=lf
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .DS_Store
3 | .gradle
4 | /.project
5 | /.classpath
6 | /.settings
7 | *.versionsBackup
8 | .local*
9 | build/
10 |
11 | # idea files
12 | .idea
13 | *.iml
14 | *.ipr
15 | *.iws
16 |
17 | # l3g license for tests.
18 | src/main/config/license.xml
19 |
20 | # eclipse
21 | bin/
22 | out/
23 |
--------------------------------------------------------------------------------
/CHANGES.txt:
--------------------------------------------------------------------------------
1 |
2 | ElasticSearch-Carrot2 Change Log
3 |
4 | ================ master ====================
5 |
6 | ================ ElasticSearch-Carrot2 7.17.7 ===================
7 |
8 | * ES 7.17.7 compatibility build (manually verified).
9 | * Upgrade to Carrot2 4.3.1.
10 |
11 | ================ ElasticSearch-Carrot2 7.14.1 ===================
12 |
13 | * ES 7.14.1 compatibility build (manually verified).
14 |
15 | ================ ElasticSearch-Carrot2 7.13.4 ===================
16 |
17 | * ES 7.13.4 compatibility build.
18 |
19 | ================ ElasticSearch-Carrot2 7.12.0 ===================
20 |
21 | * ES 7.12.0 compatibility build.
22 |
23 | * Upgrade to Carrot2 4.2.1.
24 |
25 | ================ ElasticSearch-Carrot2 7.11.2 ===================
26 |
27 | * ES 7.11.2 API changes and compatibility build.
28 |
29 | ================ ElasticSearch-Carrot2 7.10.2 ===================
30 |
31 | * ES 7.10.2 compatibility build.
32 |
33 | ================ ElasticSearch-Carrot2 7.10.1 ===================
34 |
35 | * ES 7.10.1 compatibility build.
36 |
37 | ================ ElasticSearch-Carrot2 7.10.0 ===================
38 |
39 | * ES 7.10.0 compatibility build.
40 |
41 | * Cleanups of build infrastructure.
42 |
43 | ================ ElasticSearch-Carrot2 7.9.3 ====================
44 |
45 | * ES 7.9.3 compatibility build.
46 |
47 | ================ ElasticSearch-Carrot2 7.9.2 ====================
48 |
49 | * ES 7.9.2 compatibility build.
50 |
51 | ================ ElasticSearch-Carrot2 7.8.1 ====================
52 |
53 | * ES 7.8.1 compatibility build.
54 |
55 | * Upgrade to Carrot2 4.0.4.
56 |
57 | ================ ElasticSearch-Carrot2 7.7.1 ====================
58 |
59 | Other changes
60 |
61 | * Upgrade to Carrot2 4.0.3. Adjust to API changes in language resources.
62 |
63 | * API updates to ES 7.7.1. Build scripts updates.
64 |
65 | ================ ElasticSearch-Carrot2 7.6.0 ====================
66 |
67 | Backward-incompatible changes
68 |
69 | * Upgrade of Carrot2 to 4.0.0-beta3. This results in a number of backward-incompatible
70 | changes to the plugin.
71 |
72 | 1) The local field for URL (and the corresponding mapping) is gone without replacement.
73 | 2) Names of clustering algorithms have changed. They are now (note white space):
74 | Lingo, STC, Bisecting K-Means, Lingo3G (optional, commercial)
75 | 3) The language field is no longer a two-letter code. The list of supported languages
76 | depends on the algorithm and availability of resources and is printed at startup;
77 | (service extension points are used to load algorithms and languages).
78 | 4) Names and structure of attributes for clustering algorithms have changed. They reflect
79 | the new, updated Carrot2 API, see:
80 | https://carrot2.github.io/release/4.0.0-beta3/doc/rest-api-reference/
81 | 5) Algorithm suites and predefined component descriptors (in XML) have been removed and
82 | are no longer supported. Algorithms are loaded via service extensions.
83 | 6) There are two new request attributes: "language" specifying default clustering
84 | language for documents that don't declare it explicitly and "create_ungrouped" which
85 | forces the plugin to create a synthetic group with unclustered document references
86 | (this corresponds to "other topics" group from previous Carrot2 versions).
87 | 7) Nearly all plugin options have been removed. The single option remaining is "resources"
88 | with an array of ES configuration folder-relative locations where algorithm resources
89 | are looked up.
90 | 8) Default lexical resources from Carrot2 are included under configuration folder and
91 | used by default.
92 |
93 | ================ ElasticSearch-Carrot2 7.5.0 ====================
94 |
95 | Other changes
96 |
97 | * Build updates to ES 7.5.0.
98 |
99 | ================ ElasticSearch-Carrot2 7.3.2 ====================
100 |
101 | Other changes
102 |
103 | * Build updates to ES 7.3.2.
104 |
105 | ================ ElasticSearch-Carrot2 7.2.1 ====================
106 |
107 | Other changes
108 |
109 | * Build updates to ES 7.2.1.
110 | * Switch dependency from simple-xml to simple-xml-safe.
111 |
112 | ================ ElasticSearch-Carrot2 7.2.0 ====================
113 |
114 | Other changes
115 |
116 | * Build updates to ES 7.2.0.
117 |
118 | ================ ElasticSearch-Carrot2 7.1.1 ====================
119 |
120 | Other changes
121 |
122 | * Build updates to ES 7.1.1.
123 |
124 | ================ ElasticSearch-Carrot2 7.0.0 ====================
125 |
126 | Other changes
127 |
128 | * Build updates to ES 7.0.0.
129 |
130 | ================ ElasticSearch-Carrot2 6.8.5 ====================
131 |
132 | Other changes
133 |
134 | * Build updates to ES 6.8.5.
135 |
136 | ================ ElasticSearch-Carrot2 6.7.2 ====================
137 |
138 | Other changes
139 |
140 | * Build updates to ES 6.7.2.
141 |
142 | ================ ElasticSearch-Carrot2 6.7.1 ====================
143 |
144 | Other changes
145 |
146 | * Build updates to ES 6.7.1.
147 |
148 | ================ ElasticSearch-Carrot2 6.6.2 ====================
149 |
150 | Other changes
151 |
152 | * Build updates to ES 6.6.2.
153 |
154 | ================ ElasticSearch-Carrot2 6.5.4 ====================
155 |
156 | Other changes
157 |
158 | * Build updates to ES 6.5.4.
159 |
160 | ================ ElasticSearch-Carrot2 6.4.3 ====================
161 |
162 | Other changes
163 |
164 | * Build updates to ES 6.4.3.
165 |
166 | * Permit custom resource lookup location for each algorithm. This can be accomplished
167 | by declaring a 'esplugin.resources' attribute inside a given component's configuration
168 | attributes. For example, changing lingo-attributes.xml in the following way:
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 | would cause all algorithm resources to be read from:
180 |
181 | {es-home}/config/elasticsearch-carrot2/lingo-resources
182 |
183 | ================ ElasticSearch-Carrot2 6.3.2 ====================
184 |
185 | Other changes
186 |
187 | * Build updates to ES 6.3.2. (PR #77, thanks Sergey34).
188 |
189 | ================ ElasticSearch-Carrot2 6.2.4 ====================
190 |
191 | Other changes
192 |
193 | * ES security (x-pack) fixes to make it possible to run clustering in secured
194 | ES instances.
195 |
196 | * Upgrade dependency to Carrot2 3.16.0 (and Lingo3G 1.16.0).
197 |
198 | * Build updates to ES 6.2.4.
199 |
200 | ================ ElasticSearch-Carrot2 6.1.1 ====================
201 |
202 | * Updates to API changes in ES 6.1.1. (PR #74, thanks Tom Chambers!).
203 |
204 | * Updates to API changes in ES 6.0.0.
205 |
206 | * REST tests cleanups and updates.
207 |
208 | ================ ElasticSearch-Carrot2 5.5.2 ====================
209 |
210 | Other changes
211 |
212 | * Updates to API changes in ES 5.5.2.
213 |
214 | ================ ElasticSearch-Carrot2 5.4.0 ====================
215 |
216 | Other changes
217 |
218 | * Updates to API changes in ES 5.4.0.
219 |
220 | ================ ElasticSearch-Carrot2 5.3.0 ====================
221 |
222 | Other changes
223 |
224 | * Updates to API changes in ES 5.3.0.
225 |
226 | * Documentation fixes (location of resources).
227 |
228 | * Added slf4j-log4j12 logging redirector as a default dependency.
229 |
230 | * Updated FoamTree and Circles to their newest versions.
231 |
232 | * Added logging configuration to silence permission denied exceptions and
233 | other non-critical information from C2.
234 |
235 | ================ ElasticSearch-Carrot2 5.2.0 ====================
236 |
237 | Other changes
238 |
239 | * Updates to API changes in ES 5.2.0.
240 |
241 | * GH-60: Upgrade dependency to Carrot2 3.15.1 (and Lingo3G 1.15.1).
242 |
243 | ================ ElasticSearch-Carrot2 5.1.1 ====================
244 |
245 | Other changes
246 |
247 | * The first ES version 5.x-compatible release. Moved to Gradle build system from Maven.
248 | (PR #57, thanks Utkarsh!).
249 |
250 | * Java 8 is from now on required.
251 |
252 | * Fields will not work unless explicitly stored. Use source filtering instead.
253 | https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-stored-fields.html
254 | https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-source-filtering.html
255 |
256 | * Updated documentation links and content.
257 |
258 | * Removed the demo _site part of the plugin. ES 5.1.1 onwards there is no
259 | support for site plugins.
260 |
261 | ================ ElasticSearch-Carrot2 2.4.3 ====================
262 |
263 | No changes (ES version compatibility release).
264 |
265 | ================ ElasticSearch-Carrot2 2.4.2 ====================
266 |
267 | No changes (ES version compatibility release).
268 |
269 | ================ ElasticSearch-Carrot2 2.4.1.1 ==================
270 |
271 | * GH-53: Upgrade to C2 3.15.0 and L3G 1.15.0. This is a compatibility
272 | release. It will work with ES 2.4.1.
273 |
274 | ================ ElasticSearch-Carrot2 2.4.1 ==================
275 |
276 | * GH-50: Upgrade to C2 3.14.0 and L3G 1.14.0.
277 |
278 | ================ ElasticSearch-Carrot2 2.4.0.1 ==================
279 |
280 | * GH-49: Wrong version of morfologik stemming shipped (2.0.1
281 | instead of 2.1.0). This is a bugfix release, it will work
282 | with ES 2.4.0.
283 |
284 | ================ ElasticSearch-Carrot2 2.4.0 ====================
285 |
286 | * GH-47: Method renamed in ES (compatibility release).
287 |
288 | ================ ElasticSearch-Carrot2 2.3.4 ====================
289 |
290 | No changes (ES version compatibility release).
291 |
292 | ================ ElasticSearch-Carrot2 2.3.2 ====================
293 |
294 | No changes (ES version compatibility release).
295 |
296 | ================ ElasticSearch-Carrot2 2.3.0 ====================
297 |
298 | Other changes
299 |
300 | * ES version/ API compatibility release.
301 |
302 | * Visualizations in the docs display proper resolution on high
303 | DPI screens.
304 |
305 | ================ ElasticSearch-Carrot2 2.2.1 ====================
306 |
307 | Other changes
308 |
309 | * GH-40: Upgrade to C2 3.12.0 and L3G 1.13.0.
310 |
311 | * GH-38: Array of fields cannot be used. (Christophe Quintard via Dawid Weiss).
312 |
313 | ================ ElasticSearch-Carrot2 2.2.0 ====================
314 |
315 | Other changes
316 |
317 | * GH-37: Added workarounds for tighter security checks in ES 2.2.0.
318 | The plugin from now on requires custom relaxed policy which has
319 | to be manually approved during startup.
320 |
321 | ================ ElasticSearch-Carrot2 2.1.2 ====================
322 |
323 | No changes (ES version compatibility release).
324 |
325 | ================ ElasticSearch-Carrot2 2.1.1 ====================
326 |
327 | No changes (ES version compatibility release).
328 |
329 | ================ ElasticSearch-Carrot2 2.1.0 ====================
330 |
331 | No changes (ES version compatibility release).
332 |
333 | ================ ElasticSearch-Carrot2 2.0.2 ====================
334 |
335 | No changes (ES version compatibility release).
336 |
337 | ================ ElasticSearch-Carrot2 2.0.1 ====================
338 |
339 | No changes (ES version compatibility release).
340 |
341 | ================ ElasticSearch-Carrot2 2.0.0 ====================
342 |
343 | Other changes
344 |
345 | * GH-29: Upgrade to ES 2.0.0 (official).
346 |
347 | ================ ElasticSearch-Carrot2 2.0.0-rc1 ================
348 |
349 | Changes in Backwards Compatibility
350 |
351 | * GH-23: Plugin code restructured for ES 2.0.0. Versioning
352 | scheme will now follow ElasticSearch strictly since starting
353 | from version 2.0.0 plugins must declare an (exact) version
354 | of ES they were compiled against.
355 |
356 | * GH-25: Plugin configuration files have been moved to reside
357 | inside the plugin. They should be automatically installed
358 | (copied) to ElasticSearch's config/ folder, where they can
359 | be tweaked.
360 |
361 | Other changes
362 |
363 | * GH-28: Add support for es/config and plugin/config relative
364 | license locations in Lingo3G
365 |
366 | * GH-27: Add dependency on morfologik-stemming.
367 |
368 | * GH-24: Update JS visualizations in plugin documentation.
369 |
370 | * Dropped support for plugin branches 1.7.x and 1.8.x (ES 1.3.x and
371 | 1.4.x).
372 |
373 | ================ ElasticSearch-Carrot2 1.9.1 ================
374 |
375 | Changes in Backwards Compatibility
376 |
377 | * Dependency update to Carrot2 3.10.4 (and Lingo3G 1.12.3).
378 |
379 | ================ ElasticSearch-Carrot2 1.9.0 ================
380 |
381 | Changes in Backwards Compatibility
382 |
383 | * Dependency update to ES 1.6.0.
384 |
385 | * Dependency update to Carrot2 3.10.1 (and Lingo3G 1.12.0).
386 |
387 | * Dependency updates (test libraries).
388 |
389 | ================ ElasticSearch-Carrot2 1.8.0 ================
390 |
391 | Changes in Backwards Compatibility
392 |
393 | * Dependency update to ES 1.4.0.
394 |
395 | Other changes
396 |
397 | * Dropped support branch for ES 1.1.x.
398 |
399 | ================ ElasticSearch-Carrot2 1.7.0 ================
400 |
401 | Changes in Backwards Compatibility
402 |
403 | * Dependency update to ES 1.3.0.
404 |
405 | ================ ElasticSearch-Carrot2 1.6.1 ================
406 |
407 | Changes in Backwards Compatibility
408 |
409 | * Dependency update to ES 1.2.2.
410 |
411 | * Dependency update to Carrot2 3.9.3 (and Lingo3G 1.10.0)
412 |
413 | * Demo visualizations updated to their newest version.
414 |
415 | ================ ElasticSearch-Carrot2 1.6.0 ================
416 |
417 | Changes in Backwards Compatibility
418 |
419 | * Compatibility update to ES 1.2.0.
420 |
421 | ================ ElasticSearch-Carrot2 1.5.0 ================
422 |
423 | Changes in Backwards Compatibility
424 |
425 | * Compatibility upgrade to Carrot2 3.9.2 and Lingo3G 1.9.1.
426 |
427 | ================ ElasticSearch-Carrot2 1.4.0 ================
428 |
429 | Changes in Backwards Compatibility
430 |
431 | * Compatibility upgrade to Carrot2 3.9.0 and Lingo3G 1.9.0.
432 |
433 | * include_hits parameter is now deprecated in favor of setting
434 | max_hits to 0. include_hits = false will act as an alias of
435 | setting max_hits to 0.
436 |
437 | New Features
438 |
439 | * GH-9: Add a more flexible limit of the set of returned search results.
440 |
441 | ================ ElasticSearch-Carrot2 1.3.1 ================
442 |
443 | New features
444 |
445 | * Added an option to return only cluster labels (omit search hits
446 | in the response). [thanks @kielni]
447 |
448 | ================ ElasticSearch-Carrot2 1.3.0 ================
449 |
450 | Changes in Backwards Compatibility
451 |
452 | * GH-6: Fixes compatibility issues to work with elasticsearch-1.0.0.
453 |
454 | ================ ElasticSearch-Carrot2 1.2.2 ================
455 |
456 | New features
457 |
458 | * Added an option to return only cluster labels (omit search hits
459 | in the response). [thanks @kielni]
460 |
461 | ================ ElasticSearch-Carrot2 1.2.1 ================
462 |
463 | Changes in Backwards Compatibility
464 |
465 | * GH-4: Compatibility issue with elasticsearch-0.90.10 (this
466 | release will not work for ES < 0.90.10).
467 |
468 | Bug Fixes
469 |
470 | * GH-4: Compatibility issue with elasticsearch-0.90.10
471 |
472 | ================ ElasticSearch-Carrot2 1.2.0 ================
473 |
474 | New Features
475 |
476 | * Added an action to return all available clustering algorithms.
477 |
478 | * Added support for search-and-cluster requests using HTTP GET (with a subset
479 | of all the functionality but still useful).
480 |
481 | Bug Fixes
482 |
483 | * Proper propagation of ProcessingExceptions from Carrot2 framework (in case
484 | they happen due to, for example, invalid attribute values).
485 |
486 | Other
487 |
488 | * Added tests for invalid attribute values and proper responses in such
489 | case (API, REST).
490 |
491 | * Refactoring of API classes (nesting classes under ClusteringAction, similar pattern
492 | will follow for all future *Action implementations).
493 |
494 | * Improved tests (test requests are converted to all XContentTypes).
495 |
496 | * Restructured the plugin documentation, added table of contents and
497 | sections for each REST API method.
498 |
499 | * Minor touches for incompatible ES API changes (removed methods in RestActions).
500 |
501 | ================ ElasticSearch-Carrot2 1.1.1 ================
502 |
503 | Other
504 |
505 | * Minor touches for incompatible ES API changes (removed methods in RestActions).
506 |
507 | ================ ElasticSearch-Carrot2 1.1.0 ================
508 |
509 | New features
510 |
511 | * The size of the clustering controller's component pool is adjustable using
512 | the configuration file (controller.pool-size option).
513 |
514 | * Added language field mapping descriptors. This helps with multi-lingual
515 | clustering -- hints about each document's language can be stored together
516 | with the document in the index. See the documentation for examples.
517 |
518 | Bug Fixes
519 |
520 | * GH-1: Front-page example visualizations fail with Lingo3G.
521 |
522 | Other
523 |
524 | * Update base ES dependency to 0.90.2
525 |
526 | * Verified threading (clustering runs on the search thread), added
527 | simple stress testing.
528 |
529 | * Added information about search threadpool use and potential tweaks to
530 | its default size to examples.html
531 |
532 | ================ ElasticSearch-Carrot2 1.0.1 ================
533 |
534 | Bug Fixes
535 |
536 | * GH-1: Front-page example visualizations fail with Lingo3G.
537 |
538 | ================ ElasticSearch-Carrot2 1.0.0 ================
539 |
540 | First open source release.
541 |
--------------------------------------------------------------------------------
/GRADLE.CHEATSHEET:
--------------------------------------------------------------------------------
1 |
2 | # Publishing.
3 | # Remember to set up ~/.gradle/gradle.properties:
4 |
5 | nexusUsername=
6 | nexusPassword=
7 | signing.keyId=
8 | signing.password=
9 | signing.secretKeyRingFile=.../secring.gpg
10 |
11 | # then:
12 | gradlew clean publishToSonatype --max-workers 1
13 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright 2013-2017 Carrot Search s.c.
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/NOTICE.txt:
--------------------------------------------------------------------------------
1 | Elasticsearch-Carrot2
2 | Copyright 2013-2021 Carrot Search s.c.
3 |
4 | This product includes software developed by The Apache Software
5 | Foundation (http://www.apache.org/).
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Search results clustering for ElasticSearch
2 | ===========================================
3 |
4 | This clustering plugin adds on-the-fly text clustering capability
5 | to an ElasticSearch node. Clustering algorithms from the
6 | [Carrot2](https://github.com/carrot2/carrot2) project (open source)
7 | are used by default. Proprietary [Lingo3G algorithm](https://carrotsearch.com/lingo3g/)
8 | from [Carrot Search](https://carrotsearch.com) can also be used
9 | via an [extension plugin](https://github.com/carrotsearch/elasticsearch-lingo3g).
10 |
11 |
12 | Installation
13 | ------------
14 |
15 | In order to install a stable version of the plugin,
16 | run ElasticSearch's `plugin` utility (remember to pick the
17 | ES-compatible version of the plugin from the table below!).
18 |
19 | bin/elasticsearch-plugin install org.carrot2:elasticsearch-carrot2:7.17.7
20 |
21 | To install from sources (master branch), run:
22 |
23 | ./gradlew clean build
24 |
25 | then install with (use the full, absolute path):
26 |
27 | Linux:
28 | bin/elasticsearch-plugin install file:/.../(plugin)/build/distributions/*.zip
29 |
30 | Windows:
31 | bin\elasticsearch-plugin install file:///c:/.../(plugin)/build/distributions/*.zip
32 |
33 | If plugin installation shows a popup to request additional
34 | permissions, you have to accept it. Plugin versions for Carrot2 4.0.0+ do not
35 | require any extra permissions.
36 |
37 |
38 | Usage
39 | -----
40 |
41 | To play with the examples in the documentation, you'll have to allow
42 | CORS requests from null (if opened directly) or localhost (if served
43 | by some local HTTP server). Add the following to ES/config/elasticsearch.yml:
44 |
45 | ```
46 | # Allow localhost cross-origin requests.
47 | http.cors.enabled: true
48 | http.cors.allow-origin: /(null)|(https?:\/\/localhost(:[0-9]+)?)|(https?:\/\/carrot2\.github\.io(:[0-9]+)?)/
49 | ```
50 |
51 | More information about security implications of enabling CORS are here:
52 | https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-http.html
53 |
54 | Finally, start ES and open up the documentation in your browser
55 | (can be opened as a file resource):
56 |
57 | (plugin sources)/doc/index.html
58 |
59 | The above regular expression enables CORS headers from github, so you can open
60 | the documentation directly from there:
61 |
62 | https://carrot2.github.io/elasticsearch-carrot2/
63 |
64 | CURL request examples are available here:
65 |
66 | https://github.com/carrot2/elasticsearch-carrot2/tree/master/doc/curl/
67 |
68 |
69 | Versions and compatibility
70 | --------------------------
71 |
72 | Recommended compatibility chart (matching versions of ES, Carrot2,
73 | and optionally Lingo3G). (+) means it'll probably work with newer
74 | releases (we test against the latest version from that branch).
75 |
76 | The plugin is compiled against *an exact* version of ES
77 | and *will not work* with any other version. The numbering of the plugin
78 | will always correspond to the numbering of ES to easily identify
79 | the version of ES the plugin will work with. The only exceptions from this rule
80 | will be critical bugfixes, which will have the fourth version number: then
81 | the first three numbers denote ES release the plugin is compiled against.
82 |
83 | If you need a point version that has not been released (yet or skipped),
84 | then update the project descriptor (pom.xml) and recompile from sources,
85 | this will yield a binary version of the plugin compatible with the
86 | given ES version.
87 |
88 | Lingo3G 2.x will be supported via a separate
89 | [extension plugin](https://github.com/carrotsearch/elasticsearch-lingo3g).
90 |
91 | | Clustering Plugin | Elasticsearch | Carrot2 | Lingo3G |
92 | |-------------------| --- | --- | --- |
93 | | (master branch) | | 4.3.1 | ext-plugin |
94 | | 7.17.7 → | | 4.3.1 | ext-plugin |
95 | | 7.14.1 → | | 4.3.1 | ext-plugin |
96 | | 7.13.4 → | | 4.3.1 | ext-plugin |
97 | | 7.12.0 → | | 4.2.1 | ext-plugin |
98 |
99 | Discontinued version branches:
100 |
101 | | Clustering Plugin | Elasticsearch | Carrot2 | Lingo3G |
102 | | --- | --- | --- | --- |
103 | | 7.11.2 → | | 4.0.4 | ext-plugin |
104 | | 7.10.2.2 | 7.10.2 | 4.3.1 | ext-plugin |
105 | | 7.10.0 → 7.10.2 | | 4.0.4 | ext-plugin |
106 | | 7.9.2 → 7.9.3 | | 4.0.4 | ext-plugin |
107 | | 7.8.1 | | 4.0.4 | ext-plugin |
108 | | 7.7.1 | | 4.0.4 | ext-plugin |
109 | | 7.6.0.1 | 7.6.0 | 4.0.0-beta3 | not supported |
110 | | 7.6.0 | | 4.0.0-beta3 | not supported |
111 | | 7.0.0 → 7.5.0 | | 3.16.1 | 1.16.1 |
112 | | 6.8.5 → 6.8.9 | | 3.16.1 | 1.16.1 |
113 | | 6.7.1 | | 3.16.1 | 1.16.1 |
114 | | 6.6.2 | | 3.16.1 | 1.16.1 |
115 | | 6.5.4 | | 3.16.0 | 1.16.0 |
116 | | 6.4.3 | | 3.16.0 | 1.16.0 |
117 | | 6.3.2 | | 3.16.0 | 1.16.0 |
118 | | 6.2.4 | | 3.16.0 | 1.16.0 |
119 | | 6.2.3 | | 3.15.1 | 1.15.1 |
120 | | 6.1.1 | | 3.15.1 | 1.15.1 |
121 | | 5.5.2 | | 3.15.1 | 1.15.1 |
122 | | 5.4.0 | | 3.15.1 | 1.15.1 |
123 | | 5.3.0 | | 3.15.1 | 1.15.1 |
124 | | 5.2.0 | | 3.15.1 | 1.15.1 |
125 | | 5.1.1 | | 3.15.0 | 1.15.0 |
126 | | 2.4.2 → 2.4.3 | | 3.15.0 | 1.15.0 |
127 | | 2.4.1.1 | | 3.15.0 | 1.15.0 |
128 | | 2.4.1 → 2.4.1 | | 3.14.0 | 1.14.0 |
129 | | 2.4.0 → 2.4.0.1 | | 3.12.0 | 1.13.0 |
130 | | 2.3.0 → 2.3.4 | | 3.12.0 | 1.13.0 |
131 | | 2.2.1 | | 3.12.0 | 1.13.0 |
132 | | 2.2.0 | | 3.11.0 | 1.12.3 |
133 | | 2.1.0 → 2.1.2 | | 3.11.0 | 1.12.3 |
134 | | 2.0.0 → 2.0.2 | | 3.11.0 | 1.12.3 |
135 | | 1.9.1 | 1.6.0 → 1.7.2+? | 3.10.4 | 1.12.3 |
136 | | 1.9.0 | 1.6.0 → 1.7.0+? | 3.10.1 | 1.12.0 |
137 | | 1.8.0 | 1.4.0 → 1.6.0+ | 3.9.3 | 1.10.0 |
138 | | 1.7.0 | 1.3.0 → 1.3.5+ | 3.9.3 | 1.10.0 |
139 | | 1.6.0 | 1.2.0 → 1.2.2+ | 3.9.2 | 1.9.1 |
140 | | 1.5.0 | 1.1.0 → 1.1.2+ | 3.9.2 | 1.9.1 |
141 | | 1.4.0 | 1.0.0 → 1.0.3 | 3.9.0 | 1.9.0 |
142 | | 1.3.1 | 1.0.0 → 1.0.3 | 3.8.1 | 1.8.1 |
143 | | 1.3.0 | 1.0.0 → 1.0.3 | 3.8.1 | 1.8.1 |
144 | | 1.2.2 | 0.90.10→ 0.90.13 | 3.8.0 | 1.8.0 |
145 | | 1.2.1 | 0.90.10→ 0.90.11 | 3.8.0 | 1.8.0 |
146 | | 1.2.0 | 0.90.4 → 0.90.9 | 3.8.0 | 1.8.0 |
147 | | 1.1.1 | 0.90.4 → 0.90.9 | 3.8.0 | 1.8.0 |
148 | | 1.1.0 | 0.90.2 → 0.90.3 | 3.8.0 | 1.8.0 |
149 | | 1.0.1 | 0.90 → 0.90.3 | 3.7.1 | 1.7.1 |
150 | | 1.0.0 | 0.90 → 0.90.3 | 3.7.1 | 1.7.1 |
151 |
152 | License
153 | -------
154 |
155 | This software is licensed under the Apache 2 license. Full text
156 | of the license is in the repository (`LICENSE.txt`).
157 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | localversions = [
4 | es : "7.17.7",
5 | c2 : "4.3.1"
6 | ]
7 | }
8 |
9 | repositories {
10 | mavenCentral()
11 | }
12 |
13 | dependencies {
14 | classpath "org.elasticsearch.gradle:build-tools:${localversions.es}"
15 | }
16 | }
17 |
18 | plugins {
19 | id 'java-library'
20 | id 'idea'
21 | id 'com.diffplug.spotless' version "5.8.2" apply false
22 | }
23 |
24 | apply plugin: 'elasticsearch.esplugin'
25 | apply plugin: 'elasticsearch.java-rest-test'
26 | apply plugin: 'elasticsearch.yaml-rest-test'
27 |
28 | apply from: file('gradle/validation/spotless.gradle')
29 |
30 | // This plugin's version (typically must match that of ES).
31 | // For bugfix releases against the same ES version, you can add a bugfix suffix.
32 | def bugfix = ""
33 | version = "${localversions.es}${bugfix}"
34 | group = 'org.carrot2'
35 |
36 | repositories {
37 | mavenLocal()
38 | mavenCentral()
39 | }
40 |
41 | ext {
42 | licenseFile = rootProject.file('LICENSE.txt')
43 | noticeFile = rootProject.file('NOTICE.txt')
44 | }
45 |
46 | esplugin {
47 | name 'elasticsearch-carrot2'
48 | description "Search results clustering plugin for Elasticsearch ${localversions.es} (Carrot2 ${localversions.c2})"
49 | classname 'org.carrot2.elasticsearch.ClusteringPlugin'
50 | }
51 |
52 | configurations {
53 | c2resources
54 | }
55 |
56 | dependencies {
57 | c2resources("org.carrot2:carrot2-core:${localversions.c2}", {
58 | transitive false
59 | })
60 |
61 | api("org.carrot2:carrot2-core:${localversions.c2}", {
62 | exclude group: "com.carrotsearch", module: "hppc"
63 | })
64 |
65 | testImplementation "org.assertj:assertj-core:3.13.2"
66 |
67 | // Let the javaRestTest see the classpath of main and tests.
68 | javaRestTestImplementation project.sourceSets.main.runtimeClasspath
69 | javaRestTestImplementation project.sourceSets.test.runtimeClasspath
70 |
71 | // TODO: ES 7.10.0-7.17.7 hack: missing log4j classes?
72 | yamlRestTestRuntimeClasspath "org.apache.logging.log4j:log4j-core:2.17.1"
73 | }
74 |
75 | // Set target compatibility
76 | sourceCompatibility = 11
77 | targetCompatibility = 11
78 |
79 | // We don't have unit tests, only integration tests.
80 | test.enabled = false
81 |
82 | // Add plugin configuration files to each testClusters instance.
83 | // 'extraConfigFile' doesn't allow directories, only files, so we
84 | // need to add each individually
85 | testClusters.all {
86 | fileTree(dir: 'src/main/config').each { file ->
87 | extraConfigFile 'elasticsearch-carrot2/' + file.name, file
88 | }
89 | }
90 |
91 | // Unpack and bundle the default resources with the plugin.
92 | bundlePlugin {
93 | from({ zipTree(configurations.c2resources.singleFile).matching { include "**/*.utf8" } }, {
94 | eachFile { fcd ->
95 | fcd.path -= "org/carrot2/language/"
96 | }
97 | includeEmptyDirs = false
98 | into 'config'
99 | })
100 | }
101 |
102 | // Configure publishing.
103 | apply from: file('gradle/publishing.gradle')
104 |
105 | // TODO: ES 7.13.4 hack. We generate our own POM.
106 | tasks.matching { it.path == ":validateElasticPom" }.all { Task t ->
107 | enabled = false
108 | }
--------------------------------------------------------------------------------
/docs/assets/css/prettify.css:
--------------------------------------------------------------------------------
1 | .com { color: #93a1a1; }
2 | .lit { color: #195f91; }
3 | .pun, .opn, .clo { color: #93a1a1; }
4 | .fun { color: #dc322f; }
5 | .str, .atv { color: #D14; }
6 | .kwd, .prettyprint .tag { color: #1e347b; }
7 | .typ, .atn, .dec, .var { color: teal; }
8 | .pln { color: #48484c; }
9 |
10 | .prettyprint {
11 | padding: 8px;
12 | background-color: #f7f7f9;
13 | border: 1px solid #e1e1e8;
14 | }
15 | .prettyprint.linenums {
16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
19 | }
20 |
21 | /* Specify class=linenums on a pre to get line numbering */
22 | ol.linenums {
23 | margin: 0 0 0 33px; /* IE indents via margin-left */
24 | }
25 | ol.linenums li {
26 | padding-left: 12px;
27 | color: #bebec5;
28 | line-height: 20px;
29 | text-shadow: 0 1px 0 #fff;
30 | }
--------------------------------------------------------------------------------
/docs/assets/img/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carrot2/elasticsearch-carrot2/b98a04b9980ee82a77a6c6e2e4ea7380d578b8d1/docs/assets/img/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/docs/assets/img/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carrot2/elasticsearch-carrot2/b98a04b9980ee82a77a6c6e2e4ea7380d578b8d1/docs/assets/img/glyphicons-halflings.png
--------------------------------------------------------------------------------
/docs/assets/img/mapping.odg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carrot2/elasticsearch-carrot2/b98a04b9980ee82a77a6c6e2e4ea7380d578b8d1/docs/assets/img/mapping.odg
--------------------------------------------------------------------------------
/docs/assets/img/mapping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carrot2/elasticsearch-carrot2/b98a04b9980ee82a77a6c6e2e4ea7380d578b8d1/docs/assets/img/mapping.png
--------------------------------------------------------------------------------
/docs/assets/js/config.js:
--------------------------------------------------------------------------------
1 |
2 | // Declare ES's address globally.
3 | window.ES_URL="http://localhost:9200";
--------------------------------------------------------------------------------
/docs/assets/js/prettify.js:
--------------------------------------------------------------------------------
1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]+/],["dec",/^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^
121 |
122 |
123 |
124 |
125 |
279 |
280 |