Package org.elasticsearch.index.mapper
Class MapperServiceTestCase
java.lang.Object
org.junit.Assert
org.apache.lucene.tests.util.LuceneTestCase
org.elasticsearch.test.ESTestCase
org.elasticsearch.index.mapper.FieldTypeTestCase
org.elasticsearch.index.mapper.MapperServiceTestCase
- Direct Known Subclasses:
AbstractScriptFieldTypeTestCase,BlockLoaderTestCase,HighlighterTestCase,MapperScriptTestCase,MapperTestCase,MetadataMapperTestCase,OffsetDocValuesLoaderTestCase
Test case that lets you easily build
MapperService based on some
mapping. Useful when you don't need to spin up an entire index but do
need most of the trapping of the mapping.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.elasticsearch.test.ESTestCase
ESTestCase.DeprecationWarning, ESTestCase.EntitledTestPackages, ESTestCase.GeohashGenerator, ESTestCase.TestAnalysis, ESTestCase.WithEntitlementsOnTestCode, ESTestCase.WithoutEntitlementsNested classes/interfaces inherited from class org.apache.lucene.tests.util.LuceneTestCase
org.apache.lucene.tests.util.LuceneTestCase.AwaitsFix, org.apache.lucene.tests.util.LuceneTestCase.Concurrency, org.apache.lucene.tests.util.LuceneTestCase.Monster, org.apache.lucene.tests.util.LuceneTestCase.Nightly, org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs, org.apache.lucene.tests.util.LuceneTestCase.SuppressFileSystems, org.apache.lucene.tests.util.LuceneTestCase.SuppressFsync, org.apache.lucene.tests.util.LuceneTestCase.SuppressReproduceLine, org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks, org.apache.lucene.tests.util.LuceneTestCase.SuppressTempFileChecks, org.apache.lucene.tests.util.LuceneTestCase.ThrowingConsumer<T>, org.apache.lucene.tests.util.LuceneTestCase.ThrowingRunnable, org.apache.lucene.tests.util.LuceneTestCase.Weekly -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.elasticsearch.xcontent.ToXContent.Paramsprotected static final SettingsFields inherited from class org.elasticsearch.index.mapper.FieldTypeTestCase
MOCK_CONTEXT, MOCK_CONTEXT_DISALLOW_EXPENSIVEFields inherited from class org.elasticsearch.test.ESTestCase
checkIndexFailures, DEFAULT_TEST_WORKER_ID, failureAndSuccessEvents, FIPS_SYSPROP, JAVA_TIMEZONE_IDS, JAVA_ZONE_IDS, logger, MIN_PRIVATE_PORT, SAFE_AWAIT_TIMEOUT, TEST_ENTITLEMENTS, TEST_REQUEST_TIMEOUT, TEST_WORKER_SYS_PROPERTY, TEST_WORKER_VM_ID, UNSIGNED_LONG_MAXFields inherited from class org.apache.lucene.tests.util.LuceneTestCase
assertsAreEnabled, classRules, DEFAULT_LINE_DOCS_FILE, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, LEAVE_TEMPORARY, MAYBE_CACHE_POLICY, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_MONSTER, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_THROTTLING, TEST_WEEKLY, VERBOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> TcompileScript(Script script, ScriptContext<T> context) This is the injection point for tests that require mock scripts.protected final DocumentMappercreateDocumentMapper(String mappings) protected final DocumentMappercreateDocumentMapper(IndexVersion version, org.elasticsearch.xcontent.XContentBuilder mappings) protected final DocumentMappercreateDocumentMapper(org.elasticsearch.xcontent.XContentBuilder mappings) protected final DocumentMappercreateDocumentMapper(org.elasticsearch.xcontent.XContentBuilder mappings, IndexMode indexMode) protected static IndexAnalyzersprotected IndexAnalyzerscreateIndexAnalyzers(IndexSettings indexSettings) protected static IndexSettingscreateIndexSettings(IndexVersion version, Settings settings) protected final DocumentMappercreateLogsModeDocumentMapper(org.elasticsearch.xcontent.XContentBuilder mappings) final MapperServicecreateMapperService(String mappings) protected final MapperServicecreateMapperService(BooleanSupplier idFieldEnabled, org.elasticsearch.xcontent.XContentBuilder mappings) protected final MapperServicecreateMapperService(Settings settings, String mappings) protected final MapperServicecreateMapperService(Settings settings, org.elasticsearch.xcontent.XContentBuilder mappings) protected final MapperServicecreateMapperService(IndexVersion version, Settings settings, BooleanSupplier idFieldDataEnabled) protected final MapperServicecreateMapperService(IndexVersion version, Settings settings, BooleanSupplier idFieldDataEnabled, org.elasticsearch.xcontent.XContentBuilder mapping) Create aMapperServicelike we would for an index.protected final MapperServicecreateMapperService(IndexVersion indexVersion, Settings settings, org.elasticsearch.xcontent.XContentBuilder mappings) protected final MapperServicecreateMapperService(IndexVersion version, org.elasticsearch.xcontent.XContentBuilder mapping) final MapperServicecreateMapperService(org.elasticsearch.xcontent.XContentBuilder mappings) protected SearchExecutionContextcreateSearchExecutionContext(MapperService mapperService) final SearchExecutionContextcreateSearchExecutionContext(MapperService mapperService, org.apache.lucene.search.IndexSearcher searcher) protected SearchExecutionContextcreateSearchExecutionContext(MapperService mapperService, org.apache.lucene.search.IndexSearcher searcher, Settings settings) final MapperServicecreateSytheticSourceMapperService(org.elasticsearch.xcontent.XContentBuilder mappings) protected MapperMetricsprotected final DocumentMappercreateTimeSeriesModeDocumentMapper(org.elasticsearch.xcontent.XContentBuilder mappings) protected static org.elasticsearch.xcontent.XContentBuilderdynamicMapping(Mapping dynamicMapping) protected TriFunction<MappedFieldType, Supplier<SearchLookup>, MappedFieldType.FielddataOperation, IndexFieldData<?>> fieldDataLookup(Function<String, Set<String>> sourcePathsLookup) protected TriFunction<MappedFieldType, Supplier<SearchLookup>, MappedFieldType.FielddataOperation, IndexFieldData<?>> fieldDataLookup(MapperService mapperService) protected static org.elasticsearch.xcontent.XContentBuilderfieldMapping(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildField) protected Settingsprotected final Settings.Builderprotected Collection<? extends Plugin> protected IndexVersionprotected org.apache.lucene.tests.index.RandomIndexWriterindexWriterForSyntheticSource(org.apache.lucene.store.Directory directory) static org.elasticsearch.xcontent.XContentBuildermapping(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildFields) protected static org.elasticsearch.xcontent.XContentBuildermappingNoSubobjects(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildFields) protected static org.elasticsearch.xcontent.XContentBuildermappingWithSubobjects(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildFields, String subobjects) protected static voidmerge(MapperService mapperService, String mapping) Merge a new mapping into the one in the providedMapperService.protected static voidmerge(MapperService mapperService, MapperService.MergeReason reason, String mapping) protected static voidmerge(MapperService mapperService, MapperService.MergeReason reason, org.elasticsearch.xcontent.XContentBuilder mapping) Merge a new mapping into the one in the providedMapperServicewith a specificMergeReasonprotected static voidmerge(MapperService mapperService, org.elasticsearch.xcontent.XContentBuilder mapping) Merge a new mapping into the one in the providedMapperService.protected static Stringprotected static org.elasticsearch.xcontent.XContentBuilderruntimeFieldMapping(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildField) protected static org.elasticsearch.xcontent.XContentBuilderruntimeMapping(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildFields) protected static SourceToParseBuild aSourceToParsewith an id of"1".protected static SourceToParsesource(String id, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> build, String routing) Build aSourceToParsewithout any dynamic templates.protected static SourceToParsesource(String id, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> build, String routing, Map<String, String> dynamicTemplates) Build aSourceToParse.static SourceToParsesource(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> build) Build aSourceToParsewith the id"1"and without any dynamic templates.protected static StringsyntheticSource(DocumentMapper mapper, org.apache.lucene.index.IndexReader reader, int docId) protected final StringsyntheticSource(DocumentMapper mapper, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> build) protected static StringsyntheticSource(DocumentMapper mapper, SourceFilter filter, org.apache.lucene.index.IndexReader reader, int docId) protected final StringsyntheticSource(DocumentMapper mapper, SourceFilter sourceFilter, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> build) protected static org.elasticsearch.xcontent.XContentBuildertopMapping(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildFields) protected voidvalidateRoundTripReader(String syntheticSource, org.apache.lucene.index.DirectoryReader reader, org.apache.lucene.index.DirectoryReader roundTripReader) protected final voidwithAggregationContext(MapperService mapperService, List<SourceToParse> docs, org.elasticsearch.core.CheckedConsumer<AggregationContext, IOException> test) protected final voidwithAggregationContext(MapperService mapperService, List<SourceToParse> docs, org.elasticsearch.core.CheckedConsumer<AggregationContext, IOException> test, Supplier<SearchLookup> lookupSupplier) protected final voidwithAggregationContext(ValuesSourceRegistry valuesSourceRegistry, MapperService mapperService, List<SourceToParse> docs, org.apache.lucene.search.Query query, org.elasticsearch.core.CheckedConsumer<AggregationContext, IOException> test) protected final voidwithAggregationContext(ValuesSourceRegistry valuesSourceRegistry, MapperService mapperService, List<SourceToParse> docs, org.apache.lucene.search.Query query, org.elasticsearch.core.CheckedConsumer<AggregationContext, IOException> test, Supplier<SearchLookup> lookupSupplier) protected static voidwithLuceneIndex(MapperService mapperService, org.elasticsearch.core.CheckedConsumer<org.apache.lucene.tests.index.RandomIndexWriter, IOException> builder, org.elasticsearch.core.CheckedConsumer<org.apache.lucene.index.DirectoryReader, IOException> test) protected final MapperServicewithMapping(MapperService mapperService, org.elasticsearch.xcontent.XContentBuilder mapping) protected static org.apache.lucene.index.DirectoryReaderwrapInMockESDirectoryReader(org.apache.lucene.index.DirectoryReader directoryReader) Methods inherited from class org.elasticsearch.index.mapper.FieldTypeTestCase
fetchSourceValue, fetchSourceValue, fetchSourceValues, fetchStoredValue, getFieldInfoWithName, getMappedFieldType, randomMockContext, testFieldHasValue, testFieldHasValueWithEmptyFieldInfosMethods inherited from class org.elasticsearch.test.ESTestCase
after, afterIfFailed, afterIfSuccessful, allBreakersMemoryReleased, asInstanceOf, assertArrayEquals, assertBusy, assertBusy, assertCriticalWarnings, assertEquals, assertLeakDetected, assertSettingDeprecationsAndWarnings, assertThat, assertThat, assertWarnings, assertWarnings, before, between, buildEnvSettings, buildNewFakeTransportAddress, captureLoggingLevel, checkStaticState, compatibleMediaType, copyInstance, copyNamedWriteable, copyNamedWriteable, copyWriteable, copyWriteable, createDefaultIndexAnalyzers, createParser, createParser, createParser, createParser, createParser, createParser, createParserWithCompatibilityFor, createTestAnalysis, createTestAnalysis, createTestAnalysis, createThreadPool, enableBigArraysReleasedCheck, enableWarningsCheck, ensureAllContextsReleased, ensureAllSearchContextsReleased, ensureCheckIndexPassed, ensureNoWarnings, ensureSupportedLocale, expectThrows, expectThrows, expectThrows, expectThrows, fail, fail, filteredWarnings, flushThreadPoolExecutor, frequently, generateRandomStringArray, generateRandomStringArray, getDataPath, getPortRange, getResourceDataPath, getSuiteFailureMarker, getTestTransportPlugin, getTestTransportType, getWorkerBasePort, indexSettings, indexSettings, indexSettings, inFipsJvm, initTestSeed, isTurkishLocale, iterations, maybeSet, mockScript, newEnvironment, newEnvironment, newLimitedBreaker, newNodeEnvironment, newNodeEnvironment, newSearcher, newSearcher, newSearcher, newSearcher, parserConfig, projectStateFromProject, projectStateWithEmptyProject, randomAlphanumericOfLength, randomAlphaOfLength, randomAlphaOfLengthBetween, randomAlphaOfLengthOrNull, randomArray, randomArray, randomBigInteger, randomBoolean, randomByte, randomByteArrayOfLength, randomByteBetween, randomBytesBetween, randomByteSizeValue, randomBytesReference, randomCompatibleMediaType, randomDateFormatterPattern, randomDouble, randomDoubleBetween, randomDoubles, randomDoubles, randomExecutor, randomFloat, randomFloatBetween, randomFloatOrNull, randomFrom, randomFrom, randomFrom, randomFrom, randomFrom, randomFrom, randomGeohash, randomIdentifier, randomInstantBetween, randomInt, randomInt, randomIntBetween, randomIntOrNull, randomInts, randomInts, randomIp, randomList, randomList, randomLong, randomLongBetween, randomLongOrNull, randomLongs, randomLongs, randomMap, randomMillisUpToYear9999, randomNegativeInt, randomNegativeLong, randomNonEmptySubsetOf, randomNonNegativeByte, randomNonNegativeInt, randomNonNegativeIntOrNull, randomNonNegativeLong, randomNonNegativeLongOrNull, randomOptionalBoolean, randomPositiveTimeValue, randomProjectIdOrDefault, randomRealisticUnicodeOfCodepointLength, randomRealisticUnicodeOfCodepointLengthBetween, randomRealisticUnicodeOfLength, randomRealisticUnicodeOfLengthBetween, randomReleasableBytesReference, randomSecretKey, randomSecureStringOfLength, randomSet, randomShort, randomSubsetOf, randomSubsetOf, randomSubsetOf, randomTimeValue, randomTimeValue, randomTimeValue, randomTimeZone, randomUnicodeOfCodepointLength, randomUnicodeOfCodepointLengthBetween, randomUnicodeOfLength, randomUnicodeOfLengthBetween, randomUnique, randomUniqueProjectId, randomUnsignedLongBetween, randomUUID, randomValueOtherThan, randomValueOtherThanMany, randomVendorType, randomZone, removeHeaderWarningAppender, resetCheckIndexStatus, resetPortCounter, restoreContentType, restoreFileSystem, restoreLoggingLevel, runInParallel, safeAcquire, safeAcquire, safeAwait, safeAwait, safeAwait, safeAwait, safeAwait, safeAwait, safeAwaitAndUnwrapFailure, safeAwaitFailure, safeAwaitFailure, safeAwaitFailure, safeAwaitFailure, safeExecute, safeGet, safeGet, safeSleep, safeSleep, scaledRandomIntBetween, secureRandom, secureRandom, secureRandomFips, secureRandomFips, secureRandomNonFips, secureRandomNonFips, setContentType, setFileSystem, setHeaderWarningAppender, settings, shuffledList, shuffleMap, shuffleXContent, shuffleXContent, skipTestWaitingForLuceneFix, spinForAtLeastNMilliseconds, spinForAtLeastOneMillisecond, startInParallel, terminate, terminate, tmpPaths, toShuffledXContent, toShuffledXContent, waitUntil, waitUntil, writableRegistry, xContentRegistryMethods inherited from class org.apache.lucene.tests.util.LuceneTestCase
addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertDoubleUlpEquals, assertFieldInfosEquals, assertFloatUlpEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, callStackContains, callStackContains, callStackContainsAnyOf, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, ensureSaneIWCOnNightly, expectThrows, expectThrows, expectThrows, expectThrowsAnyOf, expectThrowsAnyOf, getDataInputStream, getJvmForkArguments, getOnlyLeafReader, getTestClass, getTestName, isTestThread, localeForLanguageTag, maybeChangeLiveIndexWriterConfig, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newDirectory, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMaybeVirusCheckingDirectory, newMaybeVirusCheckingFSDirectory, newMergePolicy, newMergePolicy, newMergePolicy, newMockDirectory, newMockDirectory, newMockDirectory, newMockFSDirectory, newMockFSDirectory, newSearcher, newSnapshotIndexWriterConfig, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, randomVectorFormat, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, runWithRestrictedPermissions, setIndexWriterMaxDocs, setUp, setupCPUCoreCount, setUpExecutorService, shutdownExecutorService, slowFileExists, tearDown, usually, usually, wrapReaderMethods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
-
Field Details
-
SETTINGS
-
INCLUDE_DEFAULTS
protected static final org.elasticsearch.xcontent.ToXContent.Params INCLUDE_DEFAULTS
-
-
Constructor Details
-
MapperServiceTestCase
public MapperServiceTestCase()
-
-
Method Details
-
getPlugins
-
getIndexSettings
-
getIndexSettingsBuilder
-
createIndexAnalyzers
-
createIndexAnalyzers
-
randomIndexOptions
-
createDocumentMapper
protected final DocumentMapper createDocumentMapper(org.elasticsearch.xcontent.XContentBuilder mappings, IndexMode indexMode) throws IOException - Throws:
IOException
-
createDocumentMapper
protected final DocumentMapper createDocumentMapper(org.elasticsearch.xcontent.XContentBuilder mappings) throws IOException - Throws:
IOException
-
createTimeSeriesModeDocumentMapper
protected final DocumentMapper createTimeSeriesModeDocumentMapper(org.elasticsearch.xcontent.XContentBuilder mappings) throws IOException - Throws:
IOException
-
createLogsModeDocumentMapper
protected final DocumentMapper createLogsModeDocumentMapper(org.elasticsearch.xcontent.XContentBuilder mappings) throws IOException - Throws:
IOException
-
createDocumentMapper
protected final DocumentMapper createDocumentMapper(IndexVersion version, org.elasticsearch.xcontent.XContentBuilder mappings) throws IOException - Throws:
IOException
-
createDocumentMapper
- Throws:
IOException
-
createMapperService
public final MapperService createMapperService(org.elasticsearch.xcontent.XContentBuilder mappings) throws IOException - Throws:
IOException
-
createSytheticSourceMapperService
public final MapperService createSytheticSourceMapperService(org.elasticsearch.xcontent.XContentBuilder mappings) throws IOException - Throws:
IOException
-
getVersion
-
createMapperService
protected final MapperService createMapperService(Settings settings, org.elasticsearch.xcontent.XContentBuilder mappings) throws IOException - Throws:
IOException
-
createMapperService
protected final MapperService createMapperService(BooleanSupplier idFieldEnabled, org.elasticsearch.xcontent.XContentBuilder mappings) throws IOException - Throws:
IOException
-
createMapperService
- Throws:
IOException
-
createMapperService
protected final MapperService createMapperService(Settings settings, String mappings) throws IOException - Throws:
IOException
-
createMapperService
protected final MapperService createMapperService(IndexVersion indexVersion, Settings settings, org.elasticsearch.xcontent.XContentBuilder mappings) throws IOException - Throws:
IOException
-
createMapperService
protected final MapperService createMapperService(IndexVersion version, org.elasticsearch.xcontent.XContentBuilder mapping) throws IOException - Throws:
IOException
-
createMapperService
protected final MapperService createMapperService(IndexVersion version, Settings settings, BooleanSupplier idFieldDataEnabled, org.elasticsearch.xcontent.XContentBuilder mapping) throws IOException Create aMapperServicelike we would for an index.- Throws:
IOException
-
createMapperService
protected final MapperService createMapperService(IndexVersion version, Settings settings, BooleanSupplier idFieldDataEnabled) -
withMapping
protected final MapperService withMapping(MapperService mapperService, org.elasticsearch.xcontent.XContentBuilder mapping) throws IOException - Throws:
IOException
-
compileScript
This is the injection point for tests that require mock scripts. Test cases should override this to return the mock script factory of their choice. -
createIndexSettings
-
createTestMapperMetrics
-
withLuceneIndex
protected static void withLuceneIndex(MapperService mapperService, org.elasticsearch.core.CheckedConsumer<org.apache.lucene.tests.index.RandomIndexWriter, IOException> builder, org.elasticsearch.core.CheckedConsumer<org.apache.lucene.index.DirectoryReader, throws IOExceptionIOException> test) - Throws:
IOException
-
source
public static SourceToParse source(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> build) throws IOExceptionBuild aSourceToParsewith the id"1"and without any dynamic templates.- Throws:
IOException
-
source
protected static SourceToParse source(@Nullable String id, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> build, @Nullable String routing) throws IOExceptionBuild aSourceToParsewithout any dynamic templates.- Throws:
IOException
-
source
protected static SourceToParse source(@Nullable String id, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> build, @Nullable String routing, Map<String, throws IOExceptionString> dynamicTemplates) Build aSourceToParse.- Throws:
IOException
-
source
Build aSourceToParsewith an id of"1". -
merge
protected static void merge(MapperService mapperService, org.elasticsearch.xcontent.XContentBuilder mapping) throws IOException Merge a new mapping into the one in the providedMapperService.- Throws:
IOException
-
merge
Merge a new mapping into the one in the providedMapperService.- Throws:
IOException
-
merge
protected static void merge(MapperService mapperService, MapperService.MergeReason reason, String mapping) throws IOException - Throws:
IOException
-
merge
protected static void merge(MapperService mapperService, MapperService.MergeReason reason, org.elasticsearch.xcontent.XContentBuilder mapping) throws IOException Merge a new mapping into the one in the providedMapperServicewith a specificMergeReason- Throws:
IOException
-
topMapping
protected static org.elasticsearch.xcontent.XContentBuilder topMapping(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildFields) throws IOException- Throws:
IOException
-
mappingNoSubobjects
protected static org.elasticsearch.xcontent.XContentBuilder mappingNoSubobjects(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildFields) throws IOException- Throws:
IOException
-
mappingWithSubobjects
protected static org.elasticsearch.xcontent.XContentBuilder mappingWithSubobjects(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildFields, String subobjects) throws IOException- Throws:
IOException
-
mapping
public static org.elasticsearch.xcontent.XContentBuilder mapping(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildFields) throws IOException- Throws:
IOException
-
dynamicMapping
protected static org.elasticsearch.xcontent.XContentBuilder dynamicMapping(Mapping dynamicMapping) throws IOException - Throws:
IOException
-
fieldMapping
protected static org.elasticsearch.xcontent.XContentBuilder fieldMapping(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildField) throws IOException- Throws:
IOException
-
runtimeFieldMapping
protected static org.elasticsearch.xcontent.XContentBuilder runtimeFieldMapping(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildField) throws IOException- Throws:
IOException
-
runtimeMapping
protected static org.elasticsearch.xcontent.XContentBuilder runtimeMapping(org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> buildFields) throws IOException- Throws:
IOException
-
withAggregationContext
protected final void withAggregationContext(MapperService mapperService, List<SourceToParse> docs, org.elasticsearch.core.CheckedConsumer<AggregationContext, IOException> test) throws IOException- Throws:
IOException
-
withAggregationContext
protected final void withAggregationContext(MapperService mapperService, List<SourceToParse> docs, org.elasticsearch.core.CheckedConsumer<AggregationContext, IOException> test, Supplier<SearchLookup> lookupSupplier) throws IOException- Throws:
IOException
-
withAggregationContext
protected final void withAggregationContext(ValuesSourceRegistry valuesSourceRegistry, MapperService mapperService, List<SourceToParse> docs, org.apache.lucene.search.Query query, org.elasticsearch.core.CheckedConsumer<AggregationContext, IOException> test) throws IOException- Throws:
IOException
-
withAggregationContext
protected final void withAggregationContext(ValuesSourceRegistry valuesSourceRegistry, MapperService mapperService, List<SourceToParse> docs, org.apache.lucene.search.Query query, org.elasticsearch.core.CheckedConsumer<AggregationContext, IOException> test, Supplier<SearchLookup> lookupSupplier) throws IOException- Throws:
IOException
-
createSearchExecutionContext
-
createSearchExecutionContext
public final SearchExecutionContext createSearchExecutionContext(MapperService mapperService, org.apache.lucene.search.IndexSearcher searcher) -
createSearchExecutionContext
protected SearchExecutionContext createSearchExecutionContext(MapperService mapperService, org.apache.lucene.search.IndexSearcher searcher, Settings settings) -
fieldDataLookup
protected TriFunction<MappedFieldType,Supplier<SearchLookup>, fieldDataLookupMappedFieldType.FielddataOperation, IndexFieldData<?>> (MapperService mapperService) -
fieldDataLookup
protected TriFunction<MappedFieldType,Supplier<SearchLookup>, fieldDataLookupMappedFieldType.FielddataOperation, IndexFieldData<?>> (Function<String, Set<String>> sourcePathsLookup) -
indexWriterForSyntheticSource
protected org.apache.lucene.tests.index.RandomIndexWriter indexWriterForSyntheticSource(org.apache.lucene.store.Directory directory) throws IOException - Throws:
IOException
-
syntheticSource
protected final String syntheticSource(DocumentMapper mapper, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> build) throws IOException- Throws:
IOException
-
syntheticSource
protected final String syntheticSource(DocumentMapper mapper, @Nullable SourceFilter sourceFilter, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> build) throws IOException- Throws:
IOException
-
syntheticSource
protected static String syntheticSource(DocumentMapper mapper, org.apache.lucene.index.IndexReader reader, int docId) throws IOException - Throws:
IOException
-
syntheticSource
protected static String syntheticSource(DocumentMapper mapper, SourceFilter filter, org.apache.lucene.index.IndexReader reader, int docId) throws IOException - Throws:
IOException
-
validateRoundTripReader
protected void validateRoundTripReader(String syntheticSource, org.apache.lucene.index.DirectoryReader reader, org.apache.lucene.index.DirectoryReader roundTripReader) throws IOException - Throws:
IOException
-
wrapInMockESDirectoryReader
protected static org.apache.lucene.index.DirectoryReader wrapInMockESDirectoryReader(org.apache.lucene.index.DirectoryReader directoryReader) throws IOException - Throws:
IOException
-