# Best way to search

**URL:** <https://forum.kirupa.com/t/best-way-to-search/254053>\
**Category:** Uncategorized\
**Created:** [March 7, 2008, 4:09pm UTC](https://forum.kirupa.com/t/best-way-to-search/254053 "2008-03-07T16:09:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![danhodkinson](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@danhodkinson](https://forum.kirupa.com/u/danhodkinson)\
**Post date:** [March 7, 2008, 4:09pm UTC](https://forum.kirupa.com/t/best-way-to-search/254053/1 "2008-03-07T16:09:22Z")

</div>

hi guys, i am unsure of which route to take here…

i have a input box where the user can type a search term and if it is a hit e.g. ball then my pointer is shown at the appropriate x and y co-ordinates.

i have about 50different search terms but some have more than one hit e.g. searching for the terms sports, squash, tennis & gym will all point to the same place.

i was about to set up a big if (search == sport || search == gym etc) with about 50 different else if’s, but i thought there may be a better way to go about it.

would it be more convenient to do it with xml, or arrays?? i am unsure at this point which way to go and dont want to venture off on something when there is a much quicker, practical and less memory hungry route??

thanks for any advice.  
Dan
