Home Php C# Sql C C++ Javascript Python Java Go Android Git Linux Asp.net Django .net Node.js Ios Xcode Cocoa Iphone Mysql Tomcat Mongodb Bash Objective-c Scala Visual-studio Apache Elasticsearch Jar Eclipse Jquery Ruby-on-rails Ruby Rubygems Android-studio Spring Lua Sqlite Emacs Ubuntu Perl Docker Swift Amazon-web-services Svn Html Ajax Xml Java-ee Maven Intellij-idea Rvm Macos Unix Css Ipad Postgresql Css3 Json Windows-server Vue.js Typescript Oracle Hibernate Internet-explorer Github Tensorflow Laravel Symfony Redis Html5 Google-app-engine Nginx Firefox Sqlalchemy Lucene Erlang Flask Vim Solr Webview Facebook Zend-framework Virtualenv Nosql Ide Twitter Safari Flutter Bundle Phonegap Centos Sphinx Actionscript Tornado Register | Login | Edit Tags | New Questions | 繁体 | 简体


10 questions online user: 8

0
votes
answers
39 views
+10

使用io.netty創建Maven的問題:netty-handler:jar:4.1.17.Final

0

任何人都可以在解決Maven應用程序的問題上長時間苦苦掙扎。 我正在使用spring引導應用程序連接到cassandra。每當我們做一個MVN清潔套裝= -DskipTests真實,我們得到以下警告: -使用io.netty創建Maven的問題:netty-handler:jar:4.1.17.Final

Clean Building screenshot

和上運行的應用程序失敗(Java的罐子目標/ DemoSearch-0.0.1-SNAPSHOT.jar)和附帶的是堆棧跟蹤。

