Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Imported products not appearing in search-results, because they aren’t in the shop-root …somehow
 
johjoh
Member
 
Total Posts:  39
Joined:  2010-02-25
 

Hey all,

my problem is, that my imported products don’t appear in search-results and the common solutions, like rebuilding index didn’t help. Now I discovered, this is connected to the fact, they are not in the root-category of the shop. When I add them, they appear.

Then I checked what happens, when I add a product “manually” in the admin. It’s not listed in the root-category, but still can be found via search. I looked into the database and compared it with the other products. There seem to be two tables, containing product-category-mappings:
catalog_category_product
catalog_category_product_index

The manually added product doesn’t appear in the first one, but in the second one it’s mapped to the shop-root. The record contains these values:
category_id: 2 product_id: 2333 position: 0 is_parent: 0 store_id: 1 visibility: 4

When I add a record in this style for a script-imported product, I get the same result: it becomes available to the search, but on the products category-page in the admin, it\’s not assigned to the shop-root.

I see two options right now:
a) manipulating the db-table – dirty solution, don’t like it
b) “Regularly” adding all products to the shop-root via import-script – I’m not sure, if this has unplesant consequences, cause I’m still a beginner with magento, but it seems to be ok.

Is there a better one I’m missing?
BTW: All my products are in sub-categories of the shop-root, but that’s not enough - apparently.

I guess either the search has a bug, or the Mage_Catalog_Model_Product->save() function is missing to set this mapping. Am I right?

Thanks for any hints in advance,
Johannes

 
Magento Community Magento Community
Magento Community
Magento Community
 
johjoh
Member
 
Total Posts:  39
Joined:  2010-02-25
 

Problem seems to be solved:

I reimported all products and mapped them to the shops root-category and I get the same result: They appear in search-results and the mapping to the root-cat is not visible. The code-pattern:

$product = new Mage_Catalog_Model_Product();
$product->setStatus(1)
  ->
setWebsiteIds(array('1'))
  ->
setTypeId('simple')
  ->
setSku($rec["sku"])
  ->
setAttributeSetId($attributeSetId)
  ->
setPrice($rec["price"]);

// setting other attributes

$product->setCategoryIds(array($id_of_actual_category$id_of_shops_root_categroy));

$product->save();

Hope this might help someone. (running 1.4.1.1)

Johannes

 
Magento Community Magento Community
Magento Community
Magento Community
 
Didier MOMBRUN
Jr. Member
 
Total Posts:  2
Joined:  2010-08-30
 

Hi,
MAG : 1.4.1.1
I have a problem that seems the same ? but not exactly i have a result but false !
All product are imported into magento…
When use the search (not advanced search) some product are not find ?
If i use the adavnced search it\\\’s ok

You could try http://ecat.bticino.fr search for \\\"342630\\\" they are 6 result ! but not the product with the \\\"342630\\\" reference
I you search with adavnced into the reference you find it !
But if you try 332663 there is a result ?

Rebuilding index and other, didn’t help.

Have you a ideas

 
Magento Community Magento Community
Magento Community
Magento Community
 
johjoh
Member
 
Total Posts:  39
Joined:  2010-02-25
 

Hey Didier,

I looked at your site and search seems to work as expected: The six items you get when quick-searching 342630 have this number in the description. Looks like quick-search doesn’t search in the SKU (reference) field - so the item that actually has this number isn’t returned. You can change this in the admin at Catalog->Attributes->Manage Attributes->Click the sku-entry->Frontend Proporties->Use in Quick Search

Johannes

 
Magento Community Magento Community
Magento Community
Magento Community
 
Didier MOMBRUN
Jr. Member
 
Total Posts:  2
Joined:  2010-08-30
 

Hi,
I understand your answer and unfortunately the field “reference” that i use is not the SKU field !
It is a new field created specificaly and it has been added into the quick search.

If you copy one of the “reference” of the result you can see that the quick search works for them.

There is always a problem onto my magento ! It is very big problem for us.
Like the Murphy law, the quick search do not work only onto the important product !…

Didier

 
Magento Community Magento Community
Magento Community
Magento Community
 
johjoh
Member
 
Total Posts:  39
Joined:  2010-02-25
 

how do you import your products? via the admin import-function or any kind of script?
does it help to open the products in the admin and to resave them?
does it help to put them in the shops root-category?
does it help to rebuild the “Category Products"-index?
does it help to rebuild all indexes twice in a row?

...things i would try.

johannes

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mirasvit
Guru
 
Avatar
Total Posts:  639
Joined:  2009-08-22
 

Hello,

After each import you need run full-reindex. Take a look at this extension Fast Asynchronous Re-indexing. It solve this problem.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top