Hi Derek, Could you please add what version of Solr you see this in? I didn't see a related Jira, so this might warrant a new one.
k/r, Scott On Sun, Nov 15, 2015 at 11:01 PM, Derek Poh <d...@globalsources.com> wrote: > Hi > Iam using spellcheck and synonyms.I am getting > "java.lang.StringIndexOutOfBoundsException: String index out of range: -1" > for some keywords. > > I think I managed to narrow down to the likely caused of it. > I have thisline of entry in the synonyms.txt file, > > body spray,cologne,parfum,parfume,perfume,purfume,toilette > > When I search for 'cologne' it will hit the exception. > If I removed the'body spray' from the line, I will not hit the exception. > > cologne,parfum,parfume,perfume,purfume,toilette > > It seems like it could be due to multi terms in the synonyms files but > there are some keywords with multi terms in synonyms that does not has the > issue. > This line has a multi term "paint ball" in it, when I search for paintball > or paintballs it does not hit the exception. > > paintball,paintballs,paint ball > > > Any advice how can I resolve this issue? > > > The field use for spellcheck: > <copyField dest="text" source="P_CategoryName"/> > > <field name="text" type="text_general" indexed="true" stored="false" > multiValued="true"/> > > <fieldType name="text_general" class="solr.TextField" > positionIncrementGap="100"> > <analyzer type="index"> > <tokenizer class="solr.StandardTokenizerFactory"/> > <filter class="solr.StopFilterFactory" ignoreCase="true" > words="stopwords.txt" /> > <!-- in this example, we will only use synonyms at query time > <filter class="solr.SynonymFilterFactory" > synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/> > --> > <filter class="solr.LowerCaseFilterFactory"/> > </analyzer> > <analyzer type="query"> > <tokenizer class="solr.StandardTokenizerFactory"/> > <filter class="solr.StopFilterFactory" ignoreCase="true" > words="stopwords.txt" /> > <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" > ignoreCase="true" expand="true"/> > <filter class="solr.LowerCaseFilterFactory"/> > </analyzer> > </fieldType> > > > Exception stacktrace: > 2015-11-16T07:06:43,055 - ERROR [qtp744979286-193443:SolrException@142] - > null:java.lang.StringIndexOutOfBoundsException: String index out of range: > -1 > at > java.lang.AbstractStringBuilder.replace(AbstractStringBuilder.java:789) > at java.lang.StringBuilder.replace(StringBuilder.java:266) > at > org.apache.solr.spelling.SpellCheckCollator.getCollation(SpellCheckCollator.java:235) > at > org.apache.solr.spelling.SpellCheckCollator.collate(SpellCheckCollator.java:92) > at > org.apache.solr.handler.component.SpellCheckComponent.addCollationsToResponse(SpellCheckComponent.java:230) > at > org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:197) > at > org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:218) > at > org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135) > at org.apache.solr.core.SolrCore.execute(SolrCore.java:1976) > at > org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:777) > at > org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:418) > at > org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207) > at > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) > at > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) > at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) > at > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) > at > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) > at > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) > at > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) > at > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) > at > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) > at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) > at > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215) > at > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110) > at > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) > at org.eclipse.jetty.server.Server.handle(Server.java:497) > at > org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) > at > org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) > at org.eclipse.jetty.io > .AbstractConnection$2.run(AbstractConnection.java:540) > at > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) > at > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) > at java.lang.Thread.run(Thread.java:722) > > Derek > > ---------------------- > CONFIDENTIALITY NOTICE > This e-mail (including any attachments) may contain confidential and/or > privileged information. If you are not the intended recipient or have > received this e-mail in error, please inform the sender immediately and > delete this e-mail (including any attachments) from your computer, and you > must not use, disclose to anyone else or copy this e-mail (including any > attachments), whether in whole or in part. > This e-mail and any reply to it may be monitored for security, legal, > regulatory compliance and/or other appropriate reasons. -- Scott Stults | Founder & Solutions Architect | OpenSource Connections, LLC | 434.409.2780 http://www.opensourceconnections.com