Skip to content

Instantly share code, notes, and snippets.

@thelabdude
Created July 18, 2014 15:11
Show Gist options
  • Save thelabdude/fc56eafaa52e44e57ac3 to your computer and use it in GitHub Desktop.
Save thelabdude/fc56eafaa52e44e57ac3 to your computer and use it in GitHub Desktop.
var skipDoc = false; var pv = doc.getFirstField(\"id\"); var id = (pv != null) ? pv.value : null; logger.info(\"===> \" + id); pv = doc.getFirstField(\"robots\"); var robots = (pv != null) ? pv.value : null; if (robots != null && robots.indexOf(\"NOINDEX\") != -1) skipDoc = true;if (id == \"ERROR\") throw \"This document had an error (from script)\";doc.addField(\"testing\",\"1234\");doc.removeField(\"ignore_me\");!skipDoc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment