问:
NoSuchMethodError: org.springframework.data.util.TypeInformation.isSubTypeOf(Ljava/lang/Class;)Z
I am using Spring Data Elasticsearch with Elasticsearch version 7.4.
Maven:

```<code>    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
        <version>2.1.7.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-elasticsearch</artifactId>
        <version>4.0.0.BUILD-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-commons</artifactId>
        <version>2.1.10.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>7.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-high-level-client</artifactId>
        <version>7.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-client</artifactId>
        <version>7.4.0</version>
    </dependency>
</code>```

Model

```<code>@AllArgsConstructor
@NoArgsConstructor
@Data
@Document(indexName = "address", createIndex = true)
public class Address {
    @Id
    private String id;
    private String fullAddress;

    @Field(type = FieldType.Nested, store = true)
    private List<Entry> parts;

    public Address(String fullAddress) {
        this.fullAddress = fullAddress;
    }

    public Address(String fullAddress, List<Entry> entryList) {
        this.fullAddress = fullAddress;
        this.parts = entryList;
    }
}

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Entry {
    private String aoid;
    private String aoGuid;
    private String code;
    private String offName;
    private String parentGuid;
    private String shortName;
    @Field(type = FieldType.Integer)
    private Integer aoLevel;
    private String postalCode;
}
</code>```

Repository:

```<code>@Repository
public interface AddressElasticRepository extends ElasticsearchRepository<Address, String> {
    List<Address> findByFullAddressContains(String fullAddress);
}
</code>```

Service

```<code>@Service
public class SearchServiceImpl implements SearchService {
    private final AddressElasticRepository addressElasticRepository;

    public SearchServiceImpl(AddressElasticRepository addressElasticRepository) {
        this.addressElasticRepository = addressElasticRepository;
    }

    @Override
    public List<Document> search(String query) {
        List<Address> all = addressElasticRepository.findByFullAddressContains(query);
        all.forEach(it -> log.info("-- " + it.getFullAddress()));

        return null;
    }

    @Override
    public void save(Address address) {
        addressElasticRepository.save(address);
    }
}
</code>```

Controller:

```<code>@Controller
public class SearchController {
    private final SearchService searchService;

    public SearchController(SearchService searchService) {
        this.searchService = searchService;
    }

    @RequestMapping(value = "/api/v1/fias/search", method = GET)
    public List<Document> search(@RequestParam String query) {
        return searchService.search(query);
    }
}
</code>```

When I do a search: localhost:8189/api/v1/fias/search?query=Moscow I get an error:

java.lang.NoSuchMethodError:
  org.springframework.data.util.TypeInformation.isSubTypeOf(Ljava/lang/Class;)Z

The error occurs on the line (SearchServiceImpl.java:23): List  all = addressElasticRepository.findByFullAddressContains (query);

How to fix it?

UPD: Full StackTrace

java.lang.NoSuchMethodError:
  org.springframework.data.util.TypeInformation.isSubTypeOf(Ljava/lang/Class;)Z
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.createCollectionForValue(MappingElasticsearchConverter.java:675)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.readCollectionValue(MappingElasticsearchConverter.java:362)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.readValue(MappingElasticsearchConverter.java:345)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter$ElasticsearchPropertyValueProvider.getPropertyValue(MappingElasticsearchConverter.java:876)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.readProperties(MappingElasticsearchConverter.java:319)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.readEntity(MappingElasticsearchConverter.java:267)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.read(MappingElasticsearchConverter.java:247)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.mapDocument(MappingElasticsearchConverter.java:220)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.read(MappingElasticsearchConverter.java:188)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.lambda$read$1(MappingElasticsearchConverter.java:169)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
  ~[na:1.8.0_201]   at
  java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
  ~[na:1.8.0_201]   at
  java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
  ~[na:1.8.0_201]   at
  java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
  ~[na:1.8.0_201]   at
  java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
  ~[na:1.8.0_201]   at
  java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
  ~[na:1.8.0_201]   at
  java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
  ~[na:1.8.0_201]   at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.read(MappingElasticsearchConverter.java:170)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.search(ElasticsearchRestTemplate.java:244)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.repository.query.ElasticsearchPartQuery.execute(ElasticsearchPartQuery.java:106)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:605)
  ~[spring-data-commons-2.1.10.RELEASE.jar:2.1.10.RELEASE]  at
  org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$invoke$3(RepositoryFactorySupport.java:595)
  ~[spring-data-commons-2.1.10.RELEASE.jar:2.1.10.RELEASE]  at
  org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:595)
  ~[spring-data-commons-2.1.10.RELEASE.jar:2.1.10.RELEASE]  at
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
  ~[spring-data-commons-2.1.10.RELEASE.jar:2.1.10.RELEASE]  at
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
  ~[spring-data-commons-2.1.10.RELEASE.jar:2.1.10.RELEASE]  at
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  com.sun.proxy.$Proxy120.findByFullAddressContains(Unknown Source)
  ~[na:na]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
  Method) ~[na:1.8.0_201]   at
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  ~[na:1.8.0_201]   at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  ~[na:1.8.0_201]   at java.lang.reflect.Method.invoke(Method.java:498)
  ~[na:1.8.0_201]   at
  org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:338)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
  ~[spring-tx-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  com.sun.proxy.$Proxy120.findByFullAddressContains(Unknown Source)
  ~[na:na]  at
  ru.evolenta.server.service.impl.SearchServiceImpl.search(SearchServiceImpl.java:23)
  ~[classes/:na]    at
  ru.evolenta.server.controller.SearchController.search(SearchController.java:27)
  ~[classes/:na]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
  Method) ~[na:1.8.0_201]   at
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  ~[na:1.8.0_201]   at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  ~[na:1.8.0_201]   at java.lang.reflect.Method.invoke(Method.java:498)
  ~[na:1.8.0_201]   at
  org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:870)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:776)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:870)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  ~[tomcat-embed-websocket-8.5.28.jar:8.5.28]   at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:158)
  ~[spring-boot-actuator-2.0.0.RELEASE.jar:2.0.0.RELEASE]   at
  org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:126)
  ~[spring-boot-actuator-2.0.0.RELEASE.jar:2.0.0.RELEASE]   at
  org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:111)
  ~[spring-boot-actuator-2.0.0.RELEASE.jar:2.0.0.RELEASE]   at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:84)
  ~[spring-boot-actuator-2.0.0.RELEASE.jar:2.0.0.RELEASE]   at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  ru.evolenta.server.filters.SimpleCORSFilter.doFilter(SimpleCORSFilter.java:51)
  ~[classes/:na]    at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:209)
  ~[spring-security-web-5.0.3.RELEASE.jar:5.0.3.RELEASE]    at
  org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
  ~[spring-security-web-5.0.3.RELEASE.jar:5.0.3.RELEASE]    at
  org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  [na:1.8.0_201]    at
  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  [na:1.8.0_201]    at
  org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  java.lang.Thread.run(Thread.java:748) [na:1.8.0_201]

UPD 2: Error in spring-data-commons version. The isSubTypeOf method appeared after version 2.2. If I upgrade, the application does not start, here is the stack trace:

java.lang.NoSuchFieldError: IMPORT_BEAN_NAME_GENERATOR    at
  org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport.registerBeanDefinitions(RepositoryBeanDefinitionRegistrarSupport.java:78)
  ~[spring-data-commons-2.2.1.RELEASE.jar:2.2.1.RELEASE]    at
  org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromRegistrars$0(ConfigurationClassBeanDefinitionReader.java:360)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
  ~[na:1.8.0_201]   at
  org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:359)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:328)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:693)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
  ~[spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]    at
  org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752)
  [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]     at
  org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:388)
  [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]     at
  org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
  [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]     at
  org.springframework.boot.SpringApplication.run(SpringApplication.java:1246)
  [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]     at
  org.springframework.boot.SpringApplication.run(SpringApplication.java:1234)
  [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]     at
  ru.evolenta.server.CoreFiasApplication.main(CoreFiasApplication.java:21)
  [classes/:na]

答:
@GiorgiTsiklauri Your tips helped me come to the right decision. I carefully read the stack trace and explored the dependencies of my version of Spring Boot. In Spring-boot-dependencies-2.0.0.RELEASE.pom lists version 5.6.8 for ElasticSearch (my version 7.4). I rewrote my code according to this answer - https://stackoverflow.com/a/58371997/9312228. Everything worked for me! I needed a CustomElasticSearchConverter and an ElasticsearchRestTemplate configured with it.

```<code>    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>7.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-high-level-client</artifactId>
        <version>7.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-client</artifactId>
        <version>7.4.0</version>
    </dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    <version>2.0.0.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-elasticsearch</artifactId>
    <version>4.0.0.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-commons</artifactId>
    <version>2.1.10.RELEASE</version>
</dependency>

class CustomElasticSearchConverter extends MappingElasticsearchConverter {

    private CustomConversions conversions = new ElasticsearchCustomConversions(Collections.emptyList());

    CustomElasticSearchConverter(MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext) {
        super(mappingContext);
        setConversions(conversions);
    }

    CustomElasticSearchConverter(MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext, GenericConversionService conversionService) {
        super(mappingContext, conversionService);
        setConversions(conversions);
    }

    @Override
    protected <R> R readValue(@Nullable Object source, ElasticsearchPersistentProperty property,
                              TypeInformation<R> targetType) {

        if (source == null) {
            return null;
        }

        if (source instanceof List) {
            return readCollectionValue((List) source, property, targetType);
        }

        return super.readValue(source, property, targetType);
    }

    private Object readSimpleValue(@Nullable Object value, TypeInformation<?> targetType) {

        Class<?> target = targetType.getType();

        if (value == null || target == null || ClassUtils.isAssignableValue(target, value)) {
            return value;
        }

        if (conversions.hasCustomReadTarget(value.getClass(), target)) {
            return getConversionService().convert(value, target);
        }

        if (Enum.class.isAssignableFrom(target)) {
            return Enum.valueOf((Class<Enum>) target, value.toString());
        }

        return getConversionService().convert(value, target);
    }

    private <R> R readCollectionValue(@Nullable List<?> source, ElasticsearchPersistentProperty property,
                                      TypeInformation<R> targetType) {

        if (source == null) {
            return null;
        }

        Collection<Object> target = createCollectionForValue(targetType, source.size());

        for (Object value : source) {

            if (isSimpleType(value)) {
                target.add(
                        readSimpleValue(value, targetType.getComponentType() != null ? targetType.getComponentType() : targetType));
            } else {

                if (value instanceof List) {
                    target.add(readValue(value, property, property.getTypeInformation().getActualType()));
                } else {
                    target.add(readEntity(computeGenericValueTypeForRead(property, value), (Map) value));
                }
            }
        }

        return (R) target;
    }

    private Collection<Object> createCollectionForValue(TypeInformation<?> collectionTypeInformation, int size) {

        Class<?> collectionType = collectionTypeInformation.isCollectionLike()//
                ? collectionTypeInformation.getType() //
                : List.class;

        TypeInformation<?> componentType = collectionTypeInformation.getComponentType() != null //
                ? collectionTypeInformation.getComponentType() //
                : ClassTypeInformation.OBJECT;

        return collectionTypeInformation.getType().isArray() //
                ? new ArrayList<>(size) //
                : CollectionFactory.createCollection(collectionType, componentType.getType(), size);
    }

    private ElasticsearchPersistentEntity<?> computeGenericValueTypeForRead(ElasticsearchPersistentProperty property,
                                                                            Object value) {

        return ClassTypeInformation.OBJECT.equals(property.getTypeInformation().getActualType())
                ? getMappingContext().getRequiredPersistentEntity(value.getClass())
                : getMappingContext().getRequiredPersistentEntity(property.getTypeInformation().getActualType());
    }

    private boolean isSimpleType(Object value) {
        return isSimpleType(value.getClass());
    }

    private boolean isSimpleType(Class<?> type) {
        return conversions.isSimpleType(type);
    }
}
</code>```

My config:

```<code>@Bean
RestHighLevelClient elasticsearchClient() {
    return new RestHighLevelClient(RestClient.builder(
            new HttpHost(host, port)
    ));
}

@Primary
@Bean
public ElasticsearchRestTemplate elasticsearchTemplate() {
    CustomElasticSearchConverter converter = new CustomElasticSearchConverter(new SimpleElasticsearchMappingContext(), createConversionService());
    return new ElasticsearchRestTemplate(elasticsearchClient(), converter);
}

private DefaultConversionService createConversionService() {
    return new DefaultConversionService();
}
</code>```

and launcher:

```<code>@SpringBootApplication(exclude = {ElasticsearchAutoConfiguration.class})
</code>```

Body:
I am using Spring Data Elasticsearch with Elasticsearch version 7.4.
Maven:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
        <version>2.1.7.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-elasticsearch</artifactId>
        <version>4.0.0.BUILD-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-commons</artifactId>
        <version>2.1.10.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>7.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-high-level-client</artifactId>
        <version>7.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-client</artifactId>
        <version>7.4.0</version>
    </dependency>

Model

@AllArgsConstructor
@NoArgsConstructor
@Data
@Document(indexName = "address", createIndex = true)
public class Address {
    @Id
    private String id;
    private String fullAddress;

    @Field(type = FieldType.Nested, store = true)
    private List<Entry> parts;

    public Address(String fullAddress) {
        this.fullAddress = fullAddress;
    }

    public Address(String fullAddress, List<Entry> entryList) {
        this.fullAddress = fullAddress;
        this.parts = entryList;
    }
}

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Entry {
    private String aoid;
    private String aoGuid;
    private String code;
    private String offName;
    private String parentGuid;
    private String shortName;
    @Field(type = FieldType.Integer)
    private Integer aoLevel;
    private String postalCode;
}

Repository:

@Repository
public interface AddressElasticRepository extends ElasticsearchRepository<Address, String> {
    List<Address> findByFullAddressContains(String fullAddress);
}

Service

@Service
public class SearchServiceImpl implements SearchService {
    private final AddressElasticRepository addressElasticRepository;

    public SearchServiceImpl(AddressElasticRepository addressElasticRepository) {
        this.addressElasticRepository = addressElasticRepository;
    }

    @Override
    public List<Document> search(String query) {
        List<Address> all = addressElasticRepository.findByFullAddressContains(query);
        all.forEach(it -> log.info("-- " + it.getFullAddress()));

        return null;
    }

    @Override
    public void save(Address address) {
        addressElasticRepository.save(address);
    }
}

Controller:

@Controller
public class SearchController {
    private final SearchService searchService;

    public SearchController(SearchService searchService) {
        this.searchService = searchService;
    }

    @RequestMapping(value = "/api/v1/fias/search", method = GET)
    public List<Document> search(@RequestParam String query) {
        return searchService.search(query);
    }
}

When I do a search: localhost:8189/api/v1/fias/search?query=Moscow I get an error:

java.lang.NoSuchMethodError:
  org.springframework.data.util.TypeInformation.isSubTypeOf(Ljava/lang/Class;)Z

The error occurs on the line (SearchServiceImpl.java:23): List  all = addressElasticRepository.findByFullAddressContains (query);

How to fix it?

UPD: Full StackTrace

java.lang.NoSuchMethodError:
  org.springframework.data.util.TypeInformation.isSubTypeOf(Ljava/lang/Class;)Z
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.createCollectionForValue(MappingElasticsearchConverter.java:675)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.readCollectionValue(MappingElasticsearchConverter.java:362)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.readValue(MappingElasticsearchConverter.java:345)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter$ElasticsearchPropertyValueProvider.getPropertyValue(MappingElasticsearchConverter.java:876)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.readProperties(MappingElasticsearchConverter.java:319)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.readEntity(MappingElasticsearchConverter.java:267)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.read(MappingElasticsearchConverter.java:247)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.mapDocument(MappingElasticsearchConverter.java:220)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.read(MappingElasticsearchConverter.java:188)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.lambda$read$1(MappingElasticsearchConverter.java:169)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
  ~[na:1.8.0_201]   at
  java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
  ~[na:1.8.0_201]   at
  java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
  ~[na:1.8.0_201]   at
  java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
  ~[na:1.8.0_201]   at
  java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
  ~[na:1.8.0_201]   at
  java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
  ~[na:1.8.0_201]   at
  java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
  ~[na:1.8.0_201]   at
  org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter.read(MappingElasticsearchConverter.java:170)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.search(ElasticsearchRestTemplate.java:244)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.elasticsearch.repository.query.ElasticsearchPartQuery.execute(ElasticsearchPartQuery.java:106)
  ~[spring-data-elasticsearch-4.0.0.BUILD-20200217.043541-321.jar:4.0.0.BUILD-SNAPSHOT]
    at
  org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:605)
  ~[spring-data-commons-2.1.10.RELEASE.jar:2.1.10.RELEASE]  at
  org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$invoke$3(RepositoryFactorySupport.java:595)
  ~[spring-data-commons-2.1.10.RELEASE.jar:2.1.10.RELEASE]  at
  org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:595)
  ~[spring-data-commons-2.1.10.RELEASE.jar:2.1.10.RELEASE]  at
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
  ~[spring-data-commons-2.1.10.RELEASE.jar:2.1.10.RELEASE]  at
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
  ~[spring-data-commons-2.1.10.RELEASE.jar:2.1.10.RELEASE]  at
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  com.sun.proxy.$Proxy120.findByFullAddressContains(Unknown Source)
  ~[na:na]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
  Method) ~[na:1.8.0_201]   at
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  ~[na:1.8.0_201]   at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  ~[na:1.8.0_201]   at java.lang.reflect.Method.invoke(Method.java:498)
  ~[na:1.8.0_201]   at
  org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:338)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
  ~[spring-tx-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
  ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  com.sun.proxy.$Proxy120.findByFullAddressContains(Unknown Source)
  ~[na:na]  at
  ru.evolenta.server.service.impl.SearchServiceImpl.search(SearchServiceImpl.java:23)
  ~[classes/:na]    at
  ru.evolenta.server.controller.SearchController.search(SearchController.java:27)
  ~[classes/:na]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
  Method) ~[na:1.8.0_201]   at
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  ~[na:1.8.0_201]   at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  ~[na:1.8.0_201]   at java.lang.reflect.Method.invoke(Method.java:498)
  ~[na:1.8.0_201]   at
  org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:870)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:776)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:870)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855)
  ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]  at
  javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  ~[tomcat-embed-websocket-8.5.28.jar:8.5.28]   at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:158)
  ~[spring-boot-actuator-2.0.0.RELEASE.jar:2.0.0.RELEASE]   at
  org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:126)
  ~[spring-boot-actuator-2.0.0.RELEASE.jar:2.0.0.RELEASE]   at
  org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:111)
  ~[spring-boot-actuator-2.0.0.RELEASE.jar:2.0.0.RELEASE]   at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:84)
  ~[spring-boot-actuator-2.0.0.RELEASE.jar:2.0.0.RELEASE]   at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  ru.evolenta.server.filters.SimpleCORSFilter.doFilter(SimpleCORSFilter.java:51)
  ~[classes/:na]    at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:209)
  ~[spring-security-web-5.0.3.RELEASE.jar:5.0.3.RELEASE]    at
  org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
  ~[spring-security-web-5.0.3.RELEASE.jar:5.0.3.RELEASE]    at
  org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
  ~[tomcat-embed-core-8.5.28.jar:8.5.28]    at
  org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  [na:1.8.0_201]    at
  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  [na:1.8.0_201]    at
  org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  [tomcat-embed-core-8.5.28.jar:8.5.28]     at
  java.lang.Thread.run(Thread.java:748) [na:1.8.0_201]

UPD 2: Error in spring-data-commons version. The isSubTypeOf method appeared after version 2.2. If I upgrade, the application does not start, here is the stack trace:

java.lang.NoSuchFieldError: IMPORT_BEAN_NAME_GENERATOR    at
  org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport.registerBeanDefinitions(RepositoryBeanDefinitionRegistrarSupport.java:78)
  ~[spring-data-commons-2.2.1.RELEASE.jar:2.2.1.RELEASE]    at
  org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromRegistrars$0(ConfigurationClassBeanDefinitionReader.java:360)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
  ~[na:1.8.0_201]   at
  org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:359)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:328)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:693)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
  ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]     at
  org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
  ~[spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]    at
  org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752)
  [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]     at
  org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:388)
  [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]     at
  org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
  [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]     at
  org.springframework.boot.SpringApplication.run(SpringApplication.java:1246)
  [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]     at
  org.springframework.boot.SpringApplication.run(SpringApplication.java:1234)
  [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]     at
  ru.evolenta.server.CoreFiasApplication.main(CoreFiasApplication.java:21)
  [classes/:na]

Body:
@GiorgiTsiklauri Your tips helped me come to the right decision. I carefully read the stack trace and explored the dependencies of my version of Spring Boot. In Spring-boot-dependencies-2.0.0.RELEASE.pom lists version 5.6.8 for ElasticSearch (my version 7.4). I rewrote my code according to this answer - https://stackoverflow.com/a/58371997/9312228. Everything worked for me! I needed a CustomElasticSearchConverter and an ElasticsearchRestTemplate configured with it.

    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>7.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-high-level-client</artifactId>
        <version>7.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-client</artifactId>
        <version>7.4.0</version>
    </dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    <version>2.0.0.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-elasticsearch</artifactId>
    <version>4.0.0.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-commons</artifactId>
    <version>2.1.10.RELEASE</version>
</dependency>

class CustomElasticSearchConverter extends MappingElasticsearchConverter {

    private CustomConversions conversions = new ElasticsearchCustomConversions(Collections.emptyList());

    CustomElasticSearchConverter(MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext) {
        super(mappingContext);
        setConversions(conversions);
    }

    CustomElasticSearchConverter(MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext, GenericConversionService conversionService) {
        super(mappingContext, conversionService);
        setConversions(conversions);
    }

    @Override
    protected <R> R readValue(@Nullable Object source, ElasticsearchPersistentProperty property,
                              TypeInformation<R> targetType) {

        if (source == null) {
            return null;
        }

        if (source instanceof List) {
            return readCollectionValue((List) source, property, targetType);
        }

        return super.readValue(source, property, targetType);
    }

    private Object readSimpleValue(@Nullable Object value, TypeInformation<?> targetType) {

        Class<?> target = targetType.getType();

        if (value == null || target == null || ClassUtils.isAssignableValue(target, value)) {
            return value;
        }

        if (conversions.hasCustomReadTarget(value.getClass(), target)) {
            return getConversionService().convert(value, target);
        }

        if (Enum.class.isAssignableFrom(target)) {
            return Enum.valueOf((Class<Enum>) target, value.toString());
        }

        return getConversionService().convert(value, target);
    }

    private <R> R readCollectionValue(@Nullable List<?> source, ElasticsearchPersistentProperty property,
                                      TypeInformation<R> targetType) {

        if (source == null) {
            return null;
        }

        Collection<Object> target = createCollectionForValue(targetType, source.size());

        for (Object value : source) {

            if (isSimpleType(value)) {
                target.add(
                        readSimpleValue(value, targetType.getComponentType() != null ? targetType.getComponentType() : targetType));
            } else {

                if (value instanceof List) {
                    target.add(readValue(value, property, property.getTypeInformation().getActualType()));
                } else {
                    target.add(readEntity(computeGenericValueTypeForRead(property, value), (Map) value));
                }
            }
        }

        return (R) target;
    }

    private Collection<Object> createCollectionForValue(TypeInformation<?> collectionTypeInformation, int size) {

        Class<?> collectionType = collectionTypeInformation.isCollectionLike()//
                ? collectionTypeInformation.getType() //
                : List.class;

        TypeInformation<?> componentType = collectionTypeInformation.getComponentType() != null //
                ? collectionTypeInformation.getComponentType() //
                : ClassTypeInformation.OBJECT;

        return collectionTypeInformation.getType().isArray() //
                ? new ArrayList<>(size) //
                : CollectionFactory.createCollection(collectionType, componentType.getType(), size);
    }

    private ElasticsearchPersistentEntity<?> computeGenericValueTypeForRead(ElasticsearchPersistentProperty property,
                                                                            Object value) {

        return ClassTypeInformation.OBJECT.equals(property.getTypeInformation().getActualType())
                ? getMappingContext().getRequiredPersistentEntity(value.getClass())
                : getMappingContext().getRequiredPersistentEntity(property.getTypeInformation().getActualType());
    }

    private boolean isSimpleType(Object value) {
        return isSimpleType(value.getClass());
    }

    private boolean isSimpleType(Class<?> type) {
        return conversions.isSimpleType(type);
    }
}

My config:

@Bean
RestHighLevelClient elasticsearchClient() {
    return new RestHighLevelClient(RestClient.builder(
            new HttpHost(host, port)
    ));
}

@Primary
@Bean
public ElasticsearchRestTemplate elasticsearchTemplate() {
    CustomElasticSearchConverter converter = new CustomElasticSearchConverter(new SimpleElasticsearchMappingContext(), createConversionService());
    return new ElasticsearchRestTemplate(elasticsearchClient(), converter);
}

private DefaultConversionService createConversionService() {
    return new DefaultConversionService();
}

and launcher:

@SpringBootApplication(exclude = {ElasticsearchAutoConfiguration.class})


来源: stackexchange

问:
How would you centralize configuration across multiple projects?
I have a solution with about 10 projects with read-only config.  They are web applications, windows services, console apps, etc.  All projects except for one are on the same server.  Each project has 3 environments - dev, test, and production.  So there are 30 different sets of configuration, each one with a decent number of settings.  It's cumbersome to keep the config consistent across every app and environment.

