... $wdf2 = $field->isBoolIndex() ? 1 : $wdf * $field->weight; while ($wdf2 > XSFieldMeta::MAX_WDF) { $cmds[] = new XSCommand(XS_CMD_DOC_TERM, $wdf1 | XSFieldMeta::MAX_WDF, $field->vno, $term); $wdf2 -= XSFieldMeta::MAX_WDF; } ...