Closed brandon-a closed 8 years ago
Not sure what you meant by this @theorangepotato. I tried using it and it doesn't seem to do what I thought it would. Did I misunderstand?
So, instead of saying:
if(target.getName() == nodePtr->getItem()->getName())
...
Which would look for an exact match, use:
if(target.getName() == nodePtr->getItem()->getName().substr(0, target.getName().length()))
...
Which sees if the search string matches the beginning of the description.
Also, while I'm looking at that member function, there should not be an else if immediately after the above code because that will only match one result.
I added the changes and it works, but in order to have multiple items appear I would have to rewrite a bunch and so would Ahmed in the search manager. Do we need to be able to find multiple. If so I can make the changes and maybe Ahmed can help as well otherwise I can make changes in Seachmanager.cpp.
1) On the current commit, I got a core dump when I searched for 'cheese' in the small data set. It did not give any results before it did.
2) I think the secondary key does need to be able to give multiple results. Sorry :disappointed:
I updated the search function to give one result and will not crash when searching for cheese anymore. I will commit in a few minutes.
Use the following to search without an exact match.