I've noticed most of the configuration is common across each project, so I was thinking it would be good to centralize the config in some way.  I read somewhere that a WCF service might be a good approach.  I thought maybe a library containing a hard-coded static class might actually work OK - despite having to compile to change config.  Ideally the config should come out of an actual .config file.

How would you go about centralizing config for multiple projects?

答: You can use a centralized configuration sever like Lygeum which permits to manage applications and environments through web console or Command Line Interface with user management and client management module, clients may be in your case web apps, console services or whatever. The server installation is simple through docker.</p>

ContentLicense: CC BY-SA 2.5

ContentLicense: CC BY-SA 4.0


问:
How to set google map with bottomsheet in flutter?
I want to have functionality like this click here in flutter. I have to use bottomsheet along with google map, i had shown google map but feeling problem in showing bottomsheet above google map</p>

答:
Use a Stack widget. It stacks widgets in top of each other.

Also you should haver your Bottom sheet inside a Positioned widget. Something like this.

```<code>return Stack(
    children: [
        GoogleMap(),
        Positioned(
            bottom: 0.0
            right: 0.0
            left: 0.0
            child: BottomSheet(),
        ),
    ]
);
</code>```

Body:
Use a Stack widget. It stacks widgets in top of each other.

Also you should haver your Bottom sheet inside a Positioned widget. Something like this.

return Stack(
    children: [
        GoogleMap(),
        Positioned(
            bottom: 0.0
            right: 0.0
            left: 0.0
            child: BottomSheet(),
        ),
    ]
);


问:
Fetch the records from Kafka topic within specific date range using KafkaItemReader (Spring batch job to read kafka streams)
Is there a way i can read the records from Kafka topic in spring batch job which is using KafkaItemReader for specific date range?</p>

答: It's not supported for now, you need to write a custom reader or use an item processor to filter out messages that are outside the range (filtering data is a typical use case of an item processor: https://docs.spring.io/spring-batch/docs/4.2.x/reference/html/readersAndWriters.html#filteringRecords)</p>


问:
Validate user and redirect to login or home in php
I have a scenario in which I want to validate user on page load.
I want same script for all pages including Login and Home pages, in which if user is logged In redirect to Home else redirect to login.
In my code it fails due to too many redirects. need simple solution for that.
here is my code:

session.php

```<code><?php
   define('DB_SERVER', 'localhost');
   define('DB_USERNAME', '');
   define('DB_PASSWORD', '');
   define('DB_DATABASE', 'auth');
   $db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);

   session_start();

   $checkId = ''; $checkUser = ''; $checkPass = '';

   if(isset($_SESSION['login_userId'])){ $checkId = $_SESSION['login_userId']; };
   if(isset($_SESSION['login_userName'])){ $checkUser = $_SESSION['login_userName']; };
   if(isset($_SESSION['login_userPass'])){ $checkPass = $_SESSION['login_userPass']; };

   $sessionResult = mysqli_query($db, "select * from users where id='$checkId' AND username='$checkUser' AND password='$checkPass'");
   $getSessionRow = mysqli_fetch_array($sessionResult, MYSQLI_ASSOC);
   $sessionRowcount = mysqli_num_rows($sessionResult);

   if(isset($getSessionRow['username']) && $checkUser == $getSessionRow['username']){
      header("location:home.php");
   }
   else {
      header("location:login.php");
   }
?>
</code>```

login.php

```<code><?php
include('session.php');
?>
<html>
   <head>
      <title>Login</title>
   </head>
   <body>
      <h1>Login page with login Form</h1>
   </body>
</html>
</code>```

home.php

```<code><?php
include('session.php');
?>
<html>
   <head>
      <title>Welcome</title>
   </head>
   <body>
      <h1>Welcome to Home page</h1>
   </body>
</html>
</code>```

答:
Do one thing after run session page set login id in session and at the start of home page check if not exist (isset) login id then redirect it to login same for login page.</p>

```<code>if(!isset($_SESSION['login_id']))
{
    header("location:login.php");
}
</code>```

Body:
I have a scenario in which I want to validate user on page load.
I want same script for all pages including Login and Home pages, in which if user is logged In redirect to Home else redirect to login.
In my code it fails due to too many redirects. need simple solution for that.
here is my code:

session.php

<?php
   define('DB_SERVER', 'localhost');
   define('DB_USERNAME', '');
   define('DB_PASSWORD', '');
   define('DB_DATABASE', 'auth');
   $db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);

   session_start();

   $checkId = ''; $checkUser = ''; $checkPass = '';

   if(isset($_SESSION['login_userId'])){ $checkId = $_SESSION['login_userId']; };
   if(isset($_SESSION['login_userName'])){ $checkUser = $_SESSION['login_userName']; };
   if(isset($_SESSION['login_userPass'])){ $checkPass = $_SESSION['login_userPass']; };

   $sessionResult = mysqli_query($db, "select * from users where id='$checkId' AND username='$checkUser' AND password='$checkPass'");
   $getSessionRow = mysqli_fetch_array($sessionResult, MYSQLI_ASSOC);
   $sessionRowcount = mysqli_num_rows($sessionResult);

   if(isset($getSessionRow['username']) && $checkUser == $getSessionRow['username']){
      header("location:home.php");
   }
   else {
      header("location:login.php");
   }
?>

login.php

<?php
include('session.php');
?>

      <title>Login</title>

Login page with login Form

home.php

<?php
include('session.php');
?>

      <title>Welcome</title>

Welcome to Home page

Body:
Do one thing after run session page set login id in session and at the start of home page check if not exist (isset) login id then redirect it to login same for login page.

if(!isset($_SESSION['login_id']))
{
    header("location:login.php");
}


问:
How to use local docker images with Minikube?
I have several docker images that I want to use with minikube. I don't want to first have to upload and then download the same image instead of just using the local image directly. How do I do this?

Stuff I tried:

1. I tried running these commands (separately, deleting the instances of minikube both times and starting fresh)

```<code>kubectl run hdfs --image=fluxcapacitor/hdfs:latest --port=8989
kubectl run hdfs --image=fluxcapacitor/hdfs:latest --port=8989 imagePullPolicy=Never
</code>```

Output:

```<code>NAME                    READY     STATUS              RESTARTS   AGE
hdfs-2425930030-q0sdl   0/1       ContainerCreating   0          10m
</code>```

It just gets stuck on some status but never reaches the ready state.

2. I tried creating a registry and then putting images into it but that didn't work either. I might've done that incorrectly but I can't find proper instructions to do this task.

Please provide instructions to use local docker images in local kubernetes instance.

OS: ubuntu 16.04

Docker : Docker version 1.13.1, build 092cba3

Kubernetes :

```<code>Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.3", GitCommit:"029c3a408176b55c30846f0faedf56aae5992e9b", GitTreeState:"clean", BuildDate:"2017-02-15T06:40:50Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.2", GitCommit:"08e099554f3c31f6e6f07b448ab3ed78d0520507", GitTreeState:"clean", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"linux/amd64"}
</code>```

If someone could help me get a solution that uses docker-compose to do this, that'd be awesome.

Edit:

Images loaded in eval $(minikube docker-env):

```<code>REPOSITORY                                            TAG                 IMAGE ID            CREATED             SIZE
fluxcapacitor/jupyterhub                              latest              e5175fb26522        4 weeks ago         9.59 GB
fluxcapacitor/zeppelin                                latest              fe4bc823e57d        4 weeks ago         4.12 GB
fluxcapacitor/prediction-pmml                         latest              cae5b2d9835b        4 weeks ago         973 MB
fluxcapacitor/scheduler-airflow                       latest              95adfd56f656        4 weeks ago         8.89 GB
fluxcapacitor/loadtest                                latest              6a777ab6167c        5 weeks ago         899 MB
fluxcapacitor/hdfs                                    latest              00fa0ed0064b        6 weeks ago         1.16 GB
fluxcapacitor/sql-mysql                               latest              804137671a8c        7 weeks ago         679 MB
fluxcapacitor/metastore-1.2.1                         latest              ea7ce8c5048f        7 weeks ago         1.35 GB
fluxcapacitor/cassandra                               latest              3cb5ff117283        7 weeks ago         953 MB
fluxcapacitor/apachespark-worker-2.0.1                latest              14ee3e4e337c        7 weeks ago         3.74 GB
fluxcapacitor/apachespark-master-2.0.1                latest              fe60b42d54e5        7 weeks ago         3.72 GB
fluxcapacitor/package-java-openjdk-1.8                latest              1db08965289d        7 weeks ago         841 MB
gcr.io/google_containers/kubernetes-dashboard-amd64   v1.5.1              1180413103fd        7 weeks ago         104 MB
fluxcapacitor/stream-kafka-0.10                       latest              f67750239f4d        2 months ago        1.14 GB
fluxcapacitor/pipeline                                latest              f6afd6c5745b        2 months ago        11.2 GB
gcr.io/google-containers/kube-addon-manager           v6.1                59e1315aa5ff        3 months ago        59.4 MB
gcr.io/google_containers/kubedns-amd64                1.9                 26cf1ed9b144        3 months ago        47 MB
gcr.io/google_containers/kube-dnsmasq-amd64           1.4                 3ec65756a89b        5 months ago        5.13 MB
gcr.io/google_containers/exechealthz-amd64            1.2                 93a43bfb39bf        5 months ago        8.37 MB
gcr.io/google_containers/pause-amd64
</code>```

答:
what if you could just run k8s within docker's vm? there's native support for this with the more recent versions of docker desktop... you just need to enable that support.

https://www.docker.com/blog/kubernetes-is-now-available-in-docker-desktop-stable-channel/
https://www.docker.com/blog/docker-windows-desktop-now-kubernetes/

how i found this out:

while reading the docs for helm, they give you a brief tutorial how to install minikube.
that tutorial installs minikube in a vm that's different/separate from docker.

so when it came time to install my helm charts, i couldn't get helm/k8s to pull the images i had built using docker. that's how i arrived here at this question.

so... if you can live with whatever version of k8s comes with docker desktop, and you can live with it running in whatever vm docker has, then maybe this solution is a bit easier than some of the others.

disclaimer: not sure how switching between windows/linux containers would impact anything.

Body:
I have several docker images that I want to use with minikube. I don't want to first have to upload and then download the same image instead of just using the local image directly. How do I do this?

Stuff I tried:

1. I tried running these commands (separately, deleting the instances of minikube both times and starting fresh)

kubectl run hdfs --image=fluxcapacitor/hdfs:latest --port=8989
kubectl run hdfs --image=fluxcapacitor/hdfs:latest --port=8989 imagePullPolicy=Never

Output:

NAME                    READY     STATUS              RESTARTS   AGE
hdfs-2425930030-q0sdl   0/1       ContainerCreating   0          10m

It just gets stuck on some status but never reaches the ready state.

2. I tried creating a registry and then putting images into it but that didn't work either. I might've done that incorrectly but I can't find proper instructions to do this task.

Please provide instructions to use local docker images in local kubernetes instance.

OS: ubuntu 16.04

Docker : Docker version 1.13.1, build 092cba3

Kubernetes :

Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.3", GitCommit:"029c3a408176b55c30846f0faedf56aae5992e9b", GitTreeState:"clean", BuildDate:"2017-02-15T06:40:50Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.2", GitCommit:"08e099554f3c31f6e6f07b448ab3ed78d0520507", GitTreeState:"clean", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"linux/amd64"}

If someone could help me get a solution that uses docker-compose to do this, that'd be awesome.

Edit:

Images loaded in eval $(minikube docker-env):

REPOSITORY                                            TAG                 IMAGE ID            CREATED             SIZE
fluxcapacitor/jupyterhub                              latest              e5175fb26522        4 weeks ago         9.59 GB
fluxcapacitor/zeppelin                                latest              fe4bc823e57d        4 weeks ago         4.12 GB
fluxcapacitor/prediction-pmml                         latest              cae5b2d9835b        4 weeks ago         973 MB
fluxcapacitor/scheduler-airflow                       latest              95adfd56f656        4 weeks ago         8.89 GB
fluxcapacitor/loadtest                                latest              6a777ab6167c        5 weeks ago         899 MB
fluxcapacitor/hdfs                                    latest              00fa0ed0064b        6 weeks ago         1.16 GB
fluxcapacitor/sql-mysql                               latest              804137671a8c        7 weeks ago         679 MB
fluxcapacitor/metastore-1.2.1                         latest              ea7ce8c5048f        7 weeks ago         1.35 GB
fluxcapacitor/cassandra                               latest              3cb5ff117283        7 weeks ago         953 MB
fluxcapacitor/apachespark-worker-2.0.1                latest              14ee3e4e337c        7 weeks ago         3.74 GB
fluxcapacitor/apachespark-master-2.0.1                latest              fe60b42d54e5        7 weeks ago         3.72 GB
fluxcapacitor/package-java-openjdk-1.8                latest              1db08965289d        7 weeks ago         841 MB
gcr.io/google_containers/kubernetes-dashboard-amd64   v1.5.1              1180413103fd        7 weeks ago         104 MB
fluxcapacitor/stream-kafka-0.10                       latest              f67750239f4d        2 months ago        1.14 GB
fluxcapacitor/pipeline                                latest              f6afd6c5745b        2 months ago        11.2 GB
gcr.io/google-containers/kube-addon-manager           v6.1                59e1315aa5ff        3 months ago        59.4 MB
gcr.io/google_containers/kubedns-amd64                1.9                 26cf1ed9b144        3 months ago        47 MB
gcr.io/google_containers/kube-dnsmasq-amd64           1.4                 3ec65756a89b        5 months ago        5.13 MB
gcr.io/google_containers/exechealthz-amd64            1.2                 93a43bfb39bf        5 months ago        8.37 MB
gcr.io/google_containers/pause-amd64


