What is the exact meaning of the second factor of Enlightenment 'Dhammavicaya'? Does it mean: enquiry of the Dhamma (buddhasasana)? Or is it the enquiry (= tilakkhana) of all dhammas i.c. all phenomena? Or both?
The sutta says:
Abiding thus mindful, he investigates and examines that state (dhammaṃ) with wisdom and embarks upon a full inquiry into it. On whatever occasion, abiding thus mindful, a bhikkhu investigates and examines that state (dhammaṃ) with wisdom and embarks upon a full inquiry into it—on that occasion the investigation-of-states enlightenment factor is aroused in him, and he develops it, and by development it comes to fulfilment in him.
The word 'dhammaṃ' above is 'singular' (rather than plural). Therefore, dhammavicayasambojjhaṅgo (the investigation-of-states enlightenment factor) appears to mean examining satisambojjhaṅgo (the mindfulness enlightenment factor) with wisdom.
In the essay The Seven Factors of Enlightenment, Piyadassi Thera wrote in the footnotes:
Keen investigation of the dhamma (dhammavicaya)
Dhamma is a multisignificant term. Here it means mind and matter (nama-rupa); dhammavicaya is the investigation or analysis of this conflux of mind and body, and all component and conditioned things.
In Bhikkhu Nanamoli's work on the Visuddhimagga (Path of Purification), he referred to dhammavicaya as investigation-of-states.
In the book The Seven Factors of Enlightenment, Ven. Dhammajiva wrote:
When you are mindful, you are able to investigate the primary object. Investigation (dhammavicaya) is what differentiates samatha from vipassanā. Dhamma is mind and matter and vicaya is investigation. Dhammavicaya is investigation into the operation of mind and matter
In the samatha practice, you dwell on the concentration that is being developed, but there is no exploration or penetration into the phenomena. So the mind superficially observes the objects without much investigation or understanding of their true nature.
To work with investigation of the dhamma, you must penetrate into the phenomena. A yogi must directly note all mind objects and matter (nāma and rūpa) that arise at each of the six sense doors during the practice. Become familiar with them, investigate them and penetrate into their true characteristics. This is the vipassanā practice.