> Unsatisfied dependency expressed through constructor parameter 2; 
> nested exception is 
> org.springframework.beans.factory.BeanCreationException: Error 
> creating bean with name 'cassandraCluster' defined in class path 
> resource [org/springframework/boot/autoc 
> onfigure/cassandra/CassandraAutoConfiguration.class]: Bean 
> instantiation via factory method failed; nested exception is 
> org.springframework.beans.BeanInstantiationExcept ion: Failed to 
> instantiate [com.datastax.driver.core.Cluster]: Factory method 
> 'cassandraCluster' threw exception; nested exception is 
> java.lang.NoClassDefFoundError: io/ netty/util/Timer 
>   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0 .2.RELEASE] 
>   at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:579) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5 .0.2.RELEASE] 
>   ... 40 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error 
> creating bean with name 'persistentEntities' defined in class path 
> resource [org/springframewor 
> k/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]: Bean 
> instantiation via factory method failed; nested exception is 
> org.springframework.beans.BeanInstanti ationException: Failed to 
> instantiate 
> [org.springframework.data.mapping.context.PersistentEntities]: Factory 
> method 'persistentEntities' threw exception; nested exceptio n is 
> org.springframework.beans.factory.UnsatisfiedDependencyException: 
> Error creating bean with name 
> 'org.springframework.boot.autoconfigure.data.cassandra.CassandraData 
> AutoConfiguration': Unsatisfied dependency expressed through 
> constructor parameter 2; nested exception is 
> org.springframework.beans.factory.BeanCreationException: Error 
> creating bean with name 'cassandraCluster' defined in class path 
> resource 
> [org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.class]: 
> Bean insta ntiation via factory method failed; nested exception is 
> org.springframework.beans.BeanInstantiationException: Failed to 
> instantiate [com.datastax.driver.core.Cluster]: F actory method 
> 'cassandraCluster' threw exception; nested exception is 
> java.lang.NoClassDefFoundError: io/netty/util/Timer 
>   at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5 .0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1250) 
> ~[spr ing-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099) 
> ~[spring-beans-5 .0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) 
> ~[spring-beans-5.0.2.RE LEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) 
> ~[spring-beans-5.0.2.RELE ASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEAS E] 
>   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) 
> ~[spring-beans-5.0.2.RELEASE.jar!/: 
> 5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.resolveBeanReference(ConfigurationClassEnhancer.java:392) 
> ~[spring-con text-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:364) 
> ~[spring-context-5.0.2. RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$4669ff6b.persistentEntities(<generated>) 
> ~[spring-data-rest 
> -webmvc-3.0.2.RELEASE.jar!/:3.0.2.RELEASE] 
>   at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.jsonSchemaConverter(RepositoryRestMvcConfiguration.java:426) 
> ~[spring-data-rest-web mvc-3.0.2.RELEASE.jar!/:3.0.2.RELEASE] 
>   at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$4669ff6b.CGLIB$jsonSchemaConverter$26(<generated>) 
> ~[spring 
> -data-rest-webmvc-3.0.2.RELEASE.jar!/:3.0.2.RELEASE] 
>   at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$4669ff6b$$FastClassBySpringCGLIB$$553cc2af.invoke(<generate 
> d>) ~[spring-data-rest-webmvc-3.0.2.RELEASE.jar!/:3.0.2.RELEASE] 
>   at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) 
> ~[spring-core-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) 
> ~[spring-context-5.0.2. RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$4669ff6b.jsonSchemaConverter(<generated>) 
> ~[spring-data-res t-webmvc-3.0.2.RELEASE.jar!/:3.0.2.RELEASE] 
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101] 
>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101] 
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101] 
>   at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_101] 
>   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0 .2.RELEASE] 
>   ... 41 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to 
> instantiate 
> [org.springframework.data.mapping.context.PersistentEntities]: Factory 
> method 'per sistentEntities' threw exception; nested exception is 
> org.springframework.beans.factory.UnsatisfiedDependencyException: 
> Error creating bean with name 'org.springframewor 
> k.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration': 
> Unsatisfied dependency expressed through constructor parameter 2; 
> nested exception is org.springfram 
> ework.beans.factory.BeanCreationException: Error creating bean with 
> name 'cassandraCluster' defined in class path resource 
> [org/springframework/boot/autoconfigure/cassan 
> dra/CassandraAutoConfiguration.class]: Bean instantiation via factory 
> method failed; nested exception is 
> org.springframework.beans.BeanInstantiationException: Failed to 
> instantiate [com.datastax.driver.core.Cluster]: Factory method 
> 'cassandraCluster' threw exception; nested exception is 
> java.lang.NoClassDefFoundError: io/netty/util/Time r 
>   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0 .2.RELEASE] 
>   at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:579) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5 .0.2.RELEASE] 
>   ... 63 common frames omitted Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: 
> Error creating bean with name 
> 'org.springframework.boot.autoconfigure.data.cassandra.Cassand 
> raDataAutoConfiguration': Unsatisfied dependency expressed through 
> constructor parameter 2; nested exception is 
> org.springframework.beans.factory.BeanCreationException: Error 
> creating bean with name 'cassandraCluster' defined in class path 
> resource 
> [org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.class]: 
> Bean instantiation via factory method failed; nested exception is 
> org.springframework.beans.BeanInstantiationException: Failed to 
> instantiate [com.datastax.driver.core.Clust er]: Factory method 
> 'cassandraCluster' threw exception; nested exception is 
> java.lang.NoClassDefFoundError: io/netty/util/Timer 
>   at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:729) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEA SE] 
>   at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:192) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEA SE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1270) 
> ~[spring-beans- 
> 5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127) 
> ~[spring-beans-5 .0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) 
> ~[spring-beans-5.0.2.RE LEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) 
> ~[spring-beans-5.0.2.RELE ASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEAS E] 
>   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) 
> ~[spring-beans-5.0.2.RELEASE.jar!/: 
> 5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:368) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5 .0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1250) 
> ~[spr ing-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099) 
> ~[spring-beans-5 .0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) 
> ~[spring-beans-5.0.2.RE LEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) 
> ~[spring-beans-5.0.2.RELE ASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEAS E] 
>   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) 
> ~[spring-beans-5.0.2.RELEASE.jar!/: 
> 5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:516) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5. 
> 0.2.RELEASE] 
>   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:504) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5. 
> 0.2.RELEASE] 
>   at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1194) 
> ~[spring-context-5.0.2.RELEASE.jar!/:5.0.2 .RELEASE] 
>   at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:263) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.persistentEntities(RepositoryRestMvcConfiguration.java:236) 
> ~[spring-data-rest-webm vc-3.0.2.RELEASE.jar!/:3.0.2.RELEASE] 
>   at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$4669ff6b.CGLIB$persistentEntities$19(<generated>) 
> ~[spring- data-rest-webmvc-3.0.2.RELEASE.jar!/:3.0.2.RELEASE] 
>   at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$4669ff6b$$FastClassBySpringCGLIB$$553cc2af.invoke(<generate 
> d>) ~[spring-data-rest-webmvc-3.0.2.RELEASE.jar!/:3.0.2.RELEASE] 
>   at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) 
> ~[spring-core-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) 
> ~[spring-context-5.0.2. RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$4669ff6b.persistentEntities(<generated>) 
> ~[spring-data-rest 
> -webmvc-3.0.2.RELEASE.jar!/:3.0.2.RELEASE] 
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101] 
>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101] 
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101] 
>   at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_101] 
>   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0 .2.RELEASE] 
>   ... 64 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error 
> creating bean with name 'cassandraCluster' defined in class path 
> resource [org/springframework/ 
> boot/autoconfigure/cassandra/CassandraAutoConfiguration.class]: Bean 
> instantiation via factory method failed; nested exception is 
> org.springframework.beans.BeanInstantia tionException: Failed to 
> instantiate [com.datastax.driver.core.Cluster]: Factory method 
> 'cassandraCluster' threw exception; nested exception is 
> java.lang.NoClassDefFound Error: io/netty/util/Timer 
>   at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5 .0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1250) 
> ~[spr ing-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099) 
> ~[spring-beans-5 .0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) 
> ~[spring-beans-5.0.2.RE LEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) 
> ~[spring-beans-5.0.2.RELE ASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEAS E] 
>   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) 
> ~[spring-beans-5.0.2.RELEASE.jar!/: 
> 5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEASE ] 
>   at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1135) 
> ~[spring-beans-5.0.2.RELEASE.ja r!/:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062) 
> ~[spring-beans-5.0.2.RELEASE.jar! /:5.0.2.RELEASE] 
>   at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:815) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2. RELEASE] 
>   at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:721) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0.2.RELEA SE] 
>   ... 97 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to 
> instantiate [com.datastax.driver.core.Cluster]: Factory method 
> 'cassandraCluster' threw except ion; nested exception is 
> java.lang.NoClassDefFoundError: io/netty/util/Timer 
>   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0 .2.RELEASE] 
>   at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:579) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5 .0.2.RELEASE] 
>   ... 110 common frames omitted Caused by: java.lang.NoClassDefFoundError: io/netty/util/Timer 
>   at com.datastax.driver.core.Configuration$Builder.build(Configuration.java:317) 
> ~[cassandra-driver-core-3.3.2.jar!/:na] 
>   at com.datastax.driver.core.Cluster$Builder.getConfiguration(Cluster.java:1318) 
> ~[cassandra-driver-core-3.3.2.jar!/:na] 
>   at com.datastax.driver.core.Cluster.<init>(Cluster.java:113) ~[cassandra-driver-core-3.3.2.jar!/:na] 
>   at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:178) 
> ~[cassandra-driver-core-3.3.2.jar!/:na] 
>   at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:1335) 
> ~[cassandra-driver-core-3.3.2.jar!/:na] 
>   at org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration.cassandraCluster(CassandraAutoConfiguration.java:86) 
> ~[spring-boot-autoconfigure-2 
> .0.0.BUILD-SNAPSHOT.jar!/:2.0.0.BUILD-SNAPSHOT] 
>   at org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration$$EnhancerBySpringCGLIB$$26c07881.CGLIB$cassandraCluster$0(<generated>) 
> ~[spring-bo 
> ot-autoconfigure-2.0.0.BUILD-SNAPSHOT.jar!/:2.0.0.BUILD-SNAPSHOT] 
>   at org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration$$EnhancerBySpringCGLIB$$26c07881$$FastClassBySpringCGLIB$$f566d5b3.invoke(<generat 
> ed>) 
> ~[spring-boot-autoconfigure-2.0.0.BUILD-SNAPSHOT.jar!/:2.0.0.BUILD-SNAPSHOT] 
>   at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) 
> ~[spring-core-5.0.2.RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) 
> ~[spring-context-5.0.2. RELEASE.jar!/:5.0.2.RELEASE] 
>   at org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration$$EnhancerBySpringCGLIB$$26c07881.cassandraCluster(<generated>) 
> ~[spring-boot-autoc 
> onfigure-2.0.0.BUILD-SNAPSHOT.jar!/:2.0.0.BUILD-SNAPSHOT] 
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101] 
>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101] 
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101] 
>   at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_101] 
>   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) 
> ~[spring-beans-5.0.2.RELEASE.jar!/:5.0 .2.RELEASE] 
>   ... 111 common frames omitted Caused by: java.lang.ClassNotFoundException: io.netty.util.Timer 
>   at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_101] 
>   at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_101] 
>   at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93) 
> ~[DemoSearch-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] 
>   at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_101] 
>   ... 127 common frames omitted 
+0

