API Questions on Kentico API.
Version 5.x > API > Leading Wildcard in Lucene Search View modes: 
User avatar
Member
Member
Nesfuratu - 7/21/2011 11:03:33 PM
   
Leading Wildcard in Lucene Search
Hi,

I'm trying to do a substring search using the built in lucene search. eg. *foo*

However, it seems that lucene search do not allow leading *. But I've read online that you can set the SetAllowLeadingWildcard property in the QueryParser. Yet I cannot find where that can be set.

Can someone please help? thanks.

John.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/22/2011 3:35:39 AM
   
RE:Leading Wildcard in Lucene Search
Hi,

This property can be set only when using source code license. However, it is disabled by default due to the Lucene.Net's performance when using this setting. Anyway, in upcoming version 6.0 of Kentico CMS this will be managed by using special analyzers for the wildcards which should improve the search engine performance in this.

Best regards,
Juraj Ondrus

User avatar
Member
Member
g.perhofer-diamonddogs - 4/5/2012 9:50:46 AM
   
RE:Leading Wildcard in Lucene Search
kentico_jurajo wrote: This property can be set only when using source code license.


Hello,

we are using Kentico 6 and have the same search behaviour requirements. Is it now possible to set this property without changing the source code?
thanks.

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 4/6/2012 4:03:37 AM
   
RE:Leading Wildcard in Lucene Search
Hello,

Yes, this is possible, please check the subset analyzer type in the documentation for more information.

Best regards,
Boris Pocatko


User avatar
Member
Member
george.dog - 4/6/2012 4:24:53 AM
   
RE:Leading Wildcard in Lucene Search
nice! Thank you!

User avatar
Certified Developer v7
Certified  Developer v7
dchaffin-hgo - 1/31/2014 2:02:04 AM
   
RE:Leading Wildcard in Lucene Search
I am using Kentico 7 and I changed my index over to subset and still have one question - does this not work with field names? For example, I have a Name field and an Industries field. Here is some sample data (simplified) I'm searching:

Name Industries
Mike 4|5|11|6
Mike 8|3|4|9|11|6

Sample searches:
Mike --- finds both
ike --- finds first one (not sure why this is - there are other "mikes"
that it does find)
+Industries:4* ---finds first one
+Mike +Industries:4* --- finds first one

Of course, if I try to put +Industries:*4*, it says it can't parse that. If I just put +Industries:4 (like I thought the Subset Analyzer would allow me to do), it finds neither of the records.

Am I not using the subset analyzer correctly or is it just not compatible with field queries like that?

Any help/suggestions would be greatly appreciated.

Thanks!
Delford