U4-2509 - Umbraco backend search not working correctly with spaces

Created by Tony Fletcher 15 Jul 2013, 08:16:14 Updated by Sebastiaan Janssen 06 Oct 2013, 16:04:14

,I have an Umbraco 4.11.8 site and I have noticed something strange happening with the Umbraco backend search. As I start typing I can see it picking up nodes that match the search but as soon as I type a space then suddenly no results are show. For example if I was to type "test" then it would find "test doc 1", "test doc 2", "test doc 3" but as soon as I add a space i.e. "test " then no results are shown.It is almost as if the space in the index is different to the space that my spacebar is adding if that makes sense! I have even tried deleting the node name and typing it again, I have also tried copying the text from the "Name" property of the node into the search box but that doesn't work either.I have an Examine add-on for querying the index and this finds the articles fine when I add spaces so it seems that it is just the Umbraco backend search box that has a problem.


Funka! 15 Jul 2013, 22:17:42

I [commented on this same problem|http://issues.umbraco.org/issue/U4-416#comment=67-2447] in another issue about a year ago, and there are a handful of other old outstanding issues regarding the backend search feature not working 100% of the way. In fact, I don't think backend search has ever worked for me as well as expected for a few years now, going back to at least v4.7, possibly earlier?

Tony Fletcher 17 Jul 2013, 11:39:08

I have resolved this myself by modifying the QuickSearchHandler.ashx.cs file in the source code, I changed the following line "var operation = criteria.Field("__nodeName", txt.MultipleCharacterWildcard());" to "var operation = criteria.Field("__nodeName", txt);"

Murray Roke 11 Sep 2013, 22:28:56

I've put Tony's fix in a pull request: https://github.com/umbraco/Umbraco-CMS/pull/135

Murray Roke 12 Sep 2013, 01:42:25

NB: I've added another commit to the pull request which updates the query operation to allow words in different order... todo: keyword highlighting does not work correctly

Shannon Deminick 12 Sep 2013, 04:13:50

I've put this into the 6.2 branch. One thing to note, the GroupedOr was fixed in a recent examine version so you might not even have to do that splitting, might be worth having a look in the 6.2 branch?

Murray Roke 12 Sep 2013, 05:17:07

I won't have time to, so if someone else wants to pick it up, jump in :-)

Shannon Deminick 12 Sep 2013, 06:03:26

no worries, i'll have a look! Just might simplify it a little :)

esunxray 12 Sep 2013, 06:11:02

After updated 4.11.9 to 6.*, the backoffice search function is not be able to used.

Murray Roke 23 Sep 2013, 05:59:52

Oh I just noticed that my pull request adjusts the 'autocomplete' part of the search but didn't alter the actual results window which pops up if you press enter.

Sebastiaan Janssen 06 Oct 2013, 14:57:13

@Murray fixed in rev 3ff9d6adbc22eeaa9fc70153b8c5b9858e6cc338 We should extract the search code and put it in a single class at some point so that updates to both aren't needed any more.

Sebastiaan Janssen 06 Oct 2013, 16:04:14

Setting to fixed as it works now, any other simplification tasks can be tracked in a new issue if needed.

Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal


Backwards Compatible: True

Fix Submitted: Pull request

Affected versions:

Due in version: 6.2.0


Story Points: