Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Built in search functionality bug - use of word 'as'


Go to End


3 Posts   640 Views

Avatar
HARVS1789UK

Community Member, 31 Posts

13 June 2014 at 5:51am

I have an issue with search in a SS 3.1 install, I wouldn't have thought an issue like this would exist in the core code and that it must be affected by something I have done however, other than some minor overloading of the SearchFrom() and getResults() methods on my Page class (neither of which effect the query building logic at all) it is a total stock usage of the search functionality.

If I search for "[some word] as [some word]" (i.e 'cat as dog' or 'foo as bar') I get a fatal error (see the first attached image). Also, far less important, if I do the same in dev mode I also get a deprecated method notice (see the second attached image).

I am fairly certain something weird is going on with the use of the word 'as' and SS's query building logic is mistaking it for part of an SQL statement e.g. `fieldname`AS 'labelname' I think this because of this part of the error message:

"AGAINST ('foo AS "bar')", NULL"

Notice that my 'as' word has been capitalised and is then followed by a single space and opening double quotes (as if it is about to wrap my label in quotes)

Is this a bug?

You may think 'who cares, hardly anyone will be searching for [someword] as [someword]... but I am having this issue on a live, customer facing website for a telecoms company... so the search "pay as you go" happens on a daily basis!

Any help greatly appreciated.

Kind regards,

HARVS1789UK

Avatar
camfindlay

Forum Moderator, 267 Posts

17 June 2014 at 4:44pm

This to me looks like a bug and I have been able to replicate on a fresh copy of 3.1.5.

Would be worth raising a bug over at https://github.com/silverstripe/silverstripe-framework/issues.

Avatar
HARVS1789UK

Community Member, 31 Posts

17 June 2014 at 8:26pm

Thanks for clarifying this is still an issue in the core code of SS 3.1 @camfindlay

I have raised a bug as suggested - https://github.com/silverstripe/silverstripe-framework/issues/3212

Lets hope someone is able to provide a fix