|
Java форум JavaTalks форум программистов
|
|
|
|
| Предыдущая тема :: Следующая тема |
| Автор |
Сообщение |
Zhazhah : 184 Новичок Откуда: Краснодар
|
Дек 22, 2011 18:38 |
|
|
Здравствуйте, если правильно понял в solr есть jetty, тоесть можно установить solr залить сайт и всё ок)) как настроить с Tomcat?
в доках прочитал http://wiki.apache.org/solr/SolrTomcat
а куда скопировать? solr.war и код xml?
| Код: |
<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/opt/solr/example/solr.war" debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/opt/solr/example" override="true"/>
</Context> |
|
|
|
|
 |
solr_expert : 16 Новичок
|
Дек 25, 2011 21:10 |
|
|
solr.war нужно скопировать в папку webapps Tomcat'a. А solr.xml (файл контекста веб-приложения solr) в папку conf/Catalina/localhost.
Нужно также иметь папку с конфигурацией и индексами solr. По примеру solr.xml она будет находиться в папке /opt/solr/example. |
|
|
|
 |
Zhazhah : 184 Новичок Откуда: Краснодар
|
Дек 26, 2011 9:45 |
|
|
Спасибо)) Всё скопировал.
С этим не разобрался,
| Цитата: |
| Нужно также иметь папку с конфигурацией и индексами solr. По примеру solr.xml она будет находиться в папке /opt/solr/example. |
в solr.xml у меня
| Код: |
<solr persistent="false">
<cores adminPath="/admin/cores" defaultCoreName="collection1">
<core name="collection1" instanceDir="." />
</cores>
</solr> |
а как настроить папку с индексами и конфигами?
а /opt/solr/example его нужно создать от какой директории? |
|
|
|
 |
solr_expert : 16 Новичок
|
Дек 27, 2011 12:13 |
|
|
Давайте разбираться:
то, что у вас сейчас в solr.xml -- это конфигурация мульти-ядровости для SOLR. В моём пред. ответе solr.xml -- это совсем другое, а именно конфигурация веб-приложения (или файл контекста), содержащегося в файле solr.war (который находится в папке webapps Tomcat'а). Называется он также, как само приложение. Чтобы избежать путаницы, можно переименовать solr.war, например, в mysolr.war. Тогда файл контекста нужно тоже переименовать в mysolr.xml. Его содержимое:
| Код: |
<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/opt/solr/example/solr.war" debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/opt/solr/example" override="true"/>
</Context>
|
Если вы находитесь в windows, то создать можно где-нибудь на диске D, например:
| Код: |
<?xml version="1.0" encoding="utf-8"?>
<Context docBase="d:/solr/mysolr.war" debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="d:/solr" override="true"/>
</Context>
|
Тогда папка d:/solr будет иметь следующее содержимое:
conf/
data/
папку conf/ можно раздобыть как раз из дистрибутива SOLR в папке example/solr/
Папка data/ будет создана автоматически после успешного запуска Tomcat'а и веб-приложения SOLR в его составе.
Если что непонятно, пишите. |
|
|
|
 |
Zhazhah : 184 Новичок Откуда: Краснодар
|
Дек 27, 2011 14:50 |
|
|
Спасибо))
Создал папку /home/mark/solr в неё скопировал solr.war и conf из example/solr/
solr.xml создал и положил в /home/mark/apache-tomcat-7.0.11/conf/Catalina/localhost
| Код: |
<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/home/mark/solr/solr.war" debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/home/mark/solr" override="true"/>
</Context> |
Перезагрузил. Папка data/ создалась))
затем захожу по адресу http://localhost:8080/solr/ и у меня такие ошибки
| Код: |
| HTTP Status 500 - Severe errors in solr configuration. Check your log files for more detailed information on what may be wrong. If you want solr to continue after configuration errors, change: <abortOnConfigurationError>false</abortOnConfigurationError> in solr.xml ------------------------------------------------------------- org.apache.solr.common.SolrException: Error loading class 'solr.VelocityResponseWriter' at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:389) at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:425) at org.apache.solr.core.SolrCore.createInitInstance(SolrCore.java:447) at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1556) at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1550) at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1583) at org.apache.solr.core.SolrCore.initWriters(SolrCore.java:1466) at org.apache.solr.core.SolrCore.<init>(SolrCore.java:556) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:463) at org.apache.solr.core.CoreContainer.load(CoreContainer.java:316) at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:133) at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:94) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:273) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:98) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4542) at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5220) at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5215) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.ClassNotFoundException: solr.VelocityResponseWriter at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:627) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:373) ... 23 more |
|
|
|
|
 |
solr_expert : 16 Новичок
|
Дек 27, 2011 15:35 |
|
|
Какая версия SOLR? Какие exception при старте?
bin/startup.sh; tail -f logs/catalina-yyyy.mm.dd.log
Все либы создались в webapps/solr/WEB-INF/lib ? В версии 3.4 31 либа:
solr-core-3.4-SNAPSHOT.jar
lucene-core-3.4-SNAPSHOT.jar
lucene-analyzers-3.4-SNAPSHOT.jar
utils-1.2-20110926.085407-3.jar
solr-solrj-3.4-SNAPSHOT.jar
lucene-spellchecker-3.4-SNAPSHOT.jar
lucene-spatial-3.4-SNAPSHOT.jar
lucene-misc-3.4-SNAPSHOT.jar
lucene-grouping-3.4-SNAPSHOT.jar
lucene-highlighter-3.4-SNAPSHOT.jar
lucene-queries-3.4-SNAPSHOT.jar
lucene-memory-3.4-SNAPSHOT.jar
solr-noggit-3.4-SNAPSHOT.jar
solr-commons-csv-3.4-SNAPSHOT.jar
log4j-over-slf4j-1.6.1.jar
velocity-tools-2.0.jar
slf4j-jdk14-1.6.1.jar
commons-codec-1.4.jar
velocity-1.6.4.jar
zookeeper-3.3.1.jar
commons-collections-3.2.1.jar
commons-lang-2.4.jar
commons-beanutils-1.7.0.jar
jcl-over-slf4j-1.6.1.jar
wstx-asl-3.2.7.jar
commons-io-1.4.jar
slf4j-api-1.6.1.jar
stax-api-1.0.1.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
commons-httpclient-3.1.jar
commons-fileupload-1.2.1.jar
Покажите conf/solrconfig.xml[list=][/list] |
|
|
|
 |
