views:

50

answers:

1

Hello,

How would I index a price int field in a Zend Lucene Search Index?

I am currently using:
$doc->addField(Zend_Search_Lucene_Field::Keyword('price', $price, 'utf-8'));

Is this the correct way? Or should I be storing it specifically as a number somehow?

+1  A: 

I think you do it the right way. I'm not aware of better way to store it.

Tomáš Fejfar
Thanks for confirming it. I was having trouble finding an example of storing a non PK int so I wanted to double check I wasn't missing something (such as perhaps the encoding needs to be set to something else).
justinl