2013-04-09 86 views
0

我已将弹性搜索从0.19.4更新为0.20.6,并且没有得到期望的结果..在按键之后进行动态搜索,现在行为不同之前工作正常。弹性搜索升级后出现问题的结果

搜索:

'' = (empty field) fine 
a = 9400 hits 
ab = 126 hits ERROR 
abc = 2 hits ERROR 
abcd 0 hits fine 

依赖我已经改变了:

runtime 'org.elasticsearch:elasticsearch-lang-groovy:1.1.0' --> runtime 'org.elasticsearch:elasticsearch-lang-groovy:1.3.0' 
runtime 'org.elasticsearch:elasticsearch:0.19.4' --> runtime 'org.elasticsearch:elasticsearch:0.20.6' 
runtime 'org.xerial.snappy:snappy-java:1.0.4.1' (new) 

堆栈:

2013-04-09 10:47:58,130 [http-bio-8080-exec-2] DEBUG xxxx.SearchController - result stuff is: [hits:[email protected]] 
2013-04-09 10:47:58,137 [http-bio-8080-exec-2] ERROR xxxx.SearchController - Problem... 
org.codehaus.groovy.grails.web.converters.exceptions.ConverterException: Error converting Bean with class org.elasticsearch.search.internal.InternalSearchHit 
    at grails.converters.JSON.value(JSON.java:199) 
    at grails.converters.JSON.convertAnother(JSON.java:162) 
    at grails.converters.JSON.value(JSON.java:199) 
    at grails.converters.JSON.convertAnother(JSON.java:162) 
    at grails.converters.JSON.value(JSON.java:199) 
    at grails.converters.JSON.convertAnother(JSON.java:162) 
    at grails.converters.JSON.value(JSON.java:199) 
    at grails.converters.JSON.render(JSON.java:134) 
    at grails.converters.JSON.render(JSON.java:150) 
    at xxx.xxxx.xxxx.SearchController.autocomplete(SearchController.groovy:514) 
    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) 
Caused by: java.lang.reflect.InvocationTargetException 
    ... 13 more 
Caused by: java.lang.NullPointerException 
    at org.elasticsearch.common.compress.lzf.LZFCompressor.isCompressed(LZFCompressor.java:76) 
    at org.elasticsearch.common.compress.CompressorFactory.compressor(CompressorFactory.java:124) 
    at org.elasticsearch.common.compress.CompressorFactory.uncompressIfNeeded(CompressorFactory.java:174) 
    at org.elasticsearch.search.internal.InternalSearchHit.sourceRef(InternalSearchHit.java:172) 
    at org.elasticsearch.search.internal.InternalSearchHit.getSourceRef(InternalSearchHit.java:181) 
    ... 13 more 

当代码失败:

try { 
      log.debug("result stuff is: ${results}"); 
      render results as JSON 
     } 
     catch (Exception e) { 
      log.error("Problem...",e); 
     } 
+0

看起来像JSON渲染不能识别新ES的返回参数之一.. – Mantas 2013-04-10 08:56:41

回答

0

这是由于ES结构的轻微变化,不得不改写我的转换方法:)