Monday, November 19, 2012

Delete Documents From Solr Index By Query

If you simply want to delete documents from your Solr index by using the web interface, here's a code snippet that lets you do so:


This lets you delete documents where the id field matches XXXXX.
If you want to delete items that matches more than one field, just add another query:


If you want to delete all items in the index, just use this query:



Tuesday, November 13, 2012

Old Version MediaWiki & PHP 5.3

when you use old version of MediaWiki and PHP 5.3, you should see this error:

PHP Parse error:  syntax error, unexpected T_NAMESPACE, expecting T_STRING 

You must change only the Namspace calss with MWNamespace:

go to your MediaWiki root directory (please make a backup first) and run this command:

find -name "*.php" -exec sed -i 's/Namespace::/MWNamespace::/g' {} \;