Making sure hook script code only runs for content auditor

Managed by | Updated .

By default hook scripts will run on all search requests including those run by content auditor and also extra searches.

The following code block allows you to specify code that will only run on the content auditor request.

hook_*.groovy
import com.funnelback.publicui.search.model.transaction.SearchQuestion.SearchQuestionType;

...
 
SearchQuestionType questionType = transaction.getQuestion().getQuestionType();

if (questionType.equals(SearchQuestionType.CONTENT_AUDITOR)) {
    // Whatever you want to do...

}

Possible values for the question type are:

  • SEARCH
  • EXTRA_SEARCH 
  • CONTENT_AUDITOR 
  • CONTENT_AUDITOR_DUPLICATES
  • ACCESSIBILITY_AUDITOR
  • ACCESSIBILITY_AUDITOR_ACKNOWLEDGEMENT_COUNTS
Was this artcle helpful?

Comments