3

I'm using magento enterprise 1.12, and I found that solr doesnt index and unable to search for some conditons:

(1) cannot search sku which is in all numbers

if the sku is in all numbers (where i found that the field type is text), magento couldnt return correct result. But if i search this number in solr admin, it returns results. After investigation , i found that is due to "qt" parameter which generate "qt=magento_zh".
If the searching request contains qt parameter, it search text/fulltext only but not numbers and vice versa. How can i search numbers & text at the same time?

(2) cannot index integer attribute in solr i have an attribute - book_isbn which is all numbers.

In solr, there are 2 relevent indexed columns: attr_book_isbn_zh , attr_sort_isbn_zh

magento always request to search the first one , which is always empty, it should search the latter one which got value. Something strange is the situation only happen on this attribute, i have another text attribute "book_author"(same attribute settings) which never get this problem.
So i would like to why solr doesnt index this column ?

Thanks!!

3
  • Did you ever find a solution here? Jun 27, 2014 at 7:21
  • I finally find a dirty way to do this, that is to change the schema.xml . I use "copyField" to copy another column, and then set another "type" for it. <copyField source="attr_book_isbn_zh" dest="attr_book_isbn_gen"/> <field name="attr_book_isbn_gen" type="textgen" indexed="true" stored="true"/>
    – leo
    Jul 2, 2014 at 9:58
  • you could add this as the accepted answer if you like. It may help other visitors. Sep 24, 2014 at 9:45

1 Answer 1

0
  1. Open attributes via admin->catalog->attributes->manage attributes
  2. Find attribute which you wish to fix (sku, attr_sort_isbn_zh) and edit it.
  3. Set "Use in Quick Search" field to "Yes"
  4. If you want to use it in advanced search, set "Use in Advanced Search" field to "Yes"
  5. Save attribute
  6. You should re-index Product Flat Data and Catalog Search Index via System->Index Management

I test with sku attribute and changed sku of some products to number. Search results are perfect!

3
  • You tested this for a Solr-based index?
    – benmarks
    May 29, 2013 at 15:33
  • Sorry, I didn't mention Solr-based search. Tested with standard Magento search functionality.
    – mageUz
    May 29, 2013 at 15:43
  • Thanks all of you, your suggestion is fine for standard search, but the problem only comes up when using solr
    – leo
    Jul 2, 2014 at 9:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.