OpenSearch in Yii Site - No trimming?

Hi there,

OpenSearch for this site works like a charm, but has anyone else noticed that question (query) passed to it isn’t trimmed of white spaces?

Just pasted in my Firefox to Yii API Search a "CActiveDataProvider ". Got result:

(link’s text for did you mean trimmed of last space, but actual link, not - i.e.: http://www.yiiframew…ype=api-suggest)

When clicking did you mean link, you (obvious) also get no results.Of course, when pasting (typing) "CActiveDataProvider" (without space at the end) everything works fine and proper document is found.

OpenSearch realizes searching from native Yii site search. There is no trimming on site. If there is a trimming OpenSearch will use it.

And to work with OpenSearch more rapidly it will be good to get straight redirect if there is the only result found. But it`s a question to site too.

Thanks for your answers, GOsha,

Well then, the only hope is in that page moderators / admin will agree with us and consider above mentioned modifications! :]

Will you open up a bug ticket or post in Feature Request forum (or both) or should I do it?

Cheers,

Trejder

Would you please do it?

Fixed, thanks!

As you may see, wei was faster than me! :]

No, it is we, who are thanks giving for this! :]

BTW: Wei, I can confirm that trimming is working fine. But what about second proposition raised by GOsha? I mean - is it technically possible that if search returns only one result that page would be auto-redirected to that result?

For example, if you put "CTreeView.getClientOptions()" into search, you should receive only one result - that is method you are looking for. Is it possible that page would redirect automatically to this topic, instead of displaying it as only one search result?

EDIT: Just noticed something strange. If you enter exactly "CTreeView.getClientOptions()" into Firefox (OpenSearch) this phrase will be searched (and currently returned as only one search result). But if you enter the very same phrase directly to search box that is on every page in a menu, then you will receive that no results were found. Odd…

@Trejder do you still have the urls of the search pages?

I see http://www.yiiframework.com/search/?q=CTreeView.getClientOptions() (which points back here)

Auto redirect if there is only 1 result can be done, but not sure if that is a reasonable experience for the user.

The open search is divided in "Yii api search" and "Yii site search"

In "Yii api search" if there is only one result… would be usefull if the result would be shown without additional click…

As designed OpenSearch must give instant access to information directly from browsers searchbar. But all browsers except IE not supports pointig result urls. Autosuggestion works perfectly, and once clicked expects 1 result in most cases. Thats why user don`t need to do additional click to see desired option. And this situation little noizing mind.

This redirect will be very useful for api searchers and must do working process more fast and smooth.

Yes, i want this feature. Every time when i want to find a documentation for a method, i need to make one additional click. I hate that.

Yes, no I can confirm that it is working as it is expected and as you wrote it. Maybe I missed something when testing / reporting that odd behaviour few days ago.

I agree with others. This should be implemented. I don’t see any reason for requiring user to do another click - if (and only if) there is only one search result.

Ok, so to be clear, if in api search, redirect to the result if only 1 result?

Yes.

Done. Let us know if there are other search problems or suggestions.

Works like a charm! :]

YES! It works fine!