Developer forum

Forum » CMS - Standard features » New index - Search using wildcard

New index - Search using wildcard

Adrian Ursu
Reply

Hi Guys,

Would it be possible to use a wildcard in search?

I mean, if I use the search term "kit" it should return all results that contains "kit" somewhere in the name (for example "sewing kit") while searching for "kit*" should return all results that contain kit somewhere in the name (for example "kitchen sink").

Is that possible?

Thanks,

Adrian 


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

When you are using the contains operator, it is a wildcard search. Lucene does only use trailing wildcards by default: kit* finding "kiting" and not "carkit". Going for *kit* is really slow and you cannot enable it currently on the new index.

Searching for "kit" to find "sewing kit" will happen if you have analyzed the field and is using equal, match any/all or contains.

So - in your case, create a field of type "Summary", add all source fields that contains text that should be searched to that summary, mark it as analyzed and search it with contains. Then it should work with "kit*"

sewing kit
Capture.PNG Capture2.PNG
 
Adrian Ursu
Reply

Thank you Nicolai.

That's how I set it up.

But the client want to be able to search for Kit and return only the values that are an exact match (sewing kit) but also use the wildcard operator to return the results that contain kit (line carkit or kitchen).

The setup with Contains solved the second scenario but not the first one.

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

ok - carkit is currently not an option... I'll note it to become something that can be activated.

BR Nicolai

 
Adrian Ursu
Reply

Thank you


Adrian

 
Hasan H. Samanci
Reply

Hi Nicolai,

Any news on this? I'm in the same dilemma as Adrian (Sorry for the hi-jacking of your post, Adrian smiley )

Best regards

Hasan

 
Allan Iversen
Allan Iversen
Reply

Hi Nicolai,

Any news on this one? - currently we have customers who misses these wildcard search features. 

- Allan, Co3.

 
Allan Iversen
Allan Iversen
Reply

I think that I found the answer here : http://doc.dynamicweb.com/forum/ecommerce-standard-features/adding-wildcard-search-to-repository?M=BasicForum&PID=1605

 
Nicolai Pedersen
Reply

Hi Allan

Yes, it is out there.

Just want to repeat to use this feature with care. It should be used only where strictly needed and it has a performance impact that can be a problem because that Lucene iterate the terms instead of using the index. So large indexes can be a problem.

BR Nicolai

 

You must be logged in to post in the forum