fix sort by string when the value is null #820
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix
java.lang.NullPointerException
at com.yelp.nrtsearch.server.grpc.SearchResponse$Hit$FieldValue$Builder.setTextValue(SearchResponse.java:4685)
at com.yelp.nrtsearch.server.luceneserver.search.sort.SortParser.getValueForSortField(SortParser.java:202)
at com.yelp.nrtsearch.server.luceneserver.search.sort.SortParser.lambda$static$0(SortParser.java:41)
at com.yelp.nrtsearch.server.luceneserver.search.sort.SortParser.getAllSortedValues(SortParser.java:125)
at com.yelp.nrtsearch.server.luceneserver.search.collectors.SortFieldCollector.fillHitRanking(SortFieldCollector.java:84)
at com.yelp.nrtsearch.server.luceneserver.SearchHandler.setResponseHits(SearchHandler.java:516)
at com.yelp.nrtsearch.server.luceneserver.SearchHandler.handle(SearchHandler.java:233)
at com.yelp.nrtsearch.server.grpc.LuceneServer$LuceneServerImpl.search(LuceneServer.java:1076)
at com.yelp.nrtsearch.server.grpc.LuceneServerGrpc$MethodHandlers.invoke(LuceneServerGrpc.java:3376)
at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:340)
at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:866)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)}
Need to backport to v0.x for deployment