Reindexing missing assetid

We have a search page that should be displaying the assetid of any page or file that is live. Search manager is indexing, but some assets don't appear.


I had a look at the sq_sch_idx table and couldn't see a value for one of the assetid's that is missing.



select * from sq_sch_idx

where component = 'assetid'

and value = 123456;



I am trying to get the search manager to reindex this one asset (at least). Is it possible to do this rather than a use a root node to start reindexing. I was using the reindex script reindexSearchIndex.php but after running for several hours there is still no value for the missing assetid. I have also tried to change some details for the asset but this doesn't get the assetid appearing either on the search page, or added to the table.



Any ideas appreciated.

You could try re-committing the content of the page if you wanted to do one individually, since it will index content on save.


If there are a few assets that aren't indexing there could be a another issue. Would you happen to be using Oracle? Search indexing happens differently on oracle installs.

Hi Anthony,


No luck I have tried re-committing and it still doesn't seem to index that page. I have edited the page added some spaces and comments but still the assetid isn't appearing in the table or on the search page.



We are on postgres using matrix 3.26.5

Anyone have any ideas on how we could get this assetid into the search results.


Would an SQL insert work?

[quote]
Anyone have any ideas on how we could get this assetid into the search results.



Would an SQL insert work?

[/quote]

Hi Mitch,



SQL insert would surely work but i wouldnt really suggest you that. Did you try running the script packages/search/scripts/reindexSearchIndex.php ?

also while running the script can you tail the error.log and see if Matrix is throwing you any errors?



Cheers,



Ash

I was able to add the assetid with an INSERT


INSERT INTO sq_sch_idx(value, component, type, score, assetid, type_code, contextid, use_default) VALUES ('180000', 'assetid', 'int', 1, '180000','page_standard', 'default', '1');



This seemed to work for the ones I was testing.



I am just looking at the SQL to get the join to show when an asset is in the sq_ast table and doesn't appear in sq_sch_idx so I can add them all (for standard pages, pdf files and so on).



Do assets get deleted from the sq_sch_idx table when they are deleted from the system? There seemed to be a lot of assets in that sq_sch_idx table that don't exist in sq_ast.

[quote]
I was able to add the assetid with an INSERT



INSERT INTO sq_sch_idx(value, component, type, score, assetid, type_code, contextid, use_default) VALUES ('180000', 'assetid', 'int', 1, '180000','page_standard', 'default', '1');



This seemed to work for the ones I was testing.



I am just looking at the SQL to get the join to show when an asset is in the sq_ast table and doesn't appear in sq_sch_idx so I can add them all (for standard pages, pdf files and so on).



Do assets get deleted from the sq_sch_idx table when they are deleted from the system? There seemed to be a lot of assets in that sq_sch_idx table that don't exist in sq_ast.

[/quote]



Yes, there are broadcast for onAssetDeleted, onContentsUpdated, onAttributeChange, onAssetStatusUpdate, onAssetCreate, onAssetUpdate on which the reindexing/flush indexing content is called. Also just tried on my local system and it DOES flush the deleted asset content.



Cheers

Although, just to add here, i meant the Indexed content was deleted from the sq_sch_idx after the trash was purged and not when the asset was moved to trash.

Just getting back to looking at this problem.

[quote]

SQL insert would surely work but i wouldnt really suggest you that.

[/quote]



Just out of curiosity why shouldn't I do an insert to fix these when reindex isn't working?


[quote]

Did you try running the script packages/search/scripts/reindexSearchIndex.php ?

also while running the script can you tail the error.log and see if Matrix is throwing you any errors?

[/quote]



select count(assetid) from sq_sch_idx

where assetid = 123456;

55



delete from sq_sch_idx

where assetid = 123456;



reindex using script



php packages/search/scripts/reindexSearchIndex.php /home/websites/matrix/

Enter the #IDs of the root nodes to reindex (space separated) or press ENTER to reindex the whole system: 123456

Do you want to reindex the root node #123456 (yes/no) yes

Start Reindexing

Finished





select count(assetid) from sq_sch_idx

where assetid = 123456;

45



Still no assetid and now less metadata (should I regenerate metadata). So the content has been indexed, metadata and dates and so on but not the assetid.



Nothing in the error log

I dont have a solution for you, but the reason you wouldn't add it manually is because the record will be deleted the next time the asset is reindexed. So it will work for now, but stop working some time in the future when the asset is changed or the reindex tool is used. Unless we can get the reindex code to insert the value, you wont have a permanent solution.