I am doing some normal custom queries through the java api, and some custom score queries through the java api.
My non scored queries used SearchType DFS_QUERY_THEN_FETCH. However, I see in the unit test org.elasticsearch.test.integration.search.customscore.CustomScoreSearchTests that the SearchType is QUERY_THEN_FETCH.
A few questions:
- Is QUERY_THEN_FETCH the preferred (or mandatory) search type for custom score queries?
- Either way, I'm getting failures if I do custom score queries (although they worked before, not sure why I have the problems now). If I do a custom score query with DFS_QUERY_THEN_FETCH, I get no results back. If I do QUERY_THEN_FETCH, the the client gets this CLIENT EXCEPTION below, and the server prints the SERVER ERROR below. When I do the exact same query but without custom scoring (using DFS_QUERY_THEN_FETCH) I get the correct results back.
CLIENT EXCEPTION: (when doing custom score with QUERY_THEN_FETCH)
org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query], total failure; shardFailures {[3ccbea0e-b8d6-4440-af3a-71761b3eabfa][index0][1]: RemoteTransportException[[Thena][inet[/10.3.3.156:9300]][search/phase/query]]; nested: QueryPhaseExecutionException[[index0][1]: query[custom score .(+userId:34c40bec15234b4abb900413d464c68b +(body:subject* subject:subject* to:subject* from:subject* cc:subject*),function=org.elasticsearch.index.query.xcontent.CustomScoreQueryParser$ScriptScoreFunction@113ee167)],from[0],size[1000]: Query Failed [Failed to execute main query]];....
SERVER ERROR: (when doing custom score with QUERY_THEN_FETCH)
[12:03:31,942][INFO ][cluster.service ] [Thena] removed {[Balder][292c279e-cae2-435a-a94e-85f9fd6dadf0][inet[/10.3.3.156:9302]]{client=true, data=false, zen.master=false},}, reason: zen-disco-node_failed([Balder][292c279e-cae2-435a-a94e-85f9fd6dadf0][inet[/10.3.3.156:9302]]{client=true, data=false, zen.master=false}), reason transport disconnected