By default Algolia does not have infix or suffix matching. It won’t find matches when the word is in the middle or the end of a string, only the beginning. So for the search query “note” it will find matches of “notepad” and “notebook” but not “keynote.”
If you’d like to query the middle or end of a word, we do support it in certain use cases. Some information on that can be seen here:
A potentially better option would be to use Synonyms. You could create a synonym for “pants <> sweatpants” that would ensure records matching both terms will be displayed.
This will also address your second concern, as the typo tolerance on “sweatpants” will be in action to ensure proper results for “sweetpants” and “sweeetpants,” etc.