Cannot search using special character

Hi,

I noticed that when searching, if you use a special character, the search does not find any results. This seems to only happen if you have a limited number of keywords that you are searching with along with the special character.

For instance, searching for "missing motors initialisation?" works:

"missing initialisation" works:

"missing initialisation?" does not work:

  • The question mark is a wildcard character in Lucene which is supported in searches. Probably a good option would be for the platform would be to have an "Allow advance search" option on the searches or global that would enable these options or not. Special characters are escaped in other platform usages of search but not the site search. Normally you would have two options: 1. Escape the ? with \? except the one character that is escaped in site searches is '\' (go figure) so this is not an option. This leaves you with the following based on how well you know your users? Would they want to use the ? as a wildcard? Would they want to do their own groupings (ex. "(community AND intialization) OR missing") or exclude items (-). If not, strip out these characters (or even just the '?') with simple string replacement in the widget before going to search. 

  • Forgot to mention the reason it's not matching is due to stemming + the wildcard behavior. The query is being parsed as "find me documents that have a term that has the following term' initialisation' and can have any character at the end". Stemming is done to help matching and ends up storing 'initialis' so there is no such term like 'initialisation?' in the index. It's also why "missing initiali?" does work.

  • Ok that makes sense. Will see what the client wants to do.

    Much appreciated!