On 4/20/2013 11:21 PM, Tania Marinova wrote:
> so my question is as I have the  abillity to index one partricular row (you 
> saw my code) how can I reindex in the same way one particular row assuming 
> that I know the id of that row (so i can select it) so it's no longer indexed 
> in solr. My database is postgresql. 

Your question is confusing, but I am assuming you want to know how to
delete a document in SolrJ.  There are multiple ways to do it.  If the
field that contains the ID you want to delete is the UniqueKey field
that you defined in your schema, you can use deleteById:

String id = "documentA";
server.deleteById(id);

List<String> ids = new ArrayList<String>();
ids.add("documentA");
ids.add("documentB");
server.deleteById(ids);

If the ID you want to delete is in a field other than the UniqueKey
field, you need deleteByQuery:

// OR is included in case you changed the default operator.
// If you didn't change it, then OR is not required.
String query = "field:(documentA OR documentB)";
server.deleteByQuery(query);

Thanks,
Shawn

Reply via email to