I implemented an ActionPlugin by extending BaseRestHandler. But when I set the searchType (searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH).execute().get()....) it isn't being honored. I can tell the DFS_QUERY_THEN_FETCH isn't working because the scoring is different with the same query executed twice.
Using the REST api externally (via curl) works:
GET /product/_search?search_type=dfs_query_then_fetch ...
Using ElasticSearch 6.1.0.
The index has two replicas.
{
"cluster_name": "stage-1",
"status": "green",
"timed_out": false,
"number_of_nodes": 2,
"number_of_data_nodes": 2,
"active_primary_shards": 10,
"active_shards": 20,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 0,
"delayed_unassigned_shards": 0,
"number_of_pending_tasks": 0,
"number_of_in_flight_fetch": 0,
"task_max_waiting_in_queue_millis": 0,
"active_shards_percent_as_number": 100,
"indices": {
"product_index.json": {
"status": "green",
"number_of_shards": 5,
"number_of_replicas": 1,
"active_primary_shards": 5,
"active_shards": 10,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 0
},
"product": {
"status": "green",
"number_of_shards": 5,
"number_of_replicas": 1,
"active_primary_shards": 5,
"active_shards": 10,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 0
}
}
}