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:org.elasticsearch.search.internal.InternalSearchHits@9b0d61b]
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);
        }
4

1 回答 1

0

这是由于ES结构略有变化,不得不重写我的转换方法:)

于 2013-04-18T14:01:00.377 回答