Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

StringIndexOutOfBoundException in RocketChatSearchQueryBuilder #295

Open
westei opened this issue Nov 26, 2018 · 0 comments
Open

StringIndexOutOfBoundException in RocketChatSearchQueryBuilder #295

westei opened this issue Nov 26, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@westei
Copy link
Member

westei commented Nov 26, 2018

In Smarit Logs one can see Exceptions like

2018-11-21 09:49:23,079 [pool-2-thread-2] ERROR o.a.solr.handler.RequestHandlerBase - java.lang.StringIndexOutOfBoundsException: String index out of range: -9
	at java.lang.String.substring(String.java:1967)
	at org.apache.solr.request.macro.MacroExpander._expand(MacroExpander.java:150)
	at org.apache.solr.request.macro.MacroExpander.expand(MacroExpander.java:101)
	at org.apache.solr.request.macro.MacroExpander.expand(MacroExpander.java:65)
	at org.apache.solr.request.macro.MacroExpander.expand(MacroExpander.java:51)
	at org.apache.solr.request.json.RequestUtil.processParams(RequestUtil.java:159)
	at org.apache.solr.util.SolrPluginUtils.setDefaults(SolrPluginUtils.java:180)
	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:170)
	at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
	at org.apache.solr.client.solrj.embedded.EmbeddedSolrServer.request(EmbeddedSolrServer.java:179)
	at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:160)
	at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:177)
	at io.redlink.smarti.query.conversation.RocketChatSearchQueryBuilder.analyseTerm(RocketChatSearchQueryBuilder.java:304)
	at io.redlink.smarti.query.conversation.RocketChatSearchQueryBuilder.buildContextQuery(RocketChatSearchQueryBuilder.java:263)
	at io.redlink.smarti.query.conversation.RocketChatSearchQueryBuilder.buildQuery(RocketChatSearchQueryBuilder.java:158)

Based on first investigations this should come for the Solr Parameter Substitution Feature (see this Blog for more Information about this Feauture

The reason why the RocketChatSearchQueryBuilder is triggering this Exception should be missing Query String Escaping. The details need to be investigated further

Environment

  • Smarti-Version: 0.8.0-RC4
@westei westei self-assigned this Nov 26, 2018
@westei westei added the bug label Nov 26, 2018
@westei westei added this to the v0.8.1 milestone Nov 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant