API
Version 7.x > API > Smart Search SearchMode enum View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 6/23/2013 4:29:39 PM
   
Smart Search SearchMode enum
What is the possibility of adding another SearchMode enum to the list? Currently there are three of them:

* Exact words
* Any word
* All word

I want to add another

* None of these words

I have done so simply by adding another item to the drop down list although, it appears the results module and web parts look at the enum which means I can't easily add this. Is it a limitation of the Lucerne API or how would I go about searching by content that has "none of these words".

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 7/1/2013 6:24:27 AM
   
RE:Smart Search SearchMode enum
Hi,

Currently, you would need to modify the source code (CMS.SiteProvider.SearchHelper, CombineSeachCondition method), or write your own CombineSearchCondition method or alter its result. The search mode is not related to Lucene features, it is just telling the CombineSearchCondition method how to build the searchText. None of these words would be just both words in the searchText with minus signs in front of it.
In the \CMSModules\SmartSearch\Controls\SearchResults.ascx.cs, you can find:
                // Prepare search text
searchText = SearchHelper.CombineSearchCondition(...


Hope this will help.

Regards,
Zdenek