我已经运行了Apache solr 6.1.0。之后,csv文档也被索引到solr 6.1.0中,但是用于文档当前索引时间的索引时间戳字段没有被索引。下面是schema.xml文件中事件时间戳字段的结构。
<field name="event_timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
以上适用于apache solr 4.10.1,但它在apache solr 6.1.0中给出错误如下,
o.a.s.h.RequestHandlerBase org.apache.solr.common.SolrException: undefined field: "event_timestamp"
at org.apache.solr.schema.IndexSchema.getField(IndexSchema.java:1231)
at org.apache.solr.parser.SolrQueryParserBase.getRangeQuery(SolrQueryPar
serBase.java:749)
at org.apache.solr.parser.QueryParser.Term(QueryParser.java:398)
at org.apache.solr.parser.QueryParser.Clause(QueryParser.java:186)
at org.apache.solr.parser.QueryParser.Query(QueryParser.java:107)
at org.apache.solr.parser.QueryParser.TopLevelQuery(QueryParser.java:96)
at org.apache.solr.parser.SolrQueryParserBase.parse(SolrQueryParserBase.
java:153)
at org.apache.solr.search.LuceneQParser.parse(LuceneQParser.java:50)
at org.apache.solr.search.QParser.getQuery(QParser.java:141)
at org.apache.solr.handler.component.QueryComponent.prepare(QueryCompone
nt.java:208)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(Sea
rchHandler.java:267)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandl
erBase.java:156)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:2036)
at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:657)
at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:464)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte
r.java:257)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte
r.java:208)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1668)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java
:581)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j
ava:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.jav
a:548)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandl
er.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandl
er.java:1160)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:
511)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandle
r.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandle
r.java:1092)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j
ava:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(Cont
extHandlerCollection.java:213)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerColl
ection.java:119)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper
.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:518)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.jav
a:244)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(Abstra
ctConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoin
t.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceA
ndRun(ExecuteProduceConsume.java:246)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(Exec
uteProduceConsume.java:156)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPoo
l.java:654)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool
.java:572)
at java.lang.Thread.run(Unknown Source)
请帮我解决问题。我没有得到新版solr中我所缺少的东西。
由于
答案 0 :(得分:2)
它应该工作。所以我会专注于仔细检查它实际上存在于活动模式中。在Admin UI的Files屏幕中查看它是否存在于文件中。另外,查看架构字段,看看它是否出现在下拉列表中。
如果没有,那么您需要检查您的架构是否在正确的位置并且已经重新加载核心来处理它。或者,如果您使用SolrCloud,则已将正确的配置上载到Zookeeper。