symphonists / search_index

Search Index provides an easy way to implement high performance fulltext searching on your Symphony site
32 stars 21 forks source link

Missing argument 3 for SearchIndex::substr() #23

Closed pixelninja closed 12 years ago

pixelninja commented 13 years ago

When searching for a term that has a - in the string, it returns the error Missing argument 3 for SearchIndex::substr(), called in /usr/home/sites/clampline.com.au/public_html/extensions/search_index/lib/class.search_index.php on line 663 and defined

For example, if the url params are like this: ?keywords=Narva+Auto+Fuses+-+Bulk&per-page=8&page=1&sections=products it returns an error (note the hyphen between fuses and bulk)

But if the keywords param doesn't have the hyphen, like ?keywords=Narva+Auto+Fuses+Bulk&per-page=8&page=1&sections=products then there is no error.

Has this been encountered before? Is there an easy solution or am I doing something stupid? If you need more info just let me know. You can go to clampline.com.au and search for narva globes and the first 2 should throw a hissy.

brendo commented 13 years ago

Nick, this might be a handy reference for this bug. Apparently these functions don't handle their option arguments correctly, so a little bit of a padding is needed.

(sidenote: What do you think of putting a similar String class in the core that abstracts mb_ functions? I think I'd prefer just to require mb_string tbh)

brendo commented 13 years ago

See #24. I just realised you also have an experimental branch, so this might already be fixed on that, but we needed a fix today for the client so #24 does that :)