Developer forum

Forum » Development » Storing a product custom field as a tokenized field in Lucene index

Storing a product custom field as a tokenized field in Lucene index

Emil Dumitrescu
Reply

Hi!

Do you guys know how to specify that a custom field attached to a product to be tokenized when it's indexed in Lucene? I'm making a custom filter and I need to filter the products based on this custom field's value, but not on the whole value, but part of it, so, that's why I need this field to be tokenized when stored in Lucene.

I analyzed the index with Luke, and it looks like the product custom fields are not tokenized. I would like my field to be indexed the way other fields are, like   'groups', 'metadescription', 'metakeywords' etc, so I could have a match if I make a query based on just a word that is contained in that value, and not the whole value.

Thanks,

Emil Dumitrescu

 


Replies

 
Emil Dumitrescu
Reply

All right, I've just found out on Pavel's blog that it's possible to use a 'Surrogate' class to extend the indexing with custom fields, which fits nicely with my filtering case.

Thank you!

 

You must be logged in to post in the forum