Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependend Indexes #27

Open
pquerner opened this issue May 30, 2016 · 2 comments
Open

Dependend Indexes #27

pquerner opened this issue May 30, 2016 · 2 comments

Comments

@pquerner
Copy link

We have a custom indexer which manages the product prices for us, but it must run before "catalog_product_price" so it may be reindexed correctly for magentos index tables.

Here comes the tricky part: it does not work with this module as it does with the default indexer.
In the default magento indexer you could add a xml depend node to your module, so your indexer may run before another indexer:

<index>
            <indexer>
                <abc>
                    <model>custommodule/indexer</model>
                </abc>
                <cataloginventory_stock>
                    <depends>
                        <abc/>
                    </depends>
                </cataloginventory_stock>
            </indexer>
        </index>

This will work if you reindex via default shell "indexer.php" but does not work with AsyncIndex.

I tried to patch it but failed as I am unsure about how the dependend indexes get their info about the events / productids (or whatever) to index.

@Flyingmana
Copy link
Member

thats an interesting case, actually I dont remember to have seen code which orders single entries by such dependent parts.
I wish we already had some tests for this module, will be evil to debug this :/

@pquerner
Copy link
Author

pquerner commented Jun 8, 2016

I think I could give you my WIP code, so you may follow me from there? Or help me get into the right direction?
Currenctly theres not much free time for me, so I guess I could only start to follow it some more on this years hackathon.

I got this far: index the depended indexes first, but when it comes to the actual index process, it wants to index the events for given index but fails.

So could be that our custom indexer does not write into magentos "event" table (I really dont know how that works btw, if you got a slide or blog posts which explains that, I'd be happy to read it), or somewhere in the cache/session it somehow thinks its a whole new index and does not have any events available.

I stopped working right on that point, so I couldnt say which problem to follow next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants