lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zheng Lin Edwin Yeo <edwinye...@gmail.com>
Subject Re: Error when highlighting on multiValued fields
Date Mon, 04 Jul 2016 09:14:01 GMT
I found that if I set the termOffsets="false", then I can eliminate the
error, and the highlighting will work normally.
<field name="tag" type="string" indexed="true" stored="true"
multiValued="true" required="false" termVectors="true" termPositions="true"
termOffsets="false"/>

But what could be the reason that setting the termOffsets will cause the
error on the multiValued field with fieldType="string"?

Regards,
Edwin


On 4 July 2016 at 12:30, Zheng Lin Edwin Yeo <edwinyeozl@gmail.com> wrote:

> Hi,
>
> I'm getting this error when I tried to do highlighting search on a
> multiValued field.
>
>   "error":{
>     "metadata":[
>       "error-class","org.apache.solr.common.SolrException",
>       "root-error-class","org.apache.lucene.search.highlight.InvalidTokenOffsetsException"],
>     "msg":"org.apache.lucene.search.highlight.InvalidTokenOffsetsException: Token eee1
exceeds length of provided text sized 3",
>     "trace":"org.apache.solr.common.SolrException: org.apache.lucene.search.highlight.InvalidTokenOffsetsException:
Token eee1 exceeds length of provided text sized 3\r\n\tat org.apache.solr.highlight.DefaultSolrHighlighter.doHighlightingByHighlighter(DefaultSolrHighlighter.java:614)\r\n\tat
org.apache.solr.highlight.DefaultSolrHighlighter.doHighlightingOfField(DefaultSolrHighlighter.java:448)\r\n\tat
org.apache.solr.highlight.DefaultSolrHighlighter.doHighlighting(DefaultSolrHighlighter.java:410)\r\n\tat
org.apache.solr.handler.component.HighlightComponent.process(HighlightComponent.java:142)\r\n\tat
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:293)\r\n\tat
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:156)\r\n\tat
org.apache.solr.core.SolrCore.execute(SolrCore.java:2036)\r\n\tat org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:657)\r\n\tat
org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:464)\r\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:257)\r\n\tat
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:208)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)\r\n\tat
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\r\n\tat
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)\r\n\tat
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)\r\n\tat
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\r\n\tat
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)\r\n\tat
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\r\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)\r\n\tat
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)\r\n\tat
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)\r\n\tat org.eclipse.jetty.server.Server.handle(Server.java:518)\r\n\tat
org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)\r\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)\r\n\tat
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)\r\n\tat
org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)\r\n\tat org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)\r\n\tat
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)\r\n\tat
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)\r\n\tat
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)\r\n\tat
java.lang.Thread.run(Thread.java:745)\r\nCaused by: org.apache.lucene.search.highlight.InvalidTokenOffsetsException:
Token edm1 exceeds length of provided text sized 3\r\n\tat org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(Highlighter.java:225)\r\n\tat
org.apache.solr.highlight.DefaultSolrHighlighter.doHighlightingByHighlighter(DefaultSolrHighlighter.java:602)\r\n\t...
34 more\r\n",
>     "code":500}}
>
>
> Below is my configuration for highlight.
>
>   <requestHandler name="/highlight" class="solr.SearchHandler">
>       <lst name="defaults">
>            <str name="echoParams">none</str>
>            <int name="rows">10</int>
>            <str name="wt">json</str>
>            <str name="indent">true</str>
>   <str name="df">text</str>
>   <str name="fl">id, title, subject, content_type, last_modified, score
> </str>
>
>   <str name="hl">on</str>
>            <str name="hl.fl">id, title, subject, content, tag</str>
>   <str name="hl.highlightMultiTerm">true</str>
>            <str name="hl.preserveMulti">true</str>
>   <str name="hl.fragsize">200</str>
>   <str name="hl.maxAnalyzedChars">100000</str>
>   <str name="hl.usePhraseHighlighter">true</str>
>
> <str name="group">true</str>
> <str name="group.field">signature</str>
> <str name="group.main">true</str>
> <str name="group.cache.percent">100</str>
>      </lst>
>   </requestHandler>
>
>
> Below is my setting for the multiValued field in question
>
>    <field name="tag" type="string" indexed="true" stored="true"
> multiValued="true" required="false" termVectors="true" termPositions="true"
> termOffsets="true"/>
>
>
> I got this error when there are 3 or more values in the multiValued field.
> The fieldType for the field is "String".
>
> What could be the error?
>
> I'm using Solr 6.1.0
>
> Regards,
> Edwin
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message