Zhazhah : 184 Новичок Откуда: Краснодар
|
Дек 27, 2011 16:09 |
|
|
apache-solr-3.5.0
solrconfig.xm пришлось на народ залить
http://narod.ru/disk/35721550001/solrconfig.xml.html
это то что у меня в /lib
apache-solr-core-3.5.0.jar
apache-solr-noggit-r1099557.jar
apache-solr-solrj-3.5.0.jar
commons-codec-1.5.jar
commons-csv-1.0-SNAPSHOT-r966014.jar
commons-fileupload-1.2.1.jar
commons-httpclient-3.1.jar
commons-io-1.4.jar
commons-lang-2.4.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
guava-r05.jar
jcl-over-slf4j-1.6.1.jar
log4j-over-slf4j-1.6.1.jar
lucene-analyzers-3.5.0.jar
lucene-core-3.5.0.jar
lucene-grouping-3.5.0.jar
lucene-highlighter-3.5.0.jar
lucene-memory-3.5.0.jar
lucene-misc-3.5.0.jar
lucene-queries-3.5.0.jar
lucene-spatial-3.5.0.jar
lucene-spellchecker-3.5.0.jar
slf4j-api-1.6.1.jar
slf4j-jdk14-1.6.1.jar
wstx-asl-3.2.7.jar
catalina
27.12.2011 17:00:39 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-sun-1.6.0.24/jre/lib/i386/server:/usr/lib/jvm/java-6-sun-1.6.0.24/jre/lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.24/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
27.12.2011 17:00:39 org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
27.12.2011 17:00:39 org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
27.12.2011 17:00:39 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 633 ms
27.12.2011 17:00:39 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
27.12.2011 17:00:39 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.11
27.12.2011 17:00:39 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor solr.xml from /home/mark/apache-tomcat-7.0.11/conf/Catalina/localhost
27.12.2011 17:00:39 org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'debug' to '0' did not find a matching property.
27.12.2011 17:00:44 org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: Using JNDI solr.home: /home/mark/solr
27.12.2011 17:00:44 org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to '/home/mark/solr/'
27.12.2011 17:00:44 org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init()
27.12.2011 17:00:44 org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: Using JNDI solr.home: /home/mark/solr
27.12.2011 17:00:44 org.apache.solr.core.CoreContainer$Initializer initialize
INFO: looking for solr.xml: /home/mark/solr/solr.xml
27.12.2011 17:00:44 org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: Using JNDI solr.home: /home/mark/solr
27.12.2011 17:00:44 org.apache.solr.core.CoreContainer <init>
INFO: New CoreContainer: solrHome=/home/mark/solr/ instance=30949581
27.12.2011 17:00:44 org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to '/home/mark/solr/'
27.12.2011 17:00:44 org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to '/home/mark/solr/./'
27.12.2011 17:00:44 org.apache.solr.core.SolrConfig initLibs
INFO: Adding specified lib dirs to ClassLoader
27.12.2011 17:00:44 org.apache.solr.core.SolrConfig <init>
INFO: Using Lucene MatchVersion: LUCENE_35
27.12.2011 17:00:44 org.apache.solr.core.SolrConfig <init>
INFO: Loaded SolrConfig: solrconfig.xml
27.12.2011 17:00:44 org.apache.solr.schema.IndexSchema readSchema
INFO: Reading Solr Schema
27.12.2011 14:14:03 org.apache.solr.schema.IndexSchema readSchema
INFO: Schema name=example
....
INFO: default search field is text
27.12.2011 17:00:45 org.apache.solr.schema.IndexSchema readSchema
INFO: query parser default operator is OR
27.12.2011 17:00:45 org.apache.solr.schema.IndexSchema readSchema
INFO: unique key field: id
27.12.2011 17:00:45 org.apache.solr.core.SolrCore <init>
INFO: [] Opening new SolrCore at /home/mark/solr/./, dataDir=/home/mark/solr/./data/
27.12.2011 17:00:45 org.apache.solr.core.JmxMonitoredMap <init>
INFO: JMX monitoring is enabled. Adding Solr mbeans to JMX Server: com.sun.jmx.mbeanserver.JmxMBeanServer@1dfafd1
27.12.2011 17:00:45 org.apache.solr.core.SolrCore initListeners
INFO: [] Added SolrEventListener for newSearcher: org.apache.solr.core.QuerySenderListener{queries=[]}
27.12.2011 17:00:45 org.apache.solr.core.SolrCore initListeners
INFO: [] Added SolrEventListener for firstSearcher: org.apache.solr.core.QuerySenderListener{queries=[{q=static firstSearcher warming in solrconfig.xml}]}
27.12.2011 17:00:45 org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: Error loading class 'solr.VelocityResponseWriter'
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:389)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:425)
at org.apache.solr.core.SolrCore.createInitInstance(SolrCore.java:447)
at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1556)
at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1550)
at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1583)
at org.apache.solr.core.SolrCore.initWriters(SolrCore.java:1466)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:556)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:463)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:316)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:133)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:94)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:273)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:9
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4542)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5220)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5215)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: solr.VelocityResponseWriter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:627)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:373)
... 23 more
27.12.2011 17:00:45 org.apache.solr.servlet.SolrDispatchFilter init
INFO: user.dir=/home/mark
27.12.2011 17:00:45 org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init() done
27.12.2011 17:00:45 org.apache.solr.servlet.SolrServlet init
INFO: SolrServlet.init()
27.12.2011 17:00:45 org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: Using JNDI solr.home: /home/mark/solr
27.12.2011 17:00:45 org.apache.solr.servlet.SolrServlet init
INFO: SolrServlet.init() done
27.12.2011 17:00:45 org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: Using JNDI solr.home: /home/mark/solr
27.12.2011 17:00:45 org.apache.solr.servlet.SolrUpdateServlet init
INFO: SolrUpdateServlet.init() done
27.12.2011 17:00:45 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
27.12.2011 17:00:45 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
27.12.2011 17:00:45 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
27.12.2011 17:00:45 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
27.12.2011 17:00:45 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
27.12.2011 17:00:45 org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
27.12.2011 17:00:45 org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
27.12.2011 17:00:45 org.apache.catalina.startup.Catalina start
INFO: Server startup in 5823 ms |
|
|
|
 |
solr_expert : 16 Новичок
|
Дек 27, 2011 16:29 |
|
|
Похоже, velocity не доложили по какой-то причине.
Можно это отключить в solrconfig.xml, закомментировав блок:
| Код: |
<!-- The solr.velocity.enabled flag is used by Solr's test cases so that this response writer is not
loaded (causing an error if contrib/velocity has not been built fully) -->
<queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" enable="${solr.velocity.enabled:true}"/>
|
и если не поможет, то поставить enable в ${solr.velocity.enabled:false}
contrib означает, что это доп. модуль, для стандартной работы он не является необходимым. |
|
|
|
 |
Zhazhah : 184 Новичок Откуда: Краснодар
|
Дек 28, 2011 10:18 |
|
|
| Большое спасибо))) буду дальше теперь разбираться)) |
|
|
|
 |
Atum : 17 Новичок
|
Дек 28, 2011 14:17 |
|
|
Всем добрый день !У меня схожая проблема !
Установил Solr под GlassFish - настроил - запустил - все работает хорошо! Спасибо этой заметки !
Но не добавляются данные в индекс !
Как делал
Первым способом - взял из примеров ipod_other.xml и попытался залить через post.jar - solr ругается
| Код: |
SEVERE: org.apache.solr.common.SolrException: [doc=F8V7067-APL-KIT] missing required field: entity_type
at org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:346)
at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:60)
at org.apache.solr.update.processor.LogUpdateProcessor.processAdd(LogUpdateProcessorFactory.java:115)
at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:158) |
второе Попытался загрузить данные сразу из базы данных !!!
для этого создал в solrconfig.xml
| Код: |
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">news.xml</str>
</lst>
</requestHandler> |
в Файле news.xml указал конект к базе
| Код: |
<?xml version="1.0" encoding="UTF-8"?>
<dataConfig>
<dataSource type="JdbcDataSource"
driver="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:user/user@xxx.xx.xx.xx:1521:BD2"
user="user" password="user"/>
<document>
<entity name="news" query="SELECT ID,TITLE, ANNOTATION, NEWS FROM news where publish_time > sysdate - 30">
<field column="ID" name="id" />
<field column="NEWS" name="description" />
<field column="ANNOTATION" name="annotation" />
<field column="TITLE" name="title" />
</entity>
</document>
</dataConfig>
|
в схеме schema.xml указал поля
| Код: |
<field name="description" type="string" indexed="true" stored="true"/>
<field name="annotation" type="string" indexed="true" stored="true"/>
<field name="title" type="string" indexed="true" stored="true"/>
|
по URL
http://localhost:8080/solr/admin/dataimport.jsp?handler=/dataimport
вижу свой news.xml но ничего не происходит ...
ВОПРОС как создать индекс ?! |
|
|
|
 |
Atum : 17 Новичок
|
Дек 29, 2011 10:10 |
|
|
UPD :
Внесу уточнение !
при загрузке из базы файлы индекса обновляются (во всяком случае файл _0.fdt содержит записи)
вот какой вопрос - так как вся информация у меня на русском языке - то почему то поиск по ней не происходит ....
в чем может быть причина ? может быть из за кодировок базы или индексного файла?
поиск по индексу ничего не находит  |
|
|
|
 |
solr_expert : 16 Новичок
|
Дек 29, 2011 14:32 |
|
|
|
|
|
|
 |
Atum : 17 Новичок
|
Дек 29, 2011 15:07 |
|
|
пробую
http://localhost:8080/solr/select?q=*:*&rows=0&indent=true
результат
| Код: |
<response>
<result name="response" numFound="0" start="0"/>
<lst name="highlighting"/>
</response> |
log в netbeans и glassfish
| Код: |
| INFO: [] webapp=/solr path=/select params={q=*:*&rows=0&indent=true} hits=0 status=0 QTime=0 |
|
|
|
|
 |
solr_expert : 16 Новичок
|
Дек 29, 2011 15:59 |
|
|
Здесь может быть проблема на этапе индексации. Есть ли в schema.xml поле id? Что пишется в лог сервера при загрузке данных в SOLR?
Другая альтернатива: создать xml c одной записью сначала с информацией на русском (в utf- , а потом на английском языках. И сделать постинг через post.jar.
Содержимое xml:
| Код: |
<add>
<doc>
<field name="id">... <!-- остальные поля и из значения здесь -->
</doc>
</add>
|
|
|
|
|
 |
Atum : 17 Новичок
|
Дек 29, 2011 16:36 |
|
|
создал файл - news_id2.xml
| Код: |
<?xml version="1.0" encoding="UTF-8" ?>
<add>
<doc>
<field name="id">3</field>
<field name="title">new solr add3</field>
</doc>
</add>
|
java -Durl=http://localhost:8080/solr/update -jar post.jar news_id2.xml
| Код: |
C:\solr>java -Durl=http://localhost:8080/solr/update -jar post.jar news_id2.xml
SimplePostTool: version 1.4
SimplePostTool: POSTing files to http://localhost:8080/solr/update..
SimplePostTool: POSTing file news_id2.xml
SimplePostTool: COMMITting Solr index changes.. |
в запросе ничего нет ((
в логе
| Код: |
INFO: SolrDeletionPolicy.onInit: commits:num=1
commit{dir=C:\solr\data\index,segFN=segments_4,version=1325160101249,generation=4,filenames=[_0.tis, _1.frq, _2.tii, _1.fnm, _1.tii, _0.prx, _0.nrm, _1.tis, _0.fnm, _2.prx, _2.fdt, _2.frq, _2.fdx, _2.fnm, _1.prx, _1.fdx, _2.tis, _0.tii, _1.fdt, _0.frq, _0.fdx, _0.fdt, _1.nrm, _2.nrm, segments_4]
INFO: newest commit = 1325160101249
INFO: {add=[4]} 0 0
INFO: [] webapp=/solr path=/update params={} status=0 QTime=0
INFO: start commit(optimize=false,waitFlush=false,waitSearcher=true,expungeDeletes=false)
INFO: SolrDeletionPolicy.onCommit: commits:num=2
commit{dir=C:\solr\data\index,segFN=segments_4,version=1325160101249,generation=4,filenames=[_0.tis, _1.frq, _2.tii, _1.fnm, _1.tii, _0.prx, _0.nrm, _1.tis, _0.fnm, _2.prx, _2.fdt, _2.frq, _2.fdx, _2.fnm, _1.prx, _1.fdx, _2.tis, _0.tii, _1.fdt, _0.frq, _0.fdx, _0.fdt, _1.nrm, _2.nrm, segments_4]
commit{dir=C:\solr\data\index,segFN=segments_5,version=1325160101253,generation=5,filenames=[_4.fdx, _4.tii, _4.frq, _4.prx, _4.fnm, _4.nrm, _4.fdt, _4.tis, segments_5]
INFO: newest commit = 1325160101253
INFO: Opening Searcher@1f69937 main
INFO: end_commit_flush
INFO: autowarming Searcher@1f69937 main from Searcher@14662e3 main
fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming result for Searcher@1f69937 main
fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming Searcher@1f69937 main from Searcher@14662e3 main
filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming result for Searcher@1f69937 main
filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming Searcher@1f69937 main from Searcher@14662e3 main
queryResultCache{lookups=1,hits=0,hitratio=0.00,inserts=5,evictions=0,size=5,warmupTime=16,cumulative_lookups=5,cumulative_hits=1,cumulative_hitratio=0.20,cumulative_inserts=4,cumulative_evictions=0}
INFO: autowarming result for Searcher@1f69937 main
queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=5,evictions=0,size=5,warmupTime=0,cumulative_lookups=5,cumulative_hits=1,cumulative_hitratio=0.20,cumulative_inserts=4,cumulative_evictions=0}
INFO: autowarming Searcher@1f69937 main from Searcher@14662e3 main
documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming result for Searcher@1f69937 main
documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: QuerySenderListener sending requests to Searcher@1f69937 main
INFO: QuerySenderListener done.
INFO: Building spell index for spell checker: default
INFO: Building spell index for spell checker: jarowinkler
INFO: [] Registered new searcher Searcher@1f69937 main
INFO: {commit=} 0 312
INFO: [] webapp=/solr path=/update params={commit=true} status=0 QTime=312
INFO: Closing Searcher@14662e3 main
fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
queryResultCache{lookups=1,hits=0,hitratio=0.00,inserts=5,evictions=0,size=5,warmupTime=16,cumulative_lookups=5,cumulative_hits=1,cumulative_hitratio=0.20,cumulative_inserts=4,cumulative_evictions=0}
documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
|
ЕСЛИ в файле news_id2.xml
убрать
| Код: |
| <?xml version="1.0" encoding="UTF-8" ?> |
то выдает ошибку
| Код: |
INFO: SolrDeletionPolicy.onInit: commits:num=1
commit{dir=C:\solr\data\index,segFN=segments_4,version=1325160101249,generation=4,filenames=[_0.tis, _1.frq, _2.tii, _1.fnm, _1.tii, _0.prx, _0.nrm, _1.tis, _0.fnm, _2.prx, _2.fdt, _2.frq, _2.fdx, _2.fnm, _1.prx, _1.fdx, _2.tis, _0.tii, _1.fdt, _0.frq, _0.fdx, _0.fdt, _1.nrm, _2.nrm, segments_4]
INFO: newest commit = 1325160101249
INFO: {add=[4]} 0 0
INFO: [] webapp=/solr path=/update params={} status=0 QTime=0
INFO: start commit(optimize=false,waitFlush=false,waitSearcher=true,expungeDeletes=false)
INFO: SolrDeletionPolicy.onCommit: commits:num=2
commit{dir=C:\solr\data\index,segFN=segments_4,version=1325160101249,generation=4,filenames=[_0.tis, _1.frq, _2.tii, _1.fnm, _1.tii, _0.prx, _0.nrm, _1.tis, _0.fnm, _2.prx, _2.fdt, _2.frq, _2.fdx, _2.fnm, _1.prx, _1.fdx, _2.tis, _0.tii, _1.fdt, _0.frq, _0.fdx, _0.fdt, _1.nrm, _2.nrm, segments_4]
commit{dir=C:\solr\data\index,segFN=segments_5,version=1325160101253,generation=5,filenames=[_4.fdx, _4.tii, _4.frq, _4.prx, _4.fnm, _4.nrm, _4.fdt, _4.tis, segments_5]
INFO: newest commit = 1325160101253
INFO: Opening Searcher@1f69937 main
INFO: end_commit_flush
INFO: autowarming Searcher@1f69937 main from Searcher@14662e3 main
fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming result for Searcher@1f69937 main
fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming Searcher@1f69937 main from Searcher@14662e3 main
filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming result for Searcher@1f69937 main
filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming Searcher@1f69937 main from Searcher@14662e3 main
queryResultCache{lookups=1,hits=0,hitratio=0.00,inserts=5,evictions=0,size=5,warmupTime=16,cumulative_lookups=5,cumulative_hits=1,cumulative_hitratio=0.20,cumulative_inserts=4,cumulative_evictions=0}
INFO: autowarming result for Searcher@1f69937 main
queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=5,evictions=0,size=5,warmupTime=0,cumulative_lookups=5,cumulative_hits=1,cumulative_hitratio=0.20,cumulative_inserts=4,cumulative_evictions=0}
INFO: autowarming Searcher@1f69937 main from Searcher@14662e3 main
documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming result for Searcher@1f69937 main
documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: QuerySenderListener sending requests to Searcher@1f69937 main
INFO: QuerySenderListener done.
INFO: Building spell index for spell checker: default
INFO: Building spell index for spell checker: jarowinkler
INFO: [] Registered new searcher Searcher@1f69937 main
INFO: {commit=} 0 312
INFO: [] webapp=/solr path=/update params={commit=true} status=0 QTime=312
INFO: Closing Searcher@14662e3 main
fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
queryResultCache{lookups=1,hits=0,hitratio=0.00,inserts=5,evictions=0,size=5,warmupTime=16,cumulative_lookups=5,cumulative_hits=1,cumulative_hitratio=0.20,cumulative_inserts=4,cumulative_evictions=0}
documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: SolrDeletionPolicy.onInit: commits:num=1
commit{dir=C:\solr\data\index,segFN=segments_5,version=1325160101253,generation=5,filenames=[_4.fdx, _4.tii, _4.frq, _4.prx, _4.fnm, _4.nrm, _4.fdt, _4.tis, segments_5]
INFO: newest commit = 1325160101253
INFO: {add=[5]} 0 0
INFO: [] webapp=/solr path=/update params={} status=0 QTime=0
INFO: start commit(optimize=false,waitFlush=false,waitSearcher=true,expungeDeletes=false)
INFO: SolrDeletionPolicy.onCommit: commits:num=2
commit{dir=C:\solr\data\index,segFN=segments_5,version=1325160101253,generation=5,filenames=[_4.fdx, _4.tii, _4.frq, _4.prx, _4.fnm, _4.nrm, _4.fdt, _4.tis, segments_5]
commit{dir=C:\solr\data\index,segFN=segments_6,version=1325160101255,generation=6,filenames=[_4.tii, _5.fdt, _5.prx, _5.fnm, _4.prx, _4.nrm, _4.fnm, _5.frq, _4.fdt, _5.tii, _4.fdx, _4.frq, _5.tis, _5.nrm, _5.fdx, _4.tis, segments_6]
INFO: newest commit = 1325160101255
INFO: Opening Searcher@30a1a8 main
INFO: autowarming Searcher@30a1a8 main from Searcher@1f69937 main
fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: end_commit_flush
INFO: autowarming result for Searcher@30a1a8 main
fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming Searcher@30a1a8 main from Searcher@1f69937 main
filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming result for Searcher@30a1a8 main
filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming Searcher@30a1a8 main from Searcher@1f69937 main
queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=5,evictions=0,size=5,warmupTime=0,cumulative_lookups=5,cumulative_hits=1,cumulative_hitratio=0.20,cumulative_inserts=4,cumulative_evictions=0}
INFO: autowarming result for Searcher@30a1a8 main
queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=5,evictions=0,size=5,warmupTime=15,cumulative_lookups=5,cumulative_hits=1,cumulative_hitratio=0.20,cumulative_inserts=4,cumulative_evictions=0}
INFO: autowarming Searcher@30a1a8 main from Searcher@1f69937 main
documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: autowarming result for Searcher@30a1a8 main
documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
INFO: QuerySenderListener sending requests to Searcher@30a1a8 main
INFO: QuerySenderListener done.
INFO: Index is not optimized therefore skipping building spell check index for: default
INFO: Index is not optimized therefore skipping building spell check index for: jarowinkler
INFO: [] Registered new searcher Searcher@30a1a8 main
INFO: {commit=} 0 109
INFO: [] webapp=/solr path=/update params={commit=true} status=0 QTime=109
INFO: Closing Searcher@1f69937 main
fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=5,evictions=0,size=5,warmupTime=0,cumulative_lookups=5,cumulative_hits=1,cumulative_hitratio=0.20,cumulative_inserts=4,cumulative_evictions=0}
documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
WARNING: Response Error during finishResponse
java.lang.NullPointerException
at com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectionKeyHandler$CloseHandler.notifyClosed(MonitorableSelectionKeyHandler.java:94)
at com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectionKeyHandler$CloseHandler.remotlyClosed(MonitorableSelectionKeyHandler.java:90)
at com.sun.grizzly.BaseSelectionKeyHandler.notifyRemotlyClose(BaseSelectionKeyHandler.java:233)
at com.sun.grizzly.util.OutputWriter.notifyRemotelyClosed(OutputWriter.java:353)
at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:148)
at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:76)
at com.sun.grizzly.http.SocketChannelOutputBuffer.flushChannel(SocketChannelOutputBuffer.java:326)
at com.sun.grizzly.http.SocketChannelOutputBuffer.flushBuffer(SocketChannelOutputBuffer.java:398)
at com.sun.grizzly.http.SocketChannelOutputBuffer.endRequest(SocketChannelOutputBuffer.java:389)
at com.sun.grizzly.http.ProcessorTask.action(ProcessorTask.java:1090)
at com.sun.grizzly.tcp.Response.action(Response.java:268)
at com.sun.grizzly.tcp.Response.finish(Response.java:412)
at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:341)
at org.apache.catalina.connector.Response.finishResponse(Response.java:582)
at org.apache.catalina.connector.CoyoteAdapter.afterService(CoyoteAdapter.java:370)
at com.sun.enterprise.v3.services.impl.ContainerMapper.afterService(ContainerMapper.java:366)
at com.sun.grizzly.http.ProcessorTask.finishResponse(ProcessorTask.java:760)
at com.sun.grizzly.http.ProcessorTask.postResponse(ProcessorTask.java:750)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:726)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662) |
|
|
|
|
 |
|
|
|