Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlighting fails with NPE for multifield and number_of_fragments:0 #1380

Closed
imotov opened this issue Oct 7, 2011 · 0 comments
Closed

Highlighting fails with NPE for multifield and number_of_fragments:0 #1380

imotov opened this issue Oct 7, 2011 · 0 comments

Comments

@imotov
Copy link
Contributor

imotov commented Oct 7, 2011

To reproduce, start two ES nodes and run the following script:

curl -XDELETE http://localhost:9200/testidx
curl -XPUT http://localhost:9200/testidx -d '{
    "settings" : {
        "index" : {
            "number_of_shards" : 1,
            "number_of_replicas" : 0
        }
    },
    "mappings" : {
        "rec" : {
            "_source" : { "enabled" : false },
            "properties" : {
            "from" : { "type": "string", "store": "yes" }
            }
        }
    }
}'
curl -XPUT http://localhost:9200/testidx/rec/1 -d '{
    "from" : ["user3@test.com","user2@test.com","user5@test.com"]
}'
echo
curl -XPOST http://localhost:9200/testidx/_refresh
echo
curl localhost:9200/testidx/_search -d '{
    "highlight": {
         "fields":{"from":{"number_of_fragments":0}}
    },
    "fields":["*"],
    "size":10,
    "sort":["_score"],
    "query":{
        "query_string":{
            "default_field":"from",
            "query":"*:*"
         }
    }
}' && echo
curl localhost:9201/testidx/_search -d '{
    "highlight": {
         "fields":{"from":{"number_of_fragments":0}}
    },
    "fields":["*"],
    "size":10,
    "sort":["_score"],
    "query":{
        "query_string":{
            "default_field":"from",
            "query":"*:*"
         }
    }
}' && echo

One of the search requests fails and the node where shard is allocated throws the following exception:

[2011-10-07 11:16:57,872][DEBUG][action.search.type       ] [Maha Yogi] [testidx][0], node[czKz17uBQiaTczE_OzQ0GA], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@43233ac]
org.elasticsearch.transport.RemoteTransportException: [Mikhail Rasputin][inet[/10.0.1.8:9300]][search/phase/query+fetch]
Caused by: java.lang.NullPointerException
    at org.elasticsearch.common.io.stream.HandlesStreamOutput.writeUTF(HandlesStreamOutput.java:54)
    at org.elasticsearch.search.highlight.HighlightField.writeTo(HighlightField.java:110)
    at org.elasticsearch.search.internal.InternalSearchHit.writeTo(InternalSearchHit.java:574)
    at org.elasticsearch.search.internal.InternalSearchHits.writeTo(InternalSearchHits.java:246)
    at org.elasticsearch.search.fetch.FetchSearchResult.writeTo(FetchSearchResult.java:101)
    at org.elasticsearch.search.fetch.QueryFetchSearchResult.writeTo(QueryFetchSearchResult.java:90)
    at org.elasticsearch.transport.support.TransportStreams.buildResponse(TransportStreams.java:136)
    at org.elasticsearch.transport.netty.NettyTransportChannel.sendResponse(NettyTransportChannel.java:74)
    at org.elasticsearch.transport.netty.NettyTransportChannel.sendResponse(NettyTransportChannel.java:66)
    at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryFetchTransportHandler.messageReceived(SearchServiceTransportAction.java:502)
    at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryFetchTransportHandler.messageReceived(SearchServiceTransportAction.java:492)
    at org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.run(MessageChannelHandler.java:238)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
imotov added a commit to imotov/elasticsearch that referenced this issue Oct 7, 2011
@kimchy kimchy closed this as completed in bd87f8d Oct 8, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants