- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的客户端应用程序找到了我的 Solr 4.2.1 服务器并且似乎能够索引文档。我还没有写任何查询代码。但是当我访问我的 Solr Admin 后台时,当我点击查询时,我得到以下异常:
Apr 16, 2013 4:55:31 PM org.apache.solr.core.SolrCore execute
INFO: [1050] webapp=/viparis-solr-server path=/admin/file params={file=/usr/local/tomcat7/webapps/viparis-solr-server/Proto/solr/common/fr/schema.xml&contentType=text/xml;charset%3Dutf-8} status=500 QTime=27
Apr 16, 2013 4:55:31 PM org.apache.solr.common.SolrException log
SEVERE: null:java.lang.NullPointerException
at org.apache.solr.handler.admin.ShowFileRequestHandler.showFromFileSystem(ShowFileRequestHandler.java:212)
at org.apache.solr.handler.admin.ShowFileRequestHandler.handleRequestBody(ShowFileRequestHandler.java:122)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1816)
at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:448)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:269)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
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)
事实上,文件/usr/local/tomcat7/webapps/viparis-solr-server/Proto/solr/common/fr/schema.xml
存在,Tomcat服务器具有访问它的阅读权限。此路径在 solr.xml 中定义为核心配置的一部分。
有什么想法吗?
编辑:在 Arkain 的建议之后,这是我的 schema.xml 的一部分。这实际上是我从另一个正常工作的 Solr 服务器上获取它后唯一更改的部分,所以问题可能出在那里:
<field name="TYPE" type="string" indexed="true" stored="true"/>
<field name="id_manifestation" type="string" indexed="true" stored="true"/>
<field name="nom" type="string" indexed="true" stored="true" omitNorms="false"/>
<field name="nomFr" type="text_full" indexed="false" stored="true"/>
<field name="nomEn" type="text_full" indexed="false" stored="true"/>
<field name="theme" type="string" indexed="false" stored="true" multiValued="true"/>
<field name="descriptionEn" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="descriptionFr" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="motsCleEn" type="text_full" indexed="true" stored="true" multiValued="true"/>
<field name="motsCleFr" type="text_full" indexed="true" stored="true" multiValued="true"/>
<field name="dateDebut" type="date" indexed="true" stored="true"/>
<field name="dateFin" type="date" indexed="true" stored="true"/>
<field name="url" type="string" indexed="false" stored="true"/>
<field name="logo" type="string" indexed="false" stored="true"/>
编辑:这是我的 solrconfig.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
This is a stripped down config file used for a simple example...
It is *not* a good example to work from.
-->
<config>
<luceneMatchVersion>LUCENE_41</luceneMatchVersion>
<!-- The DirectoryFactory to use for indexes.
solr.StandardDirectoryFactory, the default, is filesystem based.
solr.RAMDirectoryFactory is memory based, not persistent, and doesn't work with replication. -->
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
<dataDir>${solr.core1.data.dir:}</dataDir>
<updateHandler class="solr.DirectUpdateHandler2">
<!-- <updateLog> -->
<!-- <str name="dir">${solr.core1.data.dir:}</str> -->
<!-- </updateLog> -->
</updateHandler>
<!-- realtime get handler, guaranteed to return the latest stored fields
of any document, without the need to commit or open a new searcher. The current
implementation relies on the updateLog feature being enabled. -->
<requestHandler name="/get" class="solr.RealTimeGetHandler">
<lst name="defaults">
<str name="omitHeader">true</str>
</lst>
</requestHandler>
<requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
<requestDispatcher handleSelect="true" >
<requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" formdataUploadLimitInKB="2048" />
</requestDispatcher>
<requestHandler name="standard" class="solr.StandardRequestHandler" default="true" />
<requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
<requestHandler name="/update" class="solr.UpdateRequestHandler" />
<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
<lst name="invariants">
<str name="q">solrpingquery</str>
</lst>
<lst name="defaults">
<str name="echoParams">all</str>
</lst>
</requestHandler>
<!-- multi-colored tag FragmentsBuilder -->
<!-- <fragmentsBuilder name="colored" class="org.apache.solr.highlight.ScoreOrderFragmentsBuilder"> -->
<!-- <lst name="defaults"> -->
<!-- <str name="hl.tag.pre"><![CDATA[ -->
<!-- <b style="background:yellow">,<b style="background:lawgreen">, -->
<!-- <b style="background:aquamarine">,<b style="background:magenta">, -->
<!-- <b style="background:palegreen">,<b style="background:coral">, -->
<!-- <b style="background:wheat">,<b style="background:khaki">, -->
<!-- <b style="background:lime">,<b style="background:deepskyblue">]]></str> -->
<!-- <str name="hl.tag.post"><![CDATA[</b>]]></str> -->
<!-- </lst> -->
<!-- </fragmentsBuilder> -->
<!-- Spell Check
The spell check component can return a list of alternative spelling
suggestions.
http://wiki.apache.org/solr/SpellCheckComponent
-->
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<str name="queryAnalyzerFieldType">textSpell</str>
<lst name="spellchecker">
<str name="name">default</str>
<str name="field">textng</str>
<str name="spellcheckIndexDir">spellchecker</str>
<str name="classname">solr.IndexBasedSpellChecker</str>
<str name="buildOnCommit">true</str>
<str name="comparatorClass">score</str>
</lst>
<!--<lst name="spellchecker">-->
<!-- <str name="name">suggest</str>-->
<!-- <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>-->
<!-- <str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>-->
<!-- -->
<!-- <str name="field">textng</str> the indexed field to derive suggestions from -->
<!-- <float name="threshold">0.005</float>-->
<!-- <str name="buildOnCommit">true</str>-->
<!--</lst>-->
</searchComponent>
<!-- A request handler for demonstrating the spellcheck component.
NOTE: This is purely as an example. The whole purpose of the
SpellCheckComponent is to hook it into the request handler that
handles your normal user queries so that a separate request is
not needed to get suggestions.
IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
See http://wiki.apache.org/solr/SpellCheckComponent for details
on the request parameters.
-->
<requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="df">textng</str>
<str name="spellcheck.dictionary">default</str>
<str name="spellcheck.onlyMorePopular">true</str>
<str name="spellcheck.extendedResults">true</str>
<str name="spellcheck.collate">true</str>
<str name="spellcheck.count">10</str>
<str name="spellcheck.maxCollations">10</str>
<str name="spellcheck.maxCollationTries">10</str>
<str name="spellcheck.collateExtendedResults">true</str>
<str name="spellcheck">true</str>
<str name="defType">edismax</str>
<str name="rows">100</str>
<str name="fl">*,score</str>
<str name="qf">textng^100</str>
<str name="sort">TYPE asc, score desc</str>
<str name="pf">textng^100</str>
<double name="typeboost">1.0</double>
<str name="debugQuery">false</str>
<str name="facet">on</str>
<str name="facet.field">nom_manifestation</str>
<str name="facet.limit">-1</str>
<str name="hl.highlightMultiTerm">true</str>
<str name="hl.fragsize">200</str>
<str name="hl.snippets">200</str>
<!-- <str name="hl.fragmentsBuilder">colored</str> -->
<!-- <str name="hl.fragListBuilder">simple</str> -->
<str name="hl.fl">*</str>
<str name="hl.usePhraseHighlighter">true</str>
<str name="hl">true</str>
</lst>
<arr name="first-components">
<str>spellcheck</str>
</arr>
</requestHandler>
<requestHandler name="/selectItem" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="df">nom</str>
<str name="rows">100</str>
<str name="fl">*,score</str>
<str name="qf">nom^100</str>
<str name="sort">TYPE asc, score desc</str>
<double name="typeboost">1.0</double>
<str name="debugQuery">false</str>
</lst>
</requestHandler>
<requestHandler name="/store" class="solr.SearchHandler"
startup="lazy">
<lst name="defaults">
<str name="df">nom</str>
<str name="spellcheck.onlyMorePopular">false</str>
<str name="spellcheck.extendedResults">true</str>
<str name="spellcheck.collate">true</str>
<str name="spellcheck.count">1</str>
<str name="spellcheck">true</str>
<str name="defType">edismax</str>
<str name="rows">100</str>
<str name="sort">score desc</str>
<double name="typeboost">1.0</double>
<str name="debugQuery">false</str>
<str name="qf">nom^100 textphon^50</str>
<str name="facet">on</str>
<str name="facet.field">nom_manifestation</str>
<str name="facet.limit">-1</str>
<str name="hl.highlightMultiTerm">true</str>
<str name="hl.fragsize">200</str>
<str name="hl.snippets">200</str>
<!-- <str name="hl.fragmentsBuilder">colored</str> -->
<!-- <str name="hl.fragListBuilder">simple</str> -->
<str name="hl.fl">*</str>
<str name="hl.usePhraseHighlighter">true</str>
<str name="hl">true</str>
</lst>
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
<searchComponent class="solr.SpellCheckComponent" name="suggest">
<lst name="spellchecker">
<str name="name">suggest</str>
<str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
<str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
<!-- Alternatives to lookupImpl:
org.apache.solr.spelling.suggest.fst.FSTLookup [finite state automaton]
org.apache.solr.spelling.suggest.fst.WFSTLookupFactory [weighted finite state automaton]
org.apache.solr.spelling.suggest.jaspell.JaspellLookup [default, jaspell-based]
org.apache.solr.spelling.suggest.tst.TSTLookup [ternary trees]
-->
<str name="field">textng</str> <!-- the indexed field to derive suggestions from -->
<float name="threshold">0.005</float>
<!--str name="buildOnCommit">true</str-->
<!--
<str name="sourceLocation">american-english</str>
-->
</lst>
</searchComponent>
<requestHandler class="org.apache.solr.handler.component.SearchHandler" name="/suggest">
<lst name="defaults">
<str name="spellcheck">true</str>
<str name="spellcheck.dictionary">suggest</str>
<str name="spellcheck.onlyMorePopular">true</str>
<str name="spellcheck.count">5</str>
<str name="spellcheck.collate">true</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
<!-- config for the admin interface -->
<admin>
<defaultQuery>solr</defaultQuery>
</admin>
</config>
最佳答案
你确定启动solr时没有其他错误吗? Solr 在启动时读取 solr.xml
、solrconfig.xml
和 schema.xml
,如果这些文件有任何异常,应该有日志中的另一个错误。您可以重启服务器以确保安全吗?
我能想到的一件事是 solrconfig.xml
中的默认值,但错误消息会有所不同。我注意到在您发布的架构中没有名为content 的字段。但是,这个字段用于 solr-home 框架。在您的 solrconfig.xml 中检查这样的构造
<lst name="defaults">
// more defaults
<str name="df">content</str>
</lst>
如果是这种情况,启动时应该会有警告。这可以解释为什么索引有效(你不依赖那里的默认值)但查询失败。
另一个想法。您是否以任何方式强化了您的 Servlet 容器? Solr 经常使用 getClassLoader().getResource()
来查找文件。但如果是这样的话应该会有更多的错误。
您能否在浏览器中查看架构(从下拉列表中选择核心,而不是架构)?
关于java - Solr 找不到 schema.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16040340/
我正在尝试在 Windows 上运行的小于 1GB 的 VM 上设置 YouTrack 和 TeamCity。使用率将非常低(用户和请求)。这是一个 POC 环境,如果它有效,我可能会将它推送到一个超
所以我在尝试使用 FORFILES 解决这个问题时遇到了麻烦。我正在尝试获取不超过 4 天的文件。所以基本上少于 4 天。然而,这似乎不太可能,因为/d -4 获取所有 4 天或更早的项目。 以下是我
如何从下面的 events 表中选择小于 15 分钟前创建的 events? CREATE TABLE events ( created_at timestamp NOT NULL DEFAU
Google Analytics Realtime提供 rt:minutesAgo ,可以过滤查询。 然而,它是一个维度而不是一个度量标准,<=不能在过滤器中使用。 假设我想在最后 n 分钟内获得一些
iOS 核心数据 - 严重的应用程序错误 - 尝试插入 nil 你好, 我的应用程序实际上运行稳定,但在极少数情况下它会崩溃并显示此错误消息... 2019-04-02 20:48:52.437172
我想制作一个 html div 以快速向右移动(例如不到 1 秒)并消失。然后1秒后再次直接出现在这个过程最开始div的位置。此过程将由单击按钮并重复 10 次触发。 我试图在 CSS 中使用过渡属性
我发现使用 TimeTrigger 是 Windows 10 (UWP) 上计划后台任务的方式。但是看起来我们需要给出的最小数字是 15 分钟。只是想知道,即使我们安排它在接下来的 1 分钟内运行,警
我必须在 1 秒内在屏幕上打印 2^20 行整数 printf 不够快,还有其他易于使用的快速输出替代方法吗? 每一行只包含 1 个整数。 我要求它用于竞争性编程问题,我必须将其源代码提交给法官。 最
我是一名优秀的程序员,十分优秀!