lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RPSolrUser <roopa.parek...@gmail.com>
Subject Delete documents in SOLR 1.4.1
Date Tue, 27 Nov 2012 15:49:18 GMT
Question: We have Solr 1.4.1 in Production currently. We need to delete
documents identified by ids on daily basis from solr.

--Following deletes by keys and delta data load works--
-- snippet of db-data-config.xml

<dataConfig>
  <dataSource name="goodtest" driver="oracle.jdbc.OracleDriver" 
	url="jdbc:oracle:thin:@server:port:servicename"
      user="userid"
      password="password"  batchSize ="5000"/>
	 

  <document>
    <entity name="agreement_master" pk="AGREEMENT_KEY" dataSource="goodtest"
transformer="RegexTransformer,TemplateTransformer,DateFormatTransformer,ClobTransformer,
OracleTimestampTransformer"


   deletedPkQuery="select AGREEMENT_KEY from
solr_part_supplier_agreement_del" 


   query= "select  AGREEMENT_KEY, bunch of other fields    FROM
SOLR_part_supplier_agreement" 
  
   deltaQuery="select AGREEMENT_KEY, bunch of other fields FROM
SOLR_part_supplier_agree_delta" 

   deltaImportQuery="select AGREEMENT_KEY, bunch of other fields FROM
SOLR_part_supplier_agree_delta where AGREEMENT_KEY  =
'${dataimporter.delta.AGREEMENT_KEY}'" >

	</entity>
    </document>
</dataConfig>

-- snippet of solrconfig.xml
   </requestHandler>

   <requestHandler name="/dataimport"
class="org.apache.solr.handler.dataimport.DataImportHandler">
    <lst name="defaults">
    	<str name="config">db-data-config.xml</str>
    </lst>
  </requestHandler>
  
I am invoking Delta-Import using dataimport.jsp. Everything works good.
Delta data (indentifed by SOLR_PART_SUPPLIER_AGREE_DELTA) get indexed and
bunch of documents identified by solr_part_supplier_agreement_del get
deleted.
 
However, I have a need to just delete the documents from another solr core
without loading delta data. How can I achieve that?

 -- This does not work. Does not delete any docs as deletedPkQuery is
supposed only work with delta loads --
<dataConfig>
<dataSource name="test" 
	driver="oracle.jdbc.OracleDriver" 
	url="jdbc:oracle:thin:@server:port:servicename"
    user="userid"
    password="password" 
/>
	<document>
		<entity name="part_master_del" pk="UNIQUE_ID" dataSource="test"
			deletedPkQuery="select  part_master_key as UNIQUE_ID  from
PART_MASTER_DEL" >
 		</entity>
    </document>
</dataConfig>

Question: How can I just delete the documents by id? Is deleteDocById the
answer? How can I use it? I tried but the DIH does not show any updates. Can
we use any other approach?

Do I need to patch SOLR 1.4.1 with any bug fix?
Example of deleteDocById is appreciated.

Thanks.



--
View this message in context: http://lucene.472066.n3.nabble.com/Delete-documents-in-SOLR-1-4-1-tp4022660.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message