Jump to content

Search function acting funny

PDMP Webmaster

Recommended Posts

Hi all,

Please see my customer's store here. He recently started adding products and was testing the search function when he noticed some funny things, so he asked me to look into it. It seems the search function has trouble with non-alphanumeric characters, which isn't such a big deal. I've seen previous threads where words with a character length less than 4 gave errors, but that seems to be corrected (I'm running v4.4.2) for the most part, though I'll return to that in a bit. I've also seen threads regarding a MySQL error, which I haven't had come up.

What I find really bizarre is that the search string 'plate 23 audubon' returns a hit, but 'audubon plate 23' does not. This is quite an issue, since as a store selling antique prints, it would be very conceivable for someone to come in and search 'audubon' to find prints by that artist. Eventually there'll be a few hundred Audubon's in there, so it'd be reasonable if say a collector comes by, to narrow the search by expanding it to 'audubon plate 23'. If nothing comes up, the customer will conclude we don't have it and move on, probably not thinking to try 'plate 23' or 'plate 23 audubon' instead. Any ideas why this may be happening, and any potential solutions?

Here's another weird thing: I search for 'birds of america', and I get hits. I expand to 'birds of america royal', and I get hits. 'birds of america royal octavo', still fine. 'birds of america royal octavo edition', no problem. 'birds of america royal octavo edition audubon', still ok. ' birds of america royal octavo edition audubon artist', and suddenly I get no hits. I tried removing 'of', so I search for 'birds america royal octavo edition audubon artist', and that works, so I'm thinking either it's a wordcount threshold or an error with a two character word. To test the former, I search 'birds america royal octavo edition audubon artist buzzard', and that works, so it doesn't seem to be a maximum wordcount issue. Why would a two letter word cause a problem there, but not by itself or earlier?

I really don't get it. I have a good idea of which fields are indexed upon entering products, so my understanding of a database is that typically all words (minus certain exclusions, such as special characters, 'a', 'the', etc.) within those fields would be added to an index, or dictionary, and that when a search string is entered it queries that file. What could be causing the above errors? We're hoping not to have to put some sort of message in bold on the homepage letting customers know the search function has a mind of its own and to try a myriad of search string combinations before concluding we don't carry something.

Anyway, if you have any suggestions I'm all ears. Hopefully the above doesn't sound like some tirade, I'm calm and collected, just rather confused.


Link to comment
Share on other sites

Hi Josh

I think there is an update for the search feature in the latest version, 4.4.3. Get the diff report and find the change made for includes\content\viewCat.inc.php . I don't know if it will sort your particular problem out, but give it a go anyway....nothing lost :)


Link to comment
Share on other sites

Hello again Lee,

Thanks as always for helping me out. I've never done an upgrade before and am a bit weary, given the possibility of introducing a new bug, having a new problem come up, etc. However, what I did do is download the new version, take just the one file 'includes\content\viewCat.inc.php', and replaced the old one with it, but noticed no difference in running my test searches. Since I was worried about something else going wrong, I put the old one back in there, but can put the new one back if you'd like to do some of your own testing. For an upgrade to work do I need to put all the new files up? I'm guessing not, since it seems it's just a maintenance release that mostly fixes this and that without overhauling anything.

Any other ideas for me to try?


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...