Fix CJK advanced search

Closes #571 

This ports all of the cjk advanced search spec successfully from the old codebase.