/
Log.java
620 lines (498 loc) · 32.6 KB
/
Log.java
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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
/*
* Hibernate Search, full-text search for your domain model
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.search.backend.lucene.logging.impl;
import static org.jboss.logging.Logger.Level.INFO;
import static org.jboss.logging.Logger.Level.TRACE;
import static org.jboss.logging.Logger.Level.WARN;
import java.io.IOException;
import java.nio.file.Path;
import java.time.Duration;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import org.apache.lucene.search.Query;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.Version;
import org.hibernate.search.backend.lucene.document.model.impl.AbstractLuceneIndexSchemaFieldNode;
import org.hibernate.search.backend.lucene.index.LuceneIndexManager;
import org.hibernate.search.backend.lucene.search.impl.LuceneSearchObjectFieldContext;
import org.hibernate.search.engine.backend.scope.spi.IndexScopeBuilder;
import org.hibernate.search.engine.backend.types.converter.spi.ToDocumentIdentifierValueConverter;
import org.hibernate.search.engine.logging.spi.AggregationKeyFormatter;
import org.hibernate.search.util.common.logging.impl.DurationInSecondsAndFractionsFormatter;
import org.hibernate.search.engine.search.predicate.SearchPredicate;
import org.hibernate.search.engine.search.projection.SearchProjection;
import org.hibernate.search.engine.search.sort.SearchSort;
import org.hibernate.search.engine.search.aggregation.AggregationKey;
import org.hibernate.search.engine.search.aggregation.SearchAggregation;
import org.hibernate.search.util.common.SearchTimeoutException;
import org.hibernate.search.util.common.reporting.EventContext;
import org.hibernate.search.util.common.SearchException;
import org.hibernate.search.util.common.logging.impl.MessageConstants;
import org.hibernate.search.util.common.logging.impl.ClassFormatter;
import org.hibernate.search.util.common.logging.impl.EventContextFormatter;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger.Level;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.FormatWith;
import org.jboss.logging.annotations.LogMessage;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.Param;
import org.jboss.logging.annotations.ValidIdRange;
import org.jboss.logging.annotations.ValidIdRanges;
@MessageLogger(projectCode = MessageConstants.PROJECT_CODE)
@ValidIdRanges({
@ValidIdRange(min = MessageConstants.BACKEND_LUCENE_ID_RANGE_MIN, max = MessageConstants.BACKEND_LUCENE_ID_RANGE_MAX),
// Exceptions for legacy messages from Search 5 (engine module)
@ValidIdRange(min = 35, max = 35),
@ValidIdRange(min = 41, max = 41),
@ValidIdRange(min = 52, max = 52),
@ValidIdRange(min = 55, max = 55),
@ValidIdRange(min = 75, max = 75),
@ValidIdRange(min = 114, max = 114),
@ValidIdRange(min = 118, max = 118),
@ValidIdRange(min = 225, max = 225),
@ValidIdRange(min = 226, max = 226),
@ValidIdRange(min = 228, max = 228),
@ValidIdRange(min = 265, max = 265),
@ValidIdRange(min = 274, max = 274),
@ValidIdRange(min = 284, max = 284),
@ValidIdRange(min = 320, max = 320),
@ValidIdRange(min = 321, max = 321),
@ValidIdRange(min = 329, max = 329),
@ValidIdRange(min = 330, max = 330),
@ValidIdRange(min = 337, max = 337),
@ValidIdRange(min = 341, max = 341),
@ValidIdRange(min = 342, max = 342),
@ValidIdRange(min = 344, max = 344),
@ValidIdRange(min = 345, max = 345),
@ValidIdRange(min = 353, max = 353)
})
public interface Log extends BasicLogger {
// -----------------------------------
// Pre-existing messages from Search 5 (engine module)
// DO NOT ADD ANY NEW MESSAGES HERE
// -----------------------------------
int ID_OFFSET_LEGACY_ENGINE = MessageConstants.ENGINE_ID_RANGE_MIN;
@LogMessage(level = INFO)
@Message(id = ID_OFFSET_LEGACY_ENGINE + 41, value = "Index directory not found, creating: '%1$s'")
void indexDirectoryNotFoundCreatingNewOne(Path absolutePath);
@LogMessage(level = WARN)
@Message(id = ID_OFFSET_LEGACY_ENGINE + 52,
value = "Going to reset the index writer and force release of the IndexWriter lock. %1$s")
void indexWriterReset(@FormatWith(EventContextFormatter.class) EventContext context);
@LogMessage(level = Level.WARN)
@Message(id = ID_OFFSET_LEGACY_ENGINE + 55,
value = "Unable to close the index reader. %1$s")
void unableToCloseIndexReader(@FormatWith(EventContextFormatter.class) EventContext context, @Cause Exception e);
@LogMessage(level = WARN)
@Message(id = ID_OFFSET_LEGACY_ENGINE + 75,
value = "Configuration setting '%1$s' was not specified: using LATEST (currently '%2$s'). %3$s")
void recommendConfiguringLuceneVersion(String key, Version latest, @FormatWith(EventContextFormatter.class) EventContext context);
@Message(id = ID_OFFSET_LEGACY_ENGINE + 114,
value = "Could not load resource: '%1$s'")
SearchException unableToLoadResource(String fileName);
@Message(id = ID_OFFSET_LEGACY_ENGINE + 118,
value = "Index Merge operation on index '%1$s'")
String indexMergeOperation(String indexName);
@LogMessage(level = Level.WARN)
@Message(id = ID_OFFSET_LEGACY_ENGINE + 225,
value = "An index locking error occurred during initialization of Directory '%s'."
+ " This might indicate a concurrent initialization;"
+ " If you experience errors on this index you might need to remove the lock, or rebuild the index."
)
void lockingFailureDuringInitialization(String directoryDescription, @Param EventContext context);
@LogMessage(level = TRACE)
@Message(id = ID_OFFSET_LEGACY_ENGINE + 226, value = "%s: %s" )
void logInfoStreamMessage(String componentName, String message);
@Message(id = ID_OFFSET_LEGACY_ENGINE + 228,
value = "Value '%1$ss' is not in a valid format to express a Lucene version: %2$s" )
SearchException illegalLuceneVersionFormat(String property, String luceneErrorMessage, @Cause Exception e);
@LogMessage(level = Level.DEBUG)
@Message(id = ID_OFFSET_LEGACY_ENGINE + 274, value = "Executing Lucene query '%s'" )
void executingLuceneQuery(Query luceneQuery);
@Message(id = ID_OFFSET_LEGACY_ENGINE + 284,
value = "An exception occurred while opening multiple indexes." )
SearchException failureOnMultiReaderRefresh(@Param EventContext context, @Cause Exception e);
@Message(id = ID_OFFSET_LEGACY_ENGINE + 329,
value = "Error while applying analysis configuration: %1$s")
SearchException unableToApplyAnalysisConfiguration(String errorMessage, @Cause Exception e);
@Message(id = ID_OFFSET_LEGACY_ENGINE + 337,
value = "Multiple parameters with the same name: '%1$s'. Can't assign both value '%2$s' and '%3$s'" )
SearchException analysisComponentParameterConflict(String name, String value1, String value2);
@Message(id = ID_OFFSET_LEGACY_ENGINE + 342,
value = "Cannot apply both an analyzer and a normalizer. Analyzer: '%1$s', normalizer: '%2$s'.")
SearchException cannotApplyAnalyzerAndNormalizer(String analyzerName, String normalizerName, @Param EventContext context);
@LogMessage(level = Level.WARN)
@Message(id = ID_OFFSET_LEGACY_ENGINE + 344,
value = "The normalizer for definition '%s' produced %d tokens."
+ " Normalizers should never produce more than one token."
+ " The tokens have been concatenated by Hibernate Search,"
+ " but you should fix your normalizer definition." )
void normalizerProducedMultipleTokens(String normalizerName, int token);
@Message(id = ID_OFFSET_LEGACY_ENGINE + 345,
value = "Cannot apply an analyzer on a sortable field. Use a normalizer instead. Analyzer: '%1$s'."
+ " If an actual analyzer (with tokenization) is necessary, define two separate fields:"
+ " one with an analyzer that is not sortable, and one with a normalizer that is sortable.")
SearchException cannotUseAnalyzerOnSortableField(String analyzerName, @Param EventContext context);
@Message(id = ID_OFFSET_LEGACY_ENGINE + 353,
value = "Unknown analyzer: '%1$s'. Make sure you defined this analyzer.")
SearchException unknownAnalyzer(String analyzerName, @Param EventContext context);
// -----------------------------------
// New messages from Search 6 onwards
// -----------------------------------
int ID_OFFSET = MessageConstants.BACKEND_LUCENE_ID_RANGE_MIN;
@Message(id = ID_OFFSET + 0,
value = "Unknown field '%1$s'.")
SearchException unknownFieldForSearch(String absoluteFieldPath, @Param EventContext context);
@Message(id = ID_OFFSET + 1,
value = "Path '%1$s' exists but does not point to a writable directory.")
SearchException pathIsNotWriteableDirectory(Path rootDirectory);
@Message(id = ID_OFFSET + 5,
value = "The Lucene extension can only be applied to objects"
+ " derived from the Lucene backend. Was applied to '%1$s' instead.")
SearchException luceneExtensionOnUnknownType(Object context);
@Message(id = ID_OFFSET + 10,
value = "A Lucene query cannot include search predicates built using a non-Lucene search scope."
+ " Given predicate was: '%1$s'")
SearchException cannotMixLuceneSearchQueryWithOtherPredicates(SearchPredicate predicate);
@Message(id = ID_OFFSET + 13,
value = "Object field '%1$s' is flattened: its structure was lost upon indexing and 'nested' features are not available.")
SearchException nonNestedFieldForNestedQuery(String absoluteFieldPath, @Param EventContext context);
@Message(id = ID_OFFSET + 14,
value = "A Lucene query cannot include search sorts built using a non-Lucene search scope."
+ " Given sort was: '%1$s'")
SearchException cannotMixLuceneSearchSortWithOtherSorts(SearchSort sort);
@Message(id = ID_OFFSET + 15,
value = "Unable to initialize index directory: %1$s")
SearchException unableToInitializeIndexDirectory(String causeMessage,
@Param EventContext context, @Cause Exception cause);
@Message(id = ID_OFFSET + 16, value = "Unable to index entity of type '%2$s' with identifier '%3$s' and tenant identifier '%1$s'.")
SearchException unableToIndexEntry(String tenantId, String entityTypeName, Object entityIdentifier,
@Param EventContext context, @Cause Exception e);
@Message(id = ID_OFFSET + 17,
value = "Unable to delete entity of type '%2$s' with identifier '%3$s' and tenant identifier '%1$s'.")
SearchException unableToDeleteEntryFromIndex(String tenantId, String entityTypeName, Object entityIdentifier,
@Param EventContext context, @Cause Exception e);
@Message(id = ID_OFFSET + 19,
value = "Unable to commit.")
SearchException unableToCommitIndex(@Param EventContext context, @Cause Exception e);
@Message(id = ID_OFFSET + 24,
value = "A multi-index scope cannot include both a Lucene index and another type of index."
+ " Base scope was: '%1$s', Lucene index was: '%2$s'")
SearchException cannotMixLuceneScopeWithOtherType(IndexScopeBuilder baseScope,
LuceneIndexManager luceneIndex, @Param EventContext context);
@Message(id = ID_OFFSET + 25,
value = "A multi-index scope cannot span multiple Lucene backends."
+ " Base scope was: '%1$s', index from another backend was: '%2$s'")
SearchException cannotMixLuceneScopeWithOtherBackend(IndexScopeBuilder baseScope,
LuceneIndexManager indexFromOtherBackend, @Param EventContext context);
@Message(id = ID_OFFSET + 27,
value = "An IOException happened while executing the query '%1$s'.")
SearchException ioExceptionOnQueryExecution(Query luceneQuery, @Param EventContext context, @Cause IOException e);
@Message(id = ID_OFFSET + 29,
value = "Index '%1$s' requires multi-tenancy but the backend does not support it in its current configuration.")
SearchException multiTenancyRequiredButNotSupportedByBackend(String indexName, @Param EventContext context);
@Message(id = ID_OFFSET + 30,
value = "Invalid multi-tenancy strategy name: '%1$s'. Valid names are: %2$s.")
SearchException invalidMultiTenancyStrategyName(String invalidRepresentation, List<String> validRepresentations);
@Message(id = ID_OFFSET + 31,
value = "Tenant identifier '%1$s' is provided, but multi-tenancy is disabled for this backend.")
SearchException tenantIdProvidedButMultiTenancyDisabled(String tenantId, @Param EventContext context);
@Message(id = ID_OFFSET + 32,
value = "Backend has multi-tenancy enabled, but no tenant identifier is provided.")
SearchException multiTenancyEnabledButNoTenantIdProvided(@Param EventContext context);
@Message(id = ID_OFFSET + 33,
value = "Attempt to unwrap a Lucene backend to '%1$s',"
+ " but this backend can only be unwrapped to '%2$s'.")
SearchException backendUnwrappingWithUnknownType(@FormatWith(ClassFormatter.class) Class<?> requestedClass,
@FormatWith(ClassFormatter.class) Class<?> actualClass,
@Param EventContext context);
@Message(id = ID_OFFSET + 34,
value = "The index schema node '%1$s' was added twice."
+ " Multiple bridges may be trying to access the same index field, "
+ " or two indexed-embeddeds may have prefixes that lead to conflicting field names,"
+ " or you may have declared multiple conflicting mappings."
+ " In any case, there is something wrong with your mapping and you should fix it.")
SearchException indexSchemaNodeNameConflict(String relativeFieldName,
@Param EventContext context);
@Message(id = ID_OFFSET + 39,
value = "Invalid field reference for this document element: this document element has path '%1$s', but the referenced field has a parent with path '%2$s'.")
SearchException invalidFieldForDocumentElement(String expectedPath, String actualPath);
@Message(id = ID_OFFSET + 44,
value = "Computed minimum for minimumShouldMatch constraint is out of bounds:"
+ " expected a number between '1' and '%1$s', got '%2$s'.")
SearchException minimumShouldMatchMinimumOutOfBounds(int totalShouldClauseNumber, int minimum);
@Message(id = ID_OFFSET + 45,
value = "Multiple conflicting minimumShouldMatch constraints for ceiling '%1$s'")
SearchException minimumShouldMatchConflictingConstraints(int ignoreConstraintCeiling);
@Message(id = ID_OFFSET + 48,
value = "This native field does not support projection.")
SearchException unsupportedProjectionForNativeField(@Param EventContext context);
@Message(id = ID_OFFSET + 49,
value = "Invalid field path; expected path '%1$s', got '%2$s'.")
SearchException invalidFieldPath(String expectedPath, String actualPath);
@Message(id = ID_OFFSET + 50,
value = "Unable to convert DSL parameter: %1$s")
SearchException cannotConvertDslParameter(String errorMessage, @Cause Exception cause, @Param EventContext context);
@Message(id = ID_OFFSET + 51,
value = "Attempt to unwrap a Lucene index manager to '%1$s',"
+ " but this index manager can only be unwrapped to '%2$s'.")
SearchException indexManagerUnwrappingWithUnknownType(@FormatWith(ClassFormatter.class) Class<?> requestedClass,
@FormatWith(ClassFormatter.class) Class<?> actualClass,
@Param EventContext context);
@Message(id = ID_OFFSET + 52,
value = "Unable to create analyzer for name '%1$s'.")
SearchException unableToCreateAnalyzer(String name, @Cause Exception e);
@Message(id = ID_OFFSET + 53,
value = "Unable to create normalizer for name '%1$s'.")
SearchException unableToCreateNormalizer(String name, @Cause Exception e);
@Message(id = ID_OFFSET + 54,
value = "Unknown normalizer: '%1$s'. Make sure you defined this normalizer.")
SearchException unknownNormalizer(String normalizerName, @Param EventContext context);
@Message(id = ID_OFFSET + 55,
value = "A Lucene query cannot include search projections built using a non-Lucene search scope."
+ " Given projection was: '%1$s'")
SearchException cannotMixLuceneSearchQueryWithOtherProjections(SearchProjection<?> projection);
@Message(id = ID_OFFSET + 58,
value = "Inconsistent configuration for field '%1$s' in a search query across multiple indexes: %2$s")
SearchException inconsistentConfigurationForFieldForSearch(String absoluteFieldPath, String causeMessage,
@Param EventContext context, @Cause SearchException cause);
@Message(id = ID_OFFSET + 61, value = "Failed to shut down the Lucene index manager.")
SearchException failedToShutdownBackend(@Cause Exception cause, @Param EventContext context);
@Message(id = ID_OFFSET + 62, value = "Cannot guess field type for input type: '%1$s'.")
SearchException cannotGuessFieldType(@FormatWith(ClassFormatter.class) Class<?> inputType, @Param EventContext context);
@Message(id = ID_OFFSET + 64, value = "Unexpected index: documentId '%1$s' was not collected." )
SearchException documentIdNotCollected(Integer documentId);
@Message(id = ID_OFFSET + 67, value = "Unable to delete all entries matching query '%1$s'.")
SearchException unableToDeleteAllEntriesFromIndex(Query query, @Param EventContext context, @Cause Exception e);
@Message(id = ID_OFFSET + 68,
value = "Inconsistent configuration for the identifier in a search query across multiple indexes: converter differs: '%1$s' vs. '%2$s'.")
SearchException inconsistentConfigurationForIdentifierForSearch(ToDocumentIdentifierValueConverter<?> component1,
ToDocumentIdentifierValueConverter<?> component2, @Param EventContext context);
@Message(id = ID_OFFSET + 69,
value = "An IOException occurred while generating an Explanation.")
SearchException ioExceptionOnExplain(@Cause IOException e);
@Message(id = ID_OFFSET + 70,
value = "Full-text features (analysis, fuzziness) are not supported for fields of this type.")
SearchException fullTextFeaturesNotSupportedByFieldType(@Param EventContext context);
@Message(id = ID_OFFSET + 71,
value = "Incomplete field definition."
+ " You must call toReference() to complete the field definition.")
SearchException incompleteFieldDefinition(@Param EventContext context);
@Message(id = ID_OFFSET + 72,
value = "Multiple calls to toReference() for the same field definition."
+ " You must call toReference() exactly once.")
SearchException cannotCreateReferenceMultipleTimes(@Param EventContext context);
@Message(id = ID_OFFSET + 73, value = "Index-null-as option is not supported on analyzed field. Trying to define the analyzer: '%1$s' together with index null as: '%2$s'.")
SearchException cannotUseIndexNullAsAndAnalyzer(String analyzerName, String indexNullAs, @Param EventContext context);
@Message(id = ID_OFFSET + 74,
value = "Multiple values were added to single-valued field '%1$s'."
+ " Declare the field as multi-valued in order to allow this."
)
SearchException multipleValuesForSingleValuedField(String absoluteFieldPath);
@Message(id = ID_OFFSET + 75,
value = "explain(Object id) cannot be used when the query targets multiple types."
+ " Use explain(String typeName, Object id) and pass one of %1$s as the type name." )
SearchException explainRequiresTypeName(Set<String> targetedTypeNames);
@Message(id = ID_OFFSET + 76,
value = "The given mapped type name '%2$s' is not among the mapped types targeted by this query: %1$s." )
SearchException explainRequiresTypeTargetedByQuery(Set<String> targetedTypeNames, String typeName);
@Message(id = ID_OFFSET + 77,
value = "Document with id '%2$s' does not exist for the mapped type '%1$s' and thus its match cannot be explained." )
SearchException explainUnknownDocument(String typeName, String id);
@Message(id = ID_OFFSET + 78,
value = "Unable to merge index segments.")
SearchException unableToMergeSegments(@Param EventContext context, @Cause Exception e);
@Message(id = ID_OFFSET + 79,
value = "Unable to close the index writer after write failures.")
SearchException unableToCloseIndexWriterAfterFailures(@Param EventContext context, @Cause Exception e);
@Message(id = ID_OFFSET + 80, value = "Impossible to detect a decimal scale to use for this field."
+ " If the value is bridged, set '.asBigDecimal().decimalScale( int )' in the bind, else verify your mapping.")
SearchException nullDecimalScale(@Param EventContext eventContext);
@Message(id = ID_OFFSET + 81, value = "The value '%1$s' cannot be indexed because its absolute value is too large.")
SearchException scaledNumberTooLarge(Number value);
@Message(id = ID_OFFSET + 82, value = "Positive decimal scale ['%1$s'] is not allowed for BigInteger fields, since a BigInteger value cannot have any decimal digits.")
SearchException invalidDecimalScale(Integer decimalScale, @Param EventContext eventContext);
@Message(id = ID_OFFSET + 84, value = "The predicate '%1$s' is defined on a scope targeting different indexes."
+ " Predicate is targeting: '%2$s'. Current scope is targeting: '%3$s'.")
SearchException predicateDefinedOnDifferentIndexes(SearchPredicate predicate, Set<String> predicateIndexes, Set<String> scopeIndexes);
@Message(id = ID_OFFSET + 85, value = "The sort '%1$s' is defined on a scope targeting different indexes."
+ " Sort is targeting: '%2$s'. Current scope is targeting: '%3$s'.")
SearchException sortDefinedOnDifferentIndexes(SearchSort predicate, Set<String> predicateIndexes, Set<String> scopeIndexes);
@Message(id = ID_OFFSET + 86, value = "The projection '%1$s' is defined on a scope targeting different indexes."
+ " Projection is targeting: '%2$s'. Current scope is targeting: '%3$s'.")
SearchException projectionDefinedOnDifferentIndexes(SearchProjection<?> predicate, Set<String> predicateIndexes, Set<String> scopeIndexes);
@Message(id = ID_OFFSET + 87,
value = "Invalid filesystem access strategy name: '%1$s'. Valid names are: %2$s.")
SearchException invalidFileSystemAccessStrategyName(String invalidRepresentation, List<String> validRepresentations);
@Message(id = ID_OFFSET + 88,
value = "Invalid locking strategy name: '%1$s'. Valid names are: %2$s.")
SearchException invalidLockingStrategyName(String invalidRepresentation, List<String> validRepresentations);
@Message(id = ID_OFFSET + 89,
value = "The sharding strategy '%1$s' is not implemented properly:"
+ " it must call either context.setShardIdentifiers() or context.setShardingDisabled()"
+ " in its initialize() method, but it did not." )
SearchException missingShardIdentifiersAfterShardingStrategyInitialization(Object strategy);
@Message(id = ID_OFFSET + 90,
value = "Missing value for property '%2$s'. The sharding strategy '%1$s' requires this property to be set.")
SearchException missingPropertyValueForShardingStrategy(String strategyName, String propertyKey);
@Message(id = ID_OFFSET + 91,
value = "Invalid routing key: '%1$s'. Valid keys are: %2$s.")
SearchException invalidRoutingKeyForExplicitShardingStrategy(String invalidKey, Collection<String> validKeys);
@Message(id = ID_OFFSET + 94,
value = "Cannot apply an analyzer on an aggregable field. Use a normalizer instead. Analyzer: '%1$s'."
+ " If an actual analyzer (with tokenization) is necessary, define two separate fields:"
+ " one with an analyzer that is not aggregable, and one with a normalizer that is aggregable.")
SearchException cannotUseAnalyzerOnAggregableField(String analyzerName, @Param EventContext context);
@Message(id = ID_OFFSET + 98,
value = "An Lucene query cannot include search aggregations built using a non-Lucene search scope."
+ " Given aggregation was: '%1$s'")
SearchException cannotMixLuceneSearchQueryWithOtherAggregations(SearchAggregation<?> aggregation);
@Message(id = ID_OFFSET + 99, value = "The aggregation '%1$s' is defined on a scope targeting different indexes."
+ " Aggregation is targeting: '%2$s'. Current scope is targeting: '%3$s'.")
SearchException aggregationDefinedOnDifferentIndexes(SearchAggregation<?> aggregation,
Set<String> aggregationIndexes, Set<String> scopeIndexes);
@Message(id = ID_OFFSET + 102,
value = "Multiple aggregations with the same key: '%1$s'")
SearchException duplicateAggregationKey(@FormatWith(AggregationKeyFormatter.class) AggregationKey key);
@Message(id = ID_OFFSET + 104, value = "Cannot apply a search analyzer if an analyzer has not been defined on the same field." +
" Search analyzer: '%1$s'.")
SearchException searchAnalyzerWithoutAnalyzer(String searchAnalyzer, @Param EventContext context);
@Message(id = ID_OFFSET + 105,
value = "Multiple conflicting models for object field '%1$s': '%2$s' vs. '%3$s'.")
SearchException conflictingObjectFieldModel(String absoluteFieldPath,
LuceneSearchObjectFieldContext index1Model, LuceneSearchObjectFieldContext index2Model, @Param EventContext context);
@Message(id = ID_OFFSET + 106,
value = "Multiple conflicting models for field '%1$s': '%2$s' vs. '%3$s'.")
SearchException conflictingFieldModel(String absoluteFieldPath,
AbstractLuceneIndexSchemaFieldNode fieldNode1, AbstractLuceneIndexSchemaFieldNode fieldNode2,
@Param EventContext context);
@Message(id = ID_OFFSET + 107, value = "Search query exceeded the timeout of %1$s: '%2$s'.")
SearchTimeoutException timedOut(@FormatWith(DurationInSecondsAndFractionsFormatter.class) Duration timeout, String queryDescription);
@Message(id = ID_OFFSET + 108,
value = "Invalid I/O strategy name: '%1$s'. Valid names are: %2$s.")
SearchException invalidIOStrategyName(String invalidRepresentation, List<String> validRepresentations);
@Message(id = ID_OFFSET + 109,
value = "Index does not exist for directory '%1$s'")
SearchException missingIndex(Directory directory, @Param EventContext context);
@Message(id = ID_OFFSET + 110,
value = "Unable to validate index directory: %1$s")
SearchException unableToValidateIndexDirectory(String causeMessage,
@Param EventContext context, @Cause Exception cause);
@Message(id = ID_OFFSET + 111,
value = "Unable to drop index directory: %1$s")
SearchException unableToDropIndexDirectory(String causeMessage,
@Param EventContext context, @Cause Exception cause);
@Message(id = ID_OFFSET + 113, value = "Simple query string targets fields [%1$s, %3$s] spanning multiple nested paths: %2$s, %4$s.")
SearchException simpleQueryStringSpanningMultipleNestedPaths(String fieldPath1, String nestedPath1, String fieldPath2, String nestedPath2);
@Message(id = ID_OFFSET + 114,
value = "Cannot compute the median across nested documents.")
SearchException cannotComputeMedianAcrossNested(@Param EventContext context);
@Message(id = ID_OFFSET + 115,
value = "Cannot compute the sum, average or median of a text field. Only min and max are supported.")
SearchException cannotComputeSumOrAvgOrMedianForStringField(@Param EventContext context);
@Message(id = ID_OFFSET + 116,
value = "Cannot compute the sum of a temporal field. Only min, max, avg and median are supported.")
SearchException cannotComputeSumForTemporalField(@Param EventContext context);
@Message(id = ID_OFFSET + 117,
value = "Cannot compute the sum for a distance sort. Only min, max, avg and median are supported.")
SearchException cannotComputeSumForDistanceSort(@Param EventContext context);
@Message(id = ID_OFFSET + 118,
value = "A failure occurred during a low-level write operation"
+ " and the index writer had to be reset."
+ " Some write operations may have been lost as a result."
+ " Failure: %1$s")
SearchException uncommittedOperationsBecauseOfFailure(String causeMessage,
@Param EventContext context, @Cause Throwable cause);
@Message(id = ID_OFFSET + 120,
value = "Field '%1$s' is not contained in a nested object."
+ " Sort filters are only available if the field to sort on is contained in a nested object.")
SearchException cannotFilterSortOnRootDocumentField(String absoluteFieldPath, @Param EventContext context);
@Message(id = ID_OFFSET + 121,
value = "Predicate targets unexpected fields %2$s."
+ " Only fields that are contained in the nested object with path '%1$s'"
+ " are allowed here.")
SearchException invalidNestedObjectPathForPredicate(String nestedObjectPath, List<String> fieldPaths);
@Message(id = ID_OFFSET + 122,
value = "Field '%1$s' is not contained in a nested object."
+ " Aggregation filters are only available if the field to aggregate on is contained in a nested object.")
SearchException cannotFilterAggregationOnRootDocumentField(String absoluteFieldPath, @Param EventContext context);
@Message(id = ID_OFFSET + 123,
value = "IndexWriter setting '%1$s' cannot be set to '%2$s': %3$s")
SearchException illegalIndexWriterSetting(String settingName, Object settingValue, String message, @Cause Exception e);
@Message(id = ID_OFFSET + 124,
value = "Merge policy setting '%1$s' cannot be set to '%2$s': %3$s")
SearchException illegalMergePolicySetting(String settingName, Object settingValue, String message, @Cause Exception e);
@Message(id = ID_OFFSET + 125,
value = "The index field template '%1$s' was added twice."
+ " Multiple bridges may be trying to access the same index field template, "
+ " or two indexed-embeddeds may have prefixes that lead to conflicting field names,"
+ " or you may have declared multiple conflicting mappings."
+ " In any case, there is something wrong with your mapping and you should fix it.")
SearchException indexSchemaFieldTemplateNameConflict(String name, @Param EventContext context);
@Message(id = ID_OFFSET + 126,
value = "Invalid value type. This field's values are of type '%1$s', which is not assignable from '%2$s'.")
SearchException invalidFieldValueType(@FormatWith(ClassFormatter.class) Class<?> fieldValueType,
@FormatWith(ClassFormatter.class) Class<?> invalidValueType,
@Param EventContext context);
@Message(id = ID_OFFSET + 127,
value = "Unknown field '%1$s'.")
SearchException unknownFieldForIndexing(String absoluteFieldPath, @Param EventContext context);
@Message(id = ID_OFFSET + 128,
value = "Invalid type: the index root is not an object field.")
SearchException invalidIndexElementTypeRootIsNotObjectField();
@Message(id = ID_OFFSET + 129,
value = "Invalid type: '%1$s' is a value field, not an object field.")
SearchException invalidIndexElementTypeValueFieldIsNotObjectField(String absolutePath);
@Message(id = ID_OFFSET + 130,
value = "Invalid type: '%1$s' is an object field, not a value field.")
SearchException invalidIndexElementTypeObjectFieldIsNotValueField(String absolutePath);
@Message(id = ID_OFFSET + 131,
value = "Projection on field '%1$s' cannot be single-valued, because this field is multi-valued."
+ " Make sure to call '.multi()' when you create the projection.")
SearchException invalidSingleValuedProjectionOnMultiValuedField(String absolutePath, @Param EventContext context);
@Message(id = ID_OFFSET + 132, value = "Cannot use '%2$s' on field '%1$s'."
+ " Make sure the field is marked as searchable/sortable/projectable/aggregable (whichever is relevant)."
+ " If it already is, then '%2$s' is not available for fields of this type.")
SearchException cannotUseQueryElementForField(String absoluteFieldPath, String queryElementName, @Param EventContext context);
@Message(id = ID_OFFSET + 133,
value = "Inconsistent support for '%1$s': %2$s")
SearchException inconsistentSupportForQueryElement(String queryElementName,
String causeMessage, @Cause SearchException cause);
@Message(id = ID_OFFSET + 134,
value = "Field attribute '%1$s' differs: '%2$s' vs. '%3$s'.")
SearchException differentFieldAttribute(String attributeName, Object component1, Object component2);
@Message(id = ID_OFFSET + 135,
value = "Implementation class differs: '%1$s' vs. '%2$s'.")
SearchException differentImplementationClassForQueryElement(@FormatWith(ClassFormatter.class) Class<?> class1,
@FormatWith(ClassFormatter.class) Class<?> class2);
@Message(id = ID_OFFSET + 136,
value = "Field codec differs: '%1$s' vs. '%2$s'.")
SearchException differentFieldCodecForQueryElement(Object codec1, Object codec2);
@Message(id = ID_OFFSET + 137,
value = "'%1$s' can be used in some of the targeted indexes, but not all of them."
+ " Make sure the field is marked as searchable/sortable/projectable/aggregable (whichever is relevant) in all indexes,"
+ " and that the field has the same type in all indexes.")
SearchException partialSupportForQueryElement(String queryElementName);
@LogMessage(level = WARN)
@Message(id = ID_OFFSET + 138, value = "Using deprecated filesystem access strategy '%1$s',"
+ " which will be removed in a future version of Lucene."
+ " %2$s")
void deprecatedFileSystemAccessStrategy(String accessStrategyName,
@FormatWith(EventContextFormatter.class) EventContext eventContext);
@Message(id = ID_OFFSET + 139, value = "Cannot use '%2$s' on field '%1$s'."
+ " '%2$s' is not available for object fields.")
SearchException cannotUseQueryElementForObjectField(String absoluteFieldPath, String queryElementName, @Param EventContext context);
@Message(id = ID_OFFSET + 140, value = "Cannot use '%2$s' on field '%1$s': %3$s")
SearchException cannotUseQueryElementForObjectFieldBecauseCreationException(String absoluteFieldPath,
String queryElementName, String causeMessage, @Cause SearchException cause, @Param EventContext context);
@Message(id = ID_OFFSET + 141,
value = "Unable to compute size of index.")
SearchException unableToComputeIndexSize(@Param EventContext context, @Cause Exception e);
}