There are two aspects under consideration regarding the relation of thinking to being, of consciousness to matter. First question to ask is - what is primary - spirit (thinking) or nature (being)? One answer prioritizes being over thinking, and the other one considers spirit as primary and nature as secondary. The second aspect to the relationship question is if the world is cognizable.
According to Engels:
"The great basic question of all philosophy, especially of more recent philosophy, is that concerning the relation of thinking and being... The answers which the philosophers gave to this question split them into two great camps. Those who asserted the primacy of spirit to nature and, therefore, in the last instance, assumed world creation in some form or other... comprised the camp of idealism. The others, who regarded nature as primary, belong to the various schools of materialism...
But the question of the relation of thinking and being has yet another side: in what relation do our thoughts about the world surrounding us stand to this world itself? Is our thinking capable of the cognition of the real world? Are we able in our ideas and notions of the real world to produce a correct reflection of reality? The overwhelming majority of philosophers give an affirmative answer to this question...
In addition there is yet a set of different philosophers - those who question the possibility of any cognition, or at least of an exhaustive cognition, of the world."