I created a small test project with the following domain model:
The dataobject entity holds the data I’m looking for via the nanoflow xpath retrieve.
The non persistent SearchEntity is used to enter the search term.
In the nanoflow on the page displaying the searchentity object I perform a search like you mention:
I pass the searchentity object and perform a retireve with the following xpath:
Then I count the results and display this in a message.
When adding the obejcts in the dataobject entity as follows (3 records):
Searching on 1 or 5 in the searchobject input field will yield as result 1.
Searching for 2 will result in 3 and so on. Searching on 23 for example returns 2 as the expected result. As this seems to be working fine there must be something different in your case. Maybe the TextSearchField1 does not contain what you think or the data is different (maybe a case sensitive thing) or it might even be that you do not have access to the data with the user that is performing the search.
I hope this provides you with some starting points to find the solution for your specific case.
For Erwin regarding my comment