Developer forum

Forum » Ecommerce - Standard features » Ecom search escape char

Ecom search escape char

Nuno Aguiar
Reply

Hi,

 

How can we escape characters from the lucene search.

 

We have a client that want to search for "m-lok", but due to the '-' char. We applied the workaround of replacing '-' with a '+' but I want to know how/what else chart to escape/workaround.

 

Best Regards,

Nuno


Replies

 
Vladimir
Reply

Hi Nuno,

What type of search do you mean: filters, free-text search, instant/suggested search?

For some filters a keyword analizer is used - so there is no need to escape characters here

For free text searche you may try to use quotes: "search" or 'search'

Best regards,

Vladimir

 
Nuno Aguiar
Reply

Hi Vladimir,

 

I was refering to Filters. It was searching in the Summary field. In this specific situation we needed to escape chars. How could I achieve this?

Keyword: m-lok

 

Best Regards,

Nuno Aguiar

 
Vladimir
Reply

Hi Nuno,

summary field is handled by standardanalyzer.. and it seems you has found a best solution with +

I can't yet suggest better one. Thought it seems there is a problem here, word with digits after "-" (x-999,yy-555) are searched fine, but your case not.

I will investigate the case, hope it is possible to fix

 

Best regards,

Vladimir

 

 

 

 
Nuno Aguiar
Reply

Hi Vladimir,

 

Thanks. I will be waiting for your feedback.

Nuno

 
Vladimir
Reply

Hi Nuno,

it seems I had found a great solution...

added it to 8.5.1 and newer versions

All problems should be gone!

 

Best regards,

Vladimir

 
Nuno Aguiar
Reply

Hi Vladimir,

 

Can you tell me which specific versions?

 

Thanks,

Nuno

 
Anders Ebdrup
Reply

Hi Vladimir,

 

We have also trouble handling special characters as kolon ":" as these are not escaped. Please see this link http://lucene.apache.org/core/2_9_4/queryparsersyntax.html#Escaping%20Special%20Characters

 

Best regards, Anders

 
Vladimir
Reply

Hi guys,

yes, all these characters should work now. Only action is required: search phrase should be taken in quotes.

it will be in the nearest hotfixes: 8.5.1.18, 8.6.0.4 and in 8.6.1 (I hope that I don't lie with minor numbers...)

Best regards,

Vladimir

 

 
Kristian Kirkholt
Reply

Hi Anders

The problem TFS#16744  has now been fixed in version 8.5.1.18

You are able to find this build in the download section:

http://developer.dynamicweb-cms.com/downloads/dynamicweb-8.aspx

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards

Dynamicweb Support
Kristian Kirkholt

 

You must be logged in to post in the forum