It shows no error! but May I know what does it mean? are you saying to declare the 'function' before working inside?, like putting some order in the function? and why you said not to use typedef?
Google "C++ function prototype". In this particular instance, it's an issue with the Arduino IDE prototype generator that reorders the automatically generated prototype before the struct definition. If you manually add a prototype, it won't be generated in the wrong place.
Because typedef is a keyword from the C language. Arduino sketches are written in C++, which is a different language. Using typedef struct in C++ is pointless, and for type aliases you should use the using keyword instead of typedef.
on another topic, do I need to declare a function name for typedef there? starting from there until the end of my searchDataSet ? to be put them in main / void loop function etc?
I'm not sure what you mean. Like I mentioned earlier, you shouldn't use typedef in C++: the struct keyword always introduces a new type, you shouldn't write typedef struct.
You can use typedef struct in C, but Arduino sketches are C++, so unless you need compatibility with other C code (which is not something I'd recommend if you're just starting out), don't worry about it, just forget about the typedef.