Note that there are some explanatory texts on larger screens.

plurals
  1. PONetty Exception not caught properly
    primarykey
    data
    text
    <p>Hi guys I'm trying to build a search engine that searches ES for matches, the interface has a dynamic counter of hits that gets updated after each key press and I'm looking for a way to validate, workaround or catch an exception that gets thrown when the user searches using a double quote for example:</p> <pre><code>a &gt;&gt; 4500 hits ab &gt;&gt; 1200 hits ab" &gt;&gt; massive stack trace ab"c"&gt; 250 hits </code></pre> <p>The stack:</p> <pre><code>2013-04-02 16:41:42,703 [New I/O worker #1] WARN transport.netty - [Jekyll] Exception caught on netty layer [[id: 0x0106148c, /xxx.xxx.xxx.xxx:xxxx =&gt; /xxx.xxx.xxx.xxx:xxxx]] java.lang.ArrayIndexOutOfBoundsException: 54 at org.elasticsearch.common.Unicode.UTF8toUTF16(Unicode.java:190) at org.elasticsearch.common.Unicode.unsafeFromBytesAsUtf16(Unicode.java:106) at org.elasticsearch.common.Unicode.fromBytes(Unicode.java:80) at org.elasticsearch.common.Unicode.fromBytes(Unicode.java:73) at org.elasticsearch.action.count.CountRequest.toString(CountRequest.java:334) at java.lang.String.valueOf(String.java:2854) at java.lang.StringBuilder.append(StringBuilder.java:128) at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.onOperation(TransportBroadcastOperationAction.java:306) at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction$3.handleException(TransportBroadcastOperationAction.java:263) at org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:287) at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:278) at org.elasticsearch.transport.netty.MessageChannelHandler.process(MessageChannelHandler.java:230) at org.elasticsearch.transport.netty.MessageChannelHandler.callDecode(MessageChannelHandler.java:141) at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:93) at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:75) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268) at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255) at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:94) at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:372) at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:246) at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:38) at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:102) at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) 2013-04-02 16:41:42,705 [New I/O worker #2] WARN transport.netty - [Jekyll] Exception caught on netty layer [[id: 0x02474fc7, /xxx.xxx.xxx.xxx:xxxx =&gt; /xxx.xxx.xxx.xxx:xxxx]] ... etc </code></pre> <p>Any suggestions? Please ask if you need any additional information.</p> <p>Try/Catch block that fails to catch the exception:</p> <pre><code>def query_str = buildQuery(params) log.debug("count query: ${query_str}"); log.debug("enter try:"); try{ def search = esclient.count { indices "something" types "somethingelse" query { query_string (query: query_str) } } } catch ( Exception e ) { log.error("The Query is invalid!"); result.hits = 0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload