Analytic

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:

http://localhost:8080/solr/update?stream.body=<delete><query>id:XXXXX</query></delete>&commit=true

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:

http://localhost:8983/solr/update?stream.body=<delete><query>id:XXXXX</query><query>entitytype:YourContent</query></delete>&commit=true

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

<delete><query>*:*</query></delete>

Source: http://blog.dileno.com/archive/201106/delete-documents-from-solr-index-by-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' {} \;