问:
Show placeholder text in ReactJS input until click then show "typing"
Once I click the text box some of my div will show a "typing." Before clicking, it should show "this is just a sample."

<input type="text" onClick={this.state}>
```

答:
Although your question is really messy, here's the sample code for you. Maybe it'll point you the right direction.

```<code>import React from "react";

export default class Test extends React.PureComponent {
    constructor(props) {
        super(props);
        this.state = {
            someState: ""
        }
        this.onChangeState = this.onChangeState.bind(this);
    }

    onChangeState(e) {
        this.setState({
            someState: //logic here
        })
    }

    render() {
        const {someState} = this.state;
        return (
            <>
                <input type="text" onClick={e => this.onChangeState(e)}>
                State value: {someState}
            </>
        )
    }
}
</code>```

Whenever you click chosen div, you'll call onChangeState method where you can manipulate your state. Don't forget that every state update causes rerender.
For more info visit official React docs.

Body:
Although your question is really messy, here's the sample code for you. Maybe it'll point you the right direction.

import React from "react";

export default class Test extends React.PureComponent {
    constructor(props) {
        super(props);
        this.state = {
            someState: ""
        }
        this.onChangeState = this.onChangeState.bind(this);
    }

    onChangeState(e) {
        this.setState({
            someState: //logic here
        })
    }

    render() {
        const {someState} = this.state;
        return (
            <>
                <input type="text" onClick={e => this.onChangeState(e)}>
                State value: {someState}
            </>
        )
    }
}

Whenever you click chosen div, you'll call onChangeState method where you can manipulate your state. Don't forget that every state update causes rerender.
For more info visit official React docs.


问:
How do I Rewrite URL from some-sub-domain.some-domain.com to some-domain.com/some-sub-domain
I want to rewrite my URL, so that I can reach the folder which is seen by the clients as sub-domain. Client will put the following in the URL Bar:

```<code>abc.def.com
</code>```

and by URL rewrite it will be gone to

```<code>def.com/abc
</code>```

silently. Please tell me how can I do that ?

答:
You should use %{HTTP_HOST} instead of %{REMOTE_HOST}. This is because %{REMOTE_HOST} is the result of reverse DNS lookup on %{REMOTE_ADDR} if HostnameLookups is enabled.

So your rule should be

```<code>RewriteCond %{HTTP_HOST} ^(?:www\.)?([^\.]+)\.your_domain\.com [NC]
RewriteRule ^(.*) /%1/$1 [L]
</code>```

ContentLicense: CC BY-SA 3.0

Body:
I want to rewrite my URL, so that I can reach the folder which is seen by the clients as sub-domain. Client will put the following in the URL Bar:

abc.def.com

and by URL rewrite it will be gone to

def.com/abc

silently. Please tell me how can I do that ?

Body:
You should use %{HTTP_HOST} instead of %{REMOTE_HOST}. This is because %{REMOTE_HOST} is the result of reverse DNS lookup on %{REMOTE_ADDR} if HostnameLookups is enabled.

So your rule should be

RewriteCond %{HTTP_HOST} ^(?:www\.)?([^\.]+)\.your_domain\.com [NC]
RewriteRule ^(.*) /%1/$1 [L]


问:
Google Colab cannot access Github private repositories
I'm trying to save my colab notebook to a private Github repository, but it, and all of my other private repositories, do not appear in the dropdown list when I click "Save a copy to Github." Any help would be appreciated. </p>

答: Yes, now collab supports github private repositories. They changed the path, the correct one is: Tools->Preferences->Request GitHub


问:
Unable to link App to Google games services, SHA1 already linked to packagename

Sign in Google Play Console.

Select Games services

Select Add new game.

Fill in required details.

Select link app, -> Android.

Select the package name I would like to link to.

Add SHA1 fingerprint.

Error. Sorry and application with this SHA1 fingerprint is already linked to this app.

I have unpublished the only game service in my console, logged into Google API console and scheduled it for deletion.
I have attempted this 10 times over the space of a week? Hoping that something needed to be deregistered / or unlinked on google servers and my next attempt would work.

I have tried this in a different Google Play Console Account and it worked without issues.

I would really like to link game services such as leaderboards and saved games to my app.

We also have a Firebase account linked to this app, with the same packagename and SHA1 fingerprint.
Please tell me I don't need to delete the Firebase account as well, to link a new Game service to this App.

答:
I removed the SHA-1 & SHA-256 fingerprints from Firebase and was able to create a new Google Play games service linked to my packagename and SHA1.

Really wish there was one source of truth in Google and I didn't need to jump around between,

Google play console,

Firebase console and

Google API console to get things working.

Remove SHA's from firebase, or delete the instance


问:
changing inner array object value with outer array value with map
I'm new to full-stack development, specifically to java-script and functional programming.
Using high-order function (like map, filter and so) I need to change inner object array values into the outer array given value:

```<code>let arr = [
[ [
  {name: "Alice", age: 22},
  {name: "Charlie", age: 35}
 ], "Bob" ],
 [ [
  {name: "John" , age: 42}
  ], "Ben"]
]
</code>```

and I need output array of:

```<code>output = [
 [
  {name: "Bob", age: 22},
  {name: "Bob", age: 35}
 ],
 [
  {name: "Ben", age: 42}
 ]
]
</code>```

Thank you.

答:
Slightly modified Simon's answer. Added a little bit of destructuring sugar

let arr = [
[ [
  {name: "Alice", age: 22},
  {name: "Charlie", age: 35}
 ], "Bob" ],
 [ [
  {name: "John" , age: 42}
  ], "Ben"]
]

const result = arr.map(([data, name]) => data.map(({age}) => ({name, age})))

console.log(result)```

Body:
I'm new to full-stack development, specifically to java-script and functional programming.
Using high-order function (like map, filter and so) I need to change inner object array values into the outer array given value:

let arr = [
[ [
  {name: "Alice", age: 22},
  {name: "Charlie", age: 35}
 ], "Bob" ],
 [ [
  {name: "John" , age: 42}
  ], "Ben"]
]

and I need output array of:

output = [
 [
  {name: "Bob", age: 22},
  {name: "Bob", age: 35}
 ],
 [
  {name: "Ben", age: 42}
 ]
]

Thank you.


问:
Using a 64 bit driver in a 32 bit program. Windows
This is only a half-way programming question. First of all I have a PCI-Express card and 32/64 bit drivers. The target operating system has to be a Windows 64 bit system. I read that under Vista64 all drivers have to be certified 64 bit drivers. Is this a general restriction under 64 bit operating systems and does this also apply to "XP 64" or any Linux system?

So for simplicity let's say I use a 64 bit driver for my PCIe card under Vista64 and have a bunch of 64 bit DLLs to use the cards functionality. On the other side there's a large, legacy 32 bit exe program which needs to use the PCIe device. Converting the program to 64 bit would be a really huge effort.

So what can be done to bring that 32 bit program and the 64 bit driver together? I read that mixing 32/64 bit binaries and DLLs is not possible at all but this is hard to believe for me. I'm sure you can print out a document under Vista64 from within a 32 bit app and Windows will somehow wrap this around to a 64 bit printer driver.

答:
I think the whole point of a driver is to abstract away the actually workings of the hardware and present a common interface to the software. In this case, the PCIe driver needs to be 64-bit so that it can act as a go-between for Windows and the hardware, but I would think that a 32-bit application could then access the device without any troubles at all.

What's meant by that incompatibility you read about is that 32 and 64-bit assemblies can't be part of the same application - an application has to target either one or the other, though 32-bit application will generally run fine on Windows x64 using WoW64, which just acts as a translator.

Are you currently experiencing problems, or are you just asking hypothetically?

OwnerDisplayName: asdrubael

LastEditorDisplayName: asdrubael

OwnerDisplayName: rwmnau


问:
My spinner items are invisble
Hi I have a spinner, which contains radio button elements. My spinner loads the elements, but everything is invisible. I think you can understand my situation from the image. an I get any suggestions.

This is the code I am using,

```<code>   String[] reminder={"5 minutes","10 minutes","15 minutes","20 minutes","25                minutes","30         minutes","35 minutes","45 minutes"};
spinnerAdapter = new ArrayAdapter<String>(mContext,
    android.R.layout.simple_spinner_item, reminder);
spinnerAdapter
    .setDropDownViewResource(android.R.layout.simple_list_item_single_choice);
 reminder_spinner.setPrompt("Reminders");
reminder_spinner.setAdapter(spinnerAdapter);
reminder_spinner.setOnItemSelectedListener(new ItemSelect());
</code>```

答:
add this

```<code>spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);`
</code>```

in your code and  remove

spinnerAdapter.setDropDownViewResource(android.R.layout.simple_list_item_single_choice);`

Title: My spinner items are invisble

Body:
Hi I have a spinner, which contains radio button elements. My spinner loads the elements, but everything is invisible. I think you can understand my situation from the image. an I get any suggestions.

This is the code I am using,

   String[] reminder={"5 minutes","10 minutes","15 minutes","20 minutes","25                minutes","30         minutes","35 minutes","45 minutes"};
spinnerAdapter = new ArrayAdapter<String>(mContext,
    android.R.layout.simple_spinner_item, reminder);
spinnerAdapter
    .setDropDownViewResource(android.R.layout.simple_list_item_single_choice);
 reminder_spinner.setPrompt("Reminders");
reminder_spinner.setAdapter(spinnerAdapter);
reminder_spinner.setOnItemSelectedListener(new ItemSelect());

Body:
add this

spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);`

in your code and  remove

spinnerAdapter.setDropDownViewResource(android.R.layout.simple_list_item_single_choice);`


问:
How to speed up "for loop" in Python3
Below code is running so slow. I tried using numpy.argwhere instead of "if statement" to speed up the code and I got a pretty efficient result but it's still very slow. I also tried numpy.frompyfunc and numpy.vectorize but I failed. What would you suggest to speed up the code below?

```<code>import numpy as np
import time

time1 = time.time()

n = 1000000
k = 10000

velos = np.linspace(-1000, 1000, n)
line_centers = np.linspace(-1000, 1000, k)
weights = np.random.random_sample(k)
rvs = np.arange(-60, 60, 2)

m = len(rvs)
w = np.arange(10)
M = np.zeros((n, m))
for l, lc in enumerate(line_centers):
    vi = velos - lc

    for j in range(m - 1):
        w = np.argwhere((vi < rvs[j + 1]) & (vi > rvs[j])).T[0]

        M[w, j] = weights[l] * (rvs[j + 1] - vi[w]) / (rvs[j + 1] - rvs[j])
        M[w, j + 1] = weights[l] * (vi[w] - rvs[j]) / (rvs[j + 1] - rvs[j])

time2 = time.time()

print(time2 - time1)
</code>```

EDIT:
The size of the array M  was incorrect. I fixed it.

答: This seems like a situation where a c++ interface could come in handy. With Pybind11 you can create c++ functions which take numpy arrays as argument, manipulate them and return them back to python. That would speed up you loops. Take a look at it!</p>

Title: How to speed up "for loop" in Python3

Body:
Below code is running so slow. I tried using numpy.argwhere instead of "if statement" to speed up the code and I got a pretty efficient result but it's still very slow. I also tried numpy.frompyfunc and numpy.vectorize but I failed. What would you suggest to speed up the code below?

import numpy as np
import time

time1 = time.time()

n = 1000000
k = 10000

velos = np.linspace(-1000, 1000, n)
line_centers = np.linspace(-1000, 1000, k)
weights = np.random.random_sample(k)
rvs = np.arange(-60, 60, 2)

m = len(rvs)
w = np.arange(10)
M = np.zeros((n, m))
for l, lc in enumerate(line_centers):
    vi = velos - lc

    for j in range(m - 1):
        w = np.argwhere((vi < rvs[j + 1]) & (vi > rvs[j])).T[0]

        M[w, j] = weights[l] * (rvs[j + 1] - vi[w]) / (rvs[j + 1] - rvs[j])
        M[w, j + 1] = weights[l] * (vi[w] - rvs[j]) / (rvs[j + 1] - rvs[j])

time2 = time.time()

print(time2 - time1)

EDIT:
The size of the array M  was incorrect. I fixed it.