Developer forum

Forum » Ecommerce - Standard features » Lucene searching in customfields

Lucene searching in customfields

Morten Fink Eriksen
Reply

Hey

 

Is it possible to search in customfields for product via Lucene, or are these fields not indexed by Lucene?


Replies

 
Pavel Volgarev
Reply

Hi Morten,

 

Yes, all custom fields are indexed. The format of the field name in Lucene is the following:

 

  • For normal product fields: "productfield_[sysname]" where "sysname" is the system name of the field.
  • For category fields: "categoryfield_[cat]_[sysname]_[lang]" where "cat" is the system name of the product category, "sysname" is the system name of the field and "lang" is the language Id of the field.

 

-- Pavel

 
Anders Ebdrup
Reply

Hi Pavel

 

Original message by Pavel Volgarev posted on 07/05/2013, 12:51:

  • For normal product fields: "productfield_[sysname]" where "sysname" is the system name of the field.

 

Can you confirm that this is true? Because when looking in the index the naming for the product fields seems to be: "productfield_[fieldid]" where "fieldid" is the id of the custom field which can be found in this table: EcomProductField.

 

This naming convention have some troubles:

  1. It is difficult/impossible to see what the field in the index contains
  2. If you delete the custom field and recreate the field, then the field will have a different id, and you will have to change the custom code
  3. It is difficult to make the custom code as you'll have to check the EcomProductField table instead of just using the "productfield_[systemname]" which seems more intuitive

Best regards, Anders

 

Capture.PNG

 

You must be logged in to post in the forum