When you have website with thousands of posts, it is very likely, that it will cause troubles when you load all posts initially.
Maybe it makes sense to add a lazy loading instead? So when you have entered the 2nd or 3rd char the textbox, the dropdown gets filled with posts/pages that fit