Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

EPiServer.Search onlywholewords

Vote:
 

Hi!

I need some help with my searchfunction as it only seems to search for wholewords. I'm not using the searchdatasource, but I see that the property "OnlyWholeWords" has been marked as obsolete with the explanation that it is now handled by Indexing Service. I need to search for both leading and trailing wildcard. The trailing wildcard works fine by adding "mysearchterm*", but not the leading trail. Searching for "*search*" should then find "mysearchterm".

In previous versions of Lucene this wasn't possible, but it seems as from version 2.1 there is a setting QueryParser.setAllowLeadingWildcard(true) for this to work. How can I access this setting in my search? Is it possible?

Best regards,

Timea

#64707
Jan 07, 2013 16:32
Vote:
 

EPiServer does not currently expose a method for setting this property.

The only way atm. is to create a custom indexing handler.

#66245
Feb 25, 2013 16:34
Vote:
 

Well that is a late reply but in any case. Add "~" to the end of the string that you are searching for with Lucene. If I understood properly your question that will do the trick. And the neat thing with that is that it if you look for stor it will return words like story or sto but never something like st or etc. 

#66747
Mar 08, 2013 11:04
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.