Borort

The sky’s the limit…

Archive for the ‘Solr’ Category

Solr Post.jar – post to different Solr port other than 8983

with 2 comments

What if you want to post data to Solr instance whose http port is different from 8983 using post.jar which comes along Solr package?

For example, your Solr http address is : http://localhost:8080/solr

To post data to this Solr index: java -Durl=http://localhost:8080/solr/update -jar post.jar *.xml

That’s all… :)

Written by borort

November 19, 2008 at 5:14 pm

Posted in Search Engines, Solr

Select/delete all items in Solr

with one comment

To select all items for a field in Solr you can use the query : some_item:[* TO *], but if this field is missing from some documents you will not select those documents.

To select all documents you can use the id defined in /conf/schema.xml, for example: <uniqueKey>solr_id</uniqueKey> you can use solr_id:[* TO *].

Now that you have all documents selected you can delete them :D

To delete all documents in Solr use this update xml:

<delete><query>solr_id:[*TO *]</query></delete>

and of course you have to commit:

<commit />

That’s all !

Source: http://blog.tremend.ro/2007/03/02/selectdelete-all-items-in-solr/

Written by borort

July 13, 2008 at 2:17 pm

Posted in Search Engines, Solr