Please format your code using
</> icon. It will make your post more readable.
You need to understand how all this works.
By default, when you index
hello world, you basically create 2 entries in the inverted index:
You can of course use phrase search for your first question.
For the second question, I'd really recommend not using any wildcard query but better index your data as you will query them.
Typically using ngrams, you can index here something like
hello. Then searching for
llo will match.
Hope this helps