/* Ċ Ġ* ĠCopyright ĠOpen Search ĠContributors Ċ Ġ* ĠSPDX - License - Identifier : ĠApache - 2 . 0 Ċ Ġ*/ Ċ Ċ package Ġorg . opense arch . index management . index state management . rest handler Ċ Ċ import Ġorg . apache . logging . log 4 j . Log Manager Ċ import Ġorg . opense arch . action . support . master . Master Node Request Ċ import Ġorg . opense arch . client . node . Node Client Ċ import Ġorg . opense arch . common . Strings Ċ import Ġorg . opense arch . index management . Index Management Plugin . Companion . IS M _ BASE _ URI Ċ import Ġorg . opense arch . index management . Index Management Plugin . Companion . LEG ACY _ IS M _ BASE _ URI Ċ import Ġorg . opense arch . index management . index state management . model . Search Params Ċ import Ġorg . opense arch . index management . index state management . transport . action . explain . Explain Action Ċ import Ġorg . opense arch . index management . index state management . transport . action . explain . Explain Request Ċ import Ġorg . opense arch . index management . index state management . util . DEFAULT _ JOB _ SORT _ FIELD Ċ import Ġorg . opense arch . index management . index state management . util . DEFAULT _ P AG INATION _ FROM Ċ import Ġorg . opense arch . index management . index state management . util . DEFAULT _ P AG INATION _ SIZE Ċ import Ġorg . opense arch . index management . index state management . util . DEFAULT _ QUERY _ STRING Ċ import Ġorg . opense arch . index management . index state management . util . DEFAULT _ SORT _ ORDER Ċ import Ġorg . opense arch . rest . Base Rest Handler Ċ import Ġorg . opense arch . rest . Base Rest Handler . Rest Channel Consumer Ċ import Ġorg . opense arch . rest . Rest Handler . Re placed Route Ċ import Ġorg . opense arch . rest . Rest Handler . Route Ċ import Ġorg . opense arch . rest . Rest Request Ċ import Ġorg . opense arch . rest . Rest Request . Method . GET Ċ import Ġorg . opense arch . rest . action . Rest To X Content Listener Ċ Ċ private Ġval Ġlog Ġ= ĠLog Manager . getLogger ( Rest Explain Action :: class . java ) Ċ Ċ class ĠRest Explain Action Ġ: ĠBase Rest Handler () Ġ{ ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠEX PLAIN _ BASE _ URI Ġ= Ġ"$ IS M _ BASE _ URI / explain " ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠLE G ACY _ EX PLAIN _ BASE _ URI Ġ= Ġ"$ LEG ACY _ IS M _ BASE _ URI / explain " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġroutes (): ĠList < Route > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġempty List () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġreplaced Routes (): ĠList < Re placed Route > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRe placed Route ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠGET , ĠEX PLAIN _ BASE _ URI , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠGET , ĠLE G ACY _ EX PLAIN _ BASE _ URI ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRe placed Route ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠGET , Ġ"$ EX PLAIN _ BASE _ URI /{ index }", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠGET , Ġ"$ LEG ACY _ EX PLAIN _ BASE _ URI /{ index }" ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetName (): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġ" ism _ explain _ action " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġprepare Request ( request : ĠRest Request , Ġclient : ĠNode Client ): ĠRest Channel Consumer Ġ{ ĊĠĠĠĠĠĠĠ Ġlog . debug ("${ request . method ()} Ġ${ request . path () }") ĊĊĠĠĠĠĠĠĠ Ġval Ġindices : ĠArray < String > Ġ= ĠStrings . split String By Comma ToArray ( request . param (" index ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġsize Ġ= Ġrequest . param As Int (" size ", ĠDEFAULT _ P AG INATION _ SIZE ) ĊĠĠĠĠĠĠĠ Ġval Ġfrom Ġ= Ġrequest . param As Int (" from ", ĠDEFAULT _ P AG INATION _ FROM ) ĊĠĠĠĠĠĠĠ Ġval Ġsort Field Ġ= Ġrequest . param (" sort Field ", ĠDEFAULT _ JOB _ SORT _ FIELD ) ĊĠĠĠĠĠĠĠ Ġval Ġsort Order Ġ= Ġrequest . param (" sort Order ", ĠDEFAULT _ SORT _ ORDER ) ĊĠĠĠĠĠĠĠ Ġval ĠqueryString Ġ= Ġrequest . param (" queryString ", ĠDEFAULT _ QUERY _ STRING ) ĊĊĠĠĠĠĠĠĠ Ġval Ġexplain Request Ġ= ĠEx plain Request ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġindices . toList (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrequest . param As Boolean (" local ", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrequest . param As Time (" master _ timeout ", ĠMaster Node Request . DEFAULT _ MASTER _ NODE _ TIMEOUT ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠSearch Params ( size , Ġfrom , Ġsort Field , Ġsort Order , ĠqueryString ) ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġreturn ĠRest Channel Consumer Ġ{ Ġchannel Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġclient . execute ( Explain Action . INSTANCE , Ġexplain Request , ĠRest To X Content Listener ( channel )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