看起來像用於開發casandra的彈簧數據數據的彈簧引導框架與您擁有的彈簧引導罐不匹配。請使用適當的版本。 com.datastax.cassandra 卡桑德拉驅動核心 3.3.1 春季啓動版本1.5.8.RELEASE –

沙发
0
0

以下是pom.xml中: -

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>com.demo.search</groupId> 
    <artifactId>DemoSearch</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>DemoSearch</name> 
    <description>Demo project for Spring Boot</description> 

    <parent> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-parent</artifactId> 
     <version>2.0.0.BUILD-SNAPSHOT</version> 
     <relativePath /> <!-- lookup parent from repository --> 
    </parent> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
     <java.version>1.8</java.version> 
    </properties> 

    <dependencies> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-data-cassandra</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-data-rest</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-data-solr</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-jersey</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-web</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-test</artifactId> 
      <scope>test</scope> 
     </dependency> 
     <!-- <dependency> 
      <groupId>commons-lang</groupId> 
      <artifactId>commons-lang</artifactId> 
      <version>2.6</version> 
     </dependency> --> 
    <!-- https://mvnrepository.com/artifact/io.netty/netty-all --> 
<!-- <dependency> 
    <groupId>io.netty</groupId> 
    <artifactId>netty-all</artifactId> 
    <version>4.0.9.Final</version> 
</dependency>--> 
<dependency> 
    <groupId>com.google.guava</groupId> 
    <artifactId>guava</artifactId> 
    <version>16.0.1</version> 
</dependency> 

</dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
      </plugin> 
     </plugins> 
    </build> 

    <repositories> 
     <!-- <repository> 
      <id>spring-snapshots</id> 
      <name>Spring Snapshots</name> 
      <url>https://repo.spring.io/snapshot</url> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </repository> --> 
     <repository> 
      <id>spring-milestones</id> 
      <name>Spring Milestones</name> 
      <url>https://repo.spring.io/milestone</url> 
      <snapshots> 
       <enabled>false</enabled> 
      </snapshots> 
     </repository> 
     <repository> 
     <id>spring-snapshots</id> 
     <name>Spring Snapshots</name> 
     <url>https://repo.spring.io/libs-snapshot</url> 
     <snapshots> 
      <enabled>true</enabled> 
     </snapshots> 
    </repository> 
    </repositories> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>spring-snapshots</id> 
      <name>Spring Snapshots</name> 
      <url>https://repo.spring.io/snapshot</url> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </pluginRepository> 
     <pluginRepository> 
      <id>spring-milestones</id> 
      <name>Spring Milestones</name> 
      <url>https://repo.spring.io/milestone</url> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </pluginRepository> 
    </pluginRepositories> 
</project> 
板凳
0
0

你得到transitive dependency警告,因爲您要添加netty-all jar版本,這是從春天啓動加罐子版本不同。如果您從依賴項中刪除版本號,那麼您將不會收到該警告。我沒有你的Cassandra相關文件和你的Spring啓動文件,所以我不能看到我是否得到ClassNotFoundException。但我用另一個類 - 從io.netty.util包,我可以加載該類沒有任何錯誤。

0
votes
answers
64 views
+10

Solr如何存儲文件

0

我知道Solr使用Lucene和Lucene使用倒排索引。但從目前爲止我看到的Lucene例子中,我不確定我是否理解它與Solr的結合。Solr如何存儲文件

給出下列文件:

<doc> 
    <field name="id">9885A004</field> 
    <field name="name">Canon PowerShot SD500</field> 
    <field name="manu">Canon Inc.</field> 
    <field name="inStock">true</field> 
</doc> 

從到目前爲止,我所看到的例子,我認爲Lucene的具有對待每個字段作爲文檔。然後它會說:ord Cannon出現在字段name和字段manu中。

索引分解了多少?或者索引只是說:「佳能這個詞出現在id爲這樣的文件」?

如何在Solr中使用Lucene時如何工作? 該文件在索引中的外觀如何? (假設每個字段都有indexed="true"

+1

您可以[通過在2013年從Lucene的/ Solr的革命演示一個如何Lucene的存儲數據的詳細綱要(獲得https://www.slideshare.net/lucenerevolution/what -is-inaluceneagrandfinal)。我不確定它是否提到了DocValues,它是一個面向列的存儲,而不是常規的倒排索引,可以加速某些操作。 – MatsLindh

+0

@MatsLindh感謝您的信息! – user3813234

沙发
0
1

我幾年前發了一篇博文,詳細解釋一下[1]。

簡短回答了這個問題:「從我到目前爲止看到的例子,我認爲Lucene的具有對待每個字段的文檔」

絕對不是。 Lucene信息單元是由地圖字段 - >值[s]組成的文檔。 Solr文檔只是一個稍微不同的表示,因爲Solr在描述字段的地方包含模式。 因此,在Solr中,您只需將字段添加到文檔中,而無需描述類型和其他屬性(存儲在模式中),而在Lucene中,您需要在創建文檔時明確定義它們。

[1] https://sease.io/2015/07/26/exploring-solr-internals-the-lucene-inverted-index/

2
votes
answers
24 views
+10

How to remove duplicate contents? [closed]

I've a classified website (in PHP and Mysql) where users can post their ads free of cost. But users often post duplicate ads. The script do not allow them to post exact duplicate contents, so they do this by changing one or two character.

Is there any way to find the duplicate ad and alert the user (even if they modified some portion of the text)?

My site is in PHP and Mysql. I'm using sphix for searching. Thinking of changing this to mongodb and apache solr.

沙发
+20

Go and have a loot at

Calculate the similarity between two strings http://php.net/manual/en/function.similar-text.php

OR

Calculate Levenshtein distance between two strings http://www.php.net/manual/en/function.levenshtein.php

板凳
0

You can write a function which break the sentence into words and then match each words with the table and then find percentage of matching in database. Based on the percentage you can make the decision. For less database checking you can remove the common words and verbs, which you can store in a array. This is my personal opinion may be there are some other better techniques. But I must say it is a good question.

地板
0

Levenstein distance, jarowinkler, plagiarism algorithms.. Look them them up on SO

I would start with simple levenstein distance

看起來需要一些手動質量控制。例如,兩個不同的用戶可以在同一條街道上為空置公寓發布廣告:25 Lake Ave和26 Lake Ave - 如果您使用Levenshtein距離,則可以將其標記為重複。然而,重複的帖子可能像25 Lake Ave和25 Lake Avenue,它們有更高的Levenshtein距離! - arun 2013年6月9日0:38

0
votes
answers
29 views
+10

How to scalably implement something like Google alerts?

The requirement is that we have a lot of saved searches, and when new documents come in, we want to be able to find which saved searches are matched by these new documents, and be able to notify the creators of these saved searches in real time.

Is something like this already supported in any of the popular free software search engines and libraries, either built-in or as a plugin? If not, what's the best way to do this in an efficient and scalable way?

I guess the general idea should be to index the saved searches as if they are documents, and use the incoming documents as queries to search them. But I haven't figured out exactly how to do this.

It's also best if we can place as little restrictions on the supported query operators as possible.

Thanks in advance.

沙发
0
+50

How about doing the reverse -

  • Maintain searches in some other database with user specific information instead of solr.
  • Index the new document, so that it is available for all subsequent searches
  • Re execute all the saved queries across the document after addition, to check if it matches the document.

Also, Solr supports wide range of query support so you can check on it .

0
votes
answers
43 views
+10

Solr中Enum FieldType上的SimpleFacets.lamba和NumberFormatException錯誤

0

有沒有人曾經嘗試過在枚舉字段上排序?我有一個字段定義爲一個具有約1000個不同值的自定義enumConfig.xml文件的枚舉。如果我努力使由它這個枚舉字段或排序範圍查詢,我得到這個異常:Solr中Enum FieldType上的SimpleFacets.lamba和NumberFormatException錯誤

Invalid shift value in prefixCoded bytes (is encoded value really an INT?). 

在配置文件中的值有兩個數字和字符在其中,如果是相關的/重要.. 。

它給了我一個討厭的異常,如果我嘗試小的領域,也:

"msg": "Exception during facet.field: ORBIT", 
"trace": "org.apache.solr.common.SolrException: Exception during 
facet.field: ORBIT
	at org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:766) 

說,這是一個NumberFormatException的......?

儘管我只在指定「facet.limit = -1」時纔會出現該異常,但它適用於較小的值。

沙发
0
0

如果您對枚舉配置文件進行更改(即使您重新編制索引),也會發生類似這樣的奇怪錯誤。我必須徹底刪除我的收藏集才能使其正常工作。

0
votes
answers
35 views
+10

用於索引和查詢的Solr字段別名

0

我在Solr索引中有一組文檔,其中包含字段exact_title和alternative_title。我希望能夠使用字段標題進行搜索。 換句話說,查詢title:Hello World應該返回具有exact_title或alternative_title「Hello World」的文檔用於索引和查詢的Solr字段別名

是否有可能在索引期間爲字段定義別名?

+0

是這些領域的不同還是什麼?他們背後的想法是什麼? – Mysterion

+0

我有一套書,其中一些有兩個標題,一個主標題和一個替代標題。奇怪,但不是我的數據集。我希望這兩個標題都可以在同一字段下搜索,並且數據複製的數據量最小。 – orestis

沙发
0
0

我解決了在schema.xml文件中定義複製字段。

例子:

<field name="title_txt" type="text_general" indexed="true" stored="false" multiValued="true"/> 
<field name="exact_title_txt" type="text_general" indexed="true" stored="true" multiValued="false"/> 
<field name="alternative_title_txt" type="text_general" indexed="true" stored="true" multiValued="false"/> 
<copyField source="exact_title_txt" dest="title_txt"/> 
<copyField source="alternative_title_txt" dest="title_txt"/> 
+0

由於這兩個字段的類型和內容都完全相同,所以我必須問:這能解決什麼問題? – MatsLindh

+0

我想用兩個或更多的字段搜索使用相同的傘字段 – orestis

+0

好的,當你添加更多的字段和兩個copyField指令時,它是有道理的。 – MatsLindh

12
votes
answers
35 views
+10

solr or sphinx? which is better? [duplicate]

Possible Duplicate:
Choosing a stand-alone full-text search server: Sphinx or SOLR?

I will use it to do full text search in my ruby on rails app.

which is the best choice.

solr use java to do this job. or sphix in ruby?

沙发
+60
+50

I have no experience with Solr, but Sphinx is easy to install, fast and works great with Thinking Sphinx: http://freelancing-god.github.com/ts/en/indexing.html

There is also a good railscast: http://railscasts.com/episodes/120-thinking-sphinx

This guy gives you some arguments why to go with Sphinx: http://jamesgolick.com/tags/ultrasphinx.html (He uses the Ultrasphinx plugin to connect Rails and Sphinx. I tried both and ended up using Thinking Sphinx)

You can find a comparison of both plugins here: http://reinh.com/blog/2008/07/14/a-thinking-mans-sphinx.html

+30

Solr may be implemented in Java but that is mostly an implementation detail. Sphinx is C++ based; do you know C++? LucidImagination provides a convenient LucidWorks for Solr distribution that will make deployment for those unfamiliar with Java a snap. Ironically, Solr has better Ruby integration than Sphinx. There's acts_as_solr which plugs into ActiveRecord, and at a pure ruby level there are a couple great options as well but that's not your use case. You may be using rails but no matter what your server side language of choice is, you might want to consider using AJAX-Solr and it's got a fantastic demo. Lastly, Solr is definitely a larger project than Sphinx with more history and information out there to help you including my book. LucidImagination offers a free PDF reference guide too.

+20

Although sphinx has craigslist, Solr has http://www.lucidimagination.com/why-lucid/who-uses-lucene-solr

So I think the answer is quite clear.

+10

I tried both, and they're both great. As far as I am concerned, solr requires java (since it's based on lucene), and sphinx doesn't. That's why I go with sphinx unless I have a very good reason to want solr specifically.

0

My experience has been for small data, thinking sphinx (or ultra) have been an easy search solution to utilize for a developer just looking to get something running. Once the data is larger than say, one hundred thousand rows in the db, then both plugins expose how tightly coupled they are to active record. One then has to balance the delicate dance between when is the sphinx index executed (in cron, in deploy, etc.), how often indexing is run, is delta indexing used, and how much time indexing takes, among other things. Also, once your data gets complicated about how and what results should be exposed in search, you start to feel like the customizability of sphinx is limiting.

We are in the process of moving search out of a sphinx plugin into something independent of the development and deployment lifecycle of our active record models. We have not decided if we will continue to use sphinx or switch to solr. We just want to get search and indexing decoupled from the model and pulled out into it's own service that our rails application speaks to.

0

I used both in different projects. I would stay with solr, as it was easier to install: but that is just my experience. You can get more information here.

0

I'm also trying to compare Solr/Sphinx and found another way they are different in. It's search features:

  • strict order operator
  • SENTENCE/PARAGRAPH search

If these features are important in context of your development, take a look at this.

當重新索引主索引時,執行完整索引(即,不以任何方式合併delta)。除此之外,你的評論是現貨。 - 詹姆斯希利於09年11月23日11:48

是的,它沒有在物理上合併,這是一個糟糕的措辭。謝謝你指出。 - 米蘭Novota 09年11月23日12:16

此外,值得注意的是 - Thinking Sphinx中的刪除被跟踪(盡可能多)而不需要delta索引。 - 拍攝於09年11月24日1:33

另請注意,只要重新編制主索引,就需要重新索引delta。否則,您將在兩個索引中都有條目,直到重新編制增量索引(在主重新索引之後有效地清除它)。 - mlissner 2011年9月10日3:17

0
votes
answers
30 views
+10

Alternatives to search software/servers to retrieving IDs for all matching documents

I am trying to figure out how to filter a very large set of documents based on keyword matching.

I have 20+million entries with ID and (several) text fields in my SQL database and I want to get all IDs for which the text matches a set of keywords. This includes more complex expressions like:

 (term1 NEAR term2 NEAR term3) AND NOT "A phrase" AND @fieldXYZ "wildcards%aswell*"

The results do not need to be scored, sorted or ranked in any way.

From what I understand the power of Lucene/Solr, Sphinx and ElasticSearch is to give back the TOP documents super fast but they are not really intended to give back ALL documents.

I know that it is possible to do this with a custom Collector in Lucene (see What's the most efficient way to retrieve all matching documents from a query in Lucene, unsorted?) and possibly with Cursors/Scrolling in Solr/Elasticsearch but I am wondering if there is any other technology that is specifically optimized for this problem?

0
votes
answers
37 views
+10

Solr雲:等待4000ms後未找到註冊的領導者

-1

我已經創建了6個集合,每個集合有3個分片和2個副本(solr版本5.5.0)。幾天後我的設置工作正常。但幾天之後,我收到以下錯誤:Solr雲:等待4000ms後未找到註冊的領導者

Error while trying to recover. core=Collection1_shard3_replica2:org.apache.solr.common.SolrException: No registered leader was found after waiting for 4000ms , collection: Collection1 slice: shard3 at org.apache.solr.common.cloud.ZkStateReader.getLeaderRetry(ZkStateReader.java:607) at org.apache.solr.common.cloud.ZkStateReader.getLeaderRetry(ZkStateReader.java:593) at org.apache.solr.cloud.RecoveryStrategy.doRecovery(RecoveryStrategy.java:308) at org.apache.solr.cloud.RecoveryStrategy.run(RecoveryStrategy.java:224) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

我試圖重新啓動飼養員和Solr都,也增加堆內存10 GB。但仍然有問題。

+0

你在(K)VM或裸機上運行? – bigdatadev

+0

你的規格是什麼?你使用了多少臺機器和多少個CPU?你的環境是否被克伯化? – bigdatadev

沙发
0
-1

我們遇到與3節點機器相同的問題(每個節點6個CPU和30GB內存)。以下是我試圖找到解決方案的步驟。

我們已經嘗試過,並沒有工作:

  1. 停止Solr的進程並重新啓動Solr的JVM
  2. 重新收集
  3. 增加/減少內存,但是這只是暫時的修復一天左右
  4. Solr GC調整: https://wiki.apache.org/solr/SolrPerformanceProblems#GC_pause_problems

什麼固定的「沒有註冊的領導者發現」問題:

  1. 減少碎片的數量,基本上我們oversharding。我們將碎片的數量從6個減少到3個,並保留了3個副本。這意味着每個節點現在有3個碎片。
  2. 但是,因爲我們每秒鐘編制了10,000條消息的索引。我也想知道我們的CPU在做什麼。所以我監視了CPU負載和CPU IO。我發現CPU一直在最大限度地工作,造成了很高的IO等待時間,我認爲這造成了最大的麻煩(見下圖)。

由於IO等待時間很長,複製品很難保持同步。 我減少了工作量(發送到solr的消息),以便索引不像以前那樣快速增長。這有助於使一切恢復正常。我的Solr集羣現在是綠色的一段時間,並沒有遇到任何「選舉問題」。 IO等待時間減少到25ms以下,CPU使用率約爲70%,而不是幾乎100%。

一般來說,解決這樣的問題是非常困難的。由於Solr集羣可能會在幾天內正常工作(甚至在其他帖子中看過幾個月)。監視進入Solr節點的IO等待甚至流量。如果發生交通峯值,(每日!)指數可能變得太大。您也可以添加更多節點和分割碎片,這可以減少一臺機器的負載。我選擇減少流向Solr機器的流量,因爲我們使用Solr作爲審計存儲,並且不需要審計日誌的一部分。

CPU load on one of the Solr Hosts enter image description here

+0

這應該作爲對原始問題的評論或作爲單獨問題發佈。另外 - 如果您尚未使用它,請務必使用外部動物園管理員合奏進行測試。 – MatsLindh

+0

這並沒有真正回答這個問題。如果您有不同的問題,可以通過單擊[提問](https://stackoverflow.com/questions/ask)來提問。您也可以[添加賞金](https://stackoverflow.com/help/privileges/set-bounties)來更多地關注這個問題。 - [來自評論](/ review/low-quality-posts/18901616) – iklinac

+0

我認爲我的帖子現在正確回答問題 – bigdatadev

0
votes
answers
37 views
+10

solr php客戶端刻面

1

我正在嘗試獲取刻面結果,我不知道如何。沒有關於solr-php-client的文檔。在這個例子中,print_r($response->getRawResponse())不包含分面。我不確定天氣分區是否被成功請求,或者是訪問響應中的分面數據的問題。如果有關於solr-php-client的在線任何文檔,請也幫助我。solr php客戶端刻面

的另一個問題是如何在開始我錯過了加$additionalParameterssearch arguements的solr-php-client

require_once('solr-php-client/Apache/Solr/Service.php'); 


$solr = new Apache_Solr_Service('localhost', '8983', '/solr/products'); 

if (! $solr->ping()) { 
    echo 'Solr service not responding.'; 
    exit; 
} 


$offset = 0; 
$limit = 10; 


$queries = array(
    'name:iphone' 
); 
$additionalParameters = array(
    'facet' => 'true', 
    'facet.field' => array(
    'category' 
) 
); 

foreach ($queries as $query) { 
$response = $solr->search($query, $offset, $limit); 

if ($response->getHttpStatus() == 200) { 
    print_r($response->getRawResponse()); 

    if ($response->response->numFound > 0) { 
    echo "$query <br />"; 

    foreach ($response->response->docs as $doc) { 
     echo "$doc->id $doc->name <br />"; 
    } 

    echo '<br />'; 
    }else{ 
    echo "zero results"; 
    } 
} 
else { 
    echo $response->getHttpStatusMessage(); 
    } 
} 
沙发
0
0

實例時Solr的被保護聲明「用戶/密碼」;

$response = $solr->search($query, $offset, $limit,$additionalParameters);