Developer forum

Forum » Ecommerce - Standard features » [Index] - String Splitter

[Index] - String Splitter

Ricardo Pereira
Reply

Hi Guys,

I have a custom product field, type text, and that field will have values like this: 1111,2222.
I want the user will be able to search by 1111 and 2222 in separate.
I tried to create a Field Type in the Index (CommaAnalizer) and associate it to a new field. But it not works.

Here is a video for help to understand well the fields what I talk.
http://screencast.com/t/0X7IDxU53

Can anyone please help me?

Thank you!

 

 


Replies

 
Nicolai Høeg Pedersen
Reply

Did you try to set the "Analyzed" checkbox for the field - otherwise the analyzer does not run.

I do not think you need to add a new field type. You can just use a field of type system.string[] as it should already see the value as an array if you do that.

BR Nicolai

 
Ricardo Pereira
Reply

Hi Nicolai,

Thank you for your quick answer.

I tried what you said but not works. 
So, I created two field types, one system.string[] and other String Splitter and the search started to work as I want. 
In the Query I did not associate any of the type fields to the query parameter. I associated the original product custom field.

You can see in this video:
http://screencast.com/t/Di7dlpdV

Could it be a bug?

 

Thank You!

 
Nicolai Høeg Pedersen
Reply

Hi Ricardo

In your video you create 2 new fields on the index. q and qq - but you do not change your search to search the fields... You keep searching in the original data.

Change your search to search the new fields.... And see if that has an affect.

BR Nicolai

 
Ricardo Pereira
Reply

But that is the problem.
It just works well that way.
- If I search in the original data and I delete the 2 new fields the seach doesn't work.
- If I change my search to search the new fields the search doesn't work.  It's strange..
- But if I have the 2 new fields and I search to the original data.. it works!

Please see the video:
http://screencast.com/t/UHzK1RPn

 

Thank you!

 
Nicolai Høeg Pedersen
Reply

You must confuse something, that makes absolutely no sense... Try to create a smaller search with much less criterias - isolate this part of the search, and see what is going on.

BR Nicolai

 
António Ramos
Reply

Hi,

I'm having the same problem but in a different website. I'm filtering by a custom field (XX) and only when i create and index a new field (YY) with the comma analyzer it will work as expected. 

In a earlier version this was filtering OK but when we update to 8.8.1.0, only with this dummy field to comma analyse this will work.

Best regards,

António Ramos

 
Nuno Aguiar
Reply

Hi Antonio and Ricardo,

 

(posting this in the Forum so other people might benefit from it as well)

Nicolai and Lars pointed me to the light at DWTC16! I see the light now. There are problems is our setup that confuse the index, for example:

  • 111,222 is not the same thing as 111, 222 (there's a space after the comma)

 

Another thing is, a non-analyzed field will always be interpreted as a string, even if the field is an array of string because the source value is not... analyzed

 

I am bringing some new tools such as Luke and Lucene.net Analyzer Viewer to make sense of all of it

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum