private boolean doSearchField(String fieldName) {
		if (options.searchAllFields()) {
			return true;
		}

		if (options.searchComments()) {
			if (fieldName.equals(PreCommentFieldFactory.FIELD_NAME) ||
				fieldName.equals(PlateFieldFactory.FIELD_NAME) ||
				fieldName.equals(PostCommentFieldFactory.FIELD_NAME) ||
				fieldName.equals(EolCommentFieldFactory.FIELD_NAME)) {
				return true;
			}
		}

		if (options.searchBothInstructionMnemonicAndOperands() &&
			(currentCodeUnit instanceof Instruction)) {
			if (fieldName.equals(MnemonicFieldFactory.FIELD_NAME) ||
				fieldName.equals(OperandFieldFactory.FIELD_NAME)) {
				return true;
			}
		}
		if (options.searchOnlyInstructionMnemonics() && (currentCodeUnit instanceof Instruction)) {
			if (fieldName.equals(MnemonicFieldFactory.FIELD_NAME)) {
				return true;
			}
		}
		if (options.searchOnlyInstructionOperands() && (currentCodeUnit instanceof Instruction)) {
			if (fieldName.equals(OperandFieldFactory.FIELD_NAME)) {
				return true;
			}
		}

		if (options.searchBothDataMnemonicsAndOperands() && (currentCodeUnit instanceof Data)) {
			if (fieldName.equals(MnemonicFieldFactory.FIELD_NAME) ||
				fieldName.equals(OperandFieldFactory.FIELD_NAME)) {
				return true;
			}
		}
		if (options.searchOnlyDataMnemonics() && (currentCodeUnit instanceof Data)) {
			if (fieldName.equals(MnemonicFieldFactory.FIELD_NAME)) {
				return true;
			}
		}
		if (options.searchOnlyDataOperands() && (currentCodeUnit instanceof Data)) {
			if (fieldName.equals(OperandFieldFactory.FIELD_NAME)) {
				return true;
			}
		}

		if (options.searchFunctions()) {
			if (fieldName.equals(FunctionRepeatableCommentFieldFactory.FIELD_NAME) ||
				fieldName.equals(FunctionSignatureFieldFactory.FIELD_NAME) ||
				fieldName.equals(VariableCommentFieldFactory.FIELD_NAME) ||
				fieldName.equals(VariableLocFieldFactory.FIELD_NAME) ||
				fieldName.equals(VariableNameFieldFactory.FIELD_NAME) ||
				fieldName.equals(VariableTypeFieldFactory.FIELD_NAME)) {
				return true;
			}
		}
		if (options.searchLabels()) {
			if (fieldName.equals(LabelFieldFactory.FIELD_NAME)) {
				return true;
			}
		}

		return false;
	}
Returns the number of fields used in the match.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchtext/ListingDisplaySearcher.java