You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by makeyourrules <ma...@gmail.com> on 2011/01/29 00:50:45 UTC

DeletepkQuery is not actually deleting the records, please help

Hello, 
I am trying to delete some records from my index with delta-import using
deletePkQuery with the below config, the log prints the deleted documents
and says delta import successfully, but when I search, my search results
still have those deleted documents, i have already spent so much time
researching it but couldn't find any solution. All my database updates are
getting updated with deltaQuery and deltaImportQuery but not the deletes.
Could any one suggest me any solution? 

URL: 
http://localhost:8983/dataimport?command=delta-import

dataConfig.xml:
		<entity name="item"
				dataSource="MyDatasource"
				query="SELECT col1, col2, col3, col4 FROM MyTable1"
					
				deltaImportQuery="SELECT MyTable1.col1, MyTable1.col2, MyTable1.col3,
MyTable1.col4 FROM MyTable1 MyTable1 
					where MyTable1.col1 = '${dataimporter.delta.bcol1}'" 
					
				deltaQuery="SELECT bcol1 from MyTable2
					where LastModifiedTime &gt; '${dataimporter.last_index_time}' and
status in ('A','U')"					

				deletedPkQuery="SELECT bcol1 from MyTable2
					where LastModifiedTime &gt; '${dataimporter.last_index_time}' and
status='D'">
					
			<field column="col1" name="name" />
			<field column="col1" name="desc" />
			<field column="col2" name="companyname" />
			<field column="col3" name="address1" />
			<field name="col4" column="address1" />
		</entity>
		

Log file:



[2011/01/28 16:56:26.498] Completed ModifiedRowKey for Entity: item rows
obtained : 0
[2011/01/28 16:56:26.499] Completed DeletedRowKey for Entity: item rows
obtained : 6
[2011/01/28 16:56:26.499] Completed parentDeltaQuery for Entity: item
[2011/01/28 16:56:32.563] Deleting stale documents 
.........
.........
[2011/01/28 16:58:00.319] Deleting document: BAAH
[2011/01/28 17:06:50.537] Deleting document: BAAI
[2011/01/28 17:07:28.470] Deleting document: BAAL
[2011/01/28 17:08:13.187] Deleting document: BAAM
[2011/01/28 17:08:27.011] Deleting document: BAAJ
[2011/01/28 17:08:44.218] Deleting document: BAAK
[2011/01/28 17:09:13.487] Delta Import completed successfully
[2011/01/28 17:09:32.174] Import completed successfully
[2011/01/28 17:09:32.175] start
commit(optimize=true,waitFlush=false,waitSearcher=true,expungeDeletes=false)
..........
[2011/01/28 17:09:32.212] autowarming Searcher@a44b35 main from
Searcher@f41f34 main
[2011/01/28 17:09:32.215] Read dataimport.properties
[2011/01/28 17:09:32.217] Wrote last indexed time to dataimport.properties
[2011/01/28 17:09:33.791] Time taken = 0:13:45.366


Any suggestions would be highly appreciated.

Thanks,
Prad.

-- 
View this message in context: http://lucene.472066.n3.nabble.com/DeletepkQuery-is-not-actually-deleting-the-records-please-help-tp2368463p2368463.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: DeletepkQuery is not actually deleting the records, please help

Posted by makeyourrules <ma...@gmail.com>.
Thanks for your reply Stefan, mysql log says query is returning those deleted
records and also the solr log has the deleted records, but for some reason
they are not actually getting deleted from the index.

[2011/01/28 16:58:00.319] Deleting document: BAAH
> [2011/01/28 17:06:50.537] Deleting document: BAAI
> [2011/01/28 17:07:28.470] Deleting document: BAAL
> [2011/01/28 17:08:13.187] Deleting document: BAAM
> [2011/01/28 17:08:27.011] Deleting document: BAAJ
> [2011/01/28 17:08:44.218] Deleting document: BAAK
> [2011/01/28 17:09:13.487] Delta Import completed successfully 

Any help would be highly appreciated.

Thanks,
Prad.
-- 
View this message in context: http://lucene.472066.n3.nabble.com/DeletepkQuery-is-not-actually-deleting-the-records-please-help-tp2368463p2389749.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: DeletepkQuery is not actually deleting the records, please help

Posted by Stefan Matheis <ma...@googlemail.com>.
Hey Prad,

already had a look at your mysql-query log, to check if the relevant select
query is executed? and if, what results it had?

Regards
Stefan

On Sat, Jan 29, 2011 at 12:50 AM, makeyourrules <ma...@gmail.com>wrote:

>
> Hello,
> I am trying to delete some records from my index with delta-import using
> deletePkQuery with the below config, the log prints the deleted documents
> and says delta import successfully, but when I search, my search results
> still have those deleted documents, i have already spent so much time
> researching it but couldn't find any solution. All my database updates are
> getting updated with deltaQuery and deltaImportQuery but not the deletes.
> Could any one suggest me any solution?
>
> URL:
> http://localhost:8983/dataimport?command=delta-import
>
> dataConfig.xml:
>                <entity name="item"
>                                dataSource="MyDatasource"
>                                query="SELECT col1, col2, col3, col4 FROM
> MyTable1"
>
>                                deltaImportQuery="SELECT MyTable1.col1,
> MyTable1.col2, MyTable1.col3,
> MyTable1.col4 FROM MyTable1 MyTable1
>                                        where MyTable1.col1 =
> '${dataimporter.delta.bcol1}'"
>
>                                deltaQuery="SELECT bcol1 from MyTable2
>                                        where LastModifiedTime &gt;
> '${dataimporter.last_index_time}' and
> status in ('A','U')"
>
>                                deletedPkQuery="SELECT bcol1 from MyTable2
>                                        where LastModifiedTime &gt;
> '${dataimporter.last_index_time}' and
> status='D'">
>
>                        <field column="col1" name="name" />
>                        <field column="col1" name="desc" />
>                        <field column="col2" name="companyname" />
>                        <field column="col3" name="address1" />
>                        <field name="col4" column="address1" />
>                </entity>
>
>
> Log file:
>
>
>
> [2011/01/28 16:56:26.498] Completed ModifiedRowKey for Entity: item rows
> obtained : 0
> [2011/01/28 16:56:26.499] Completed DeletedRowKey for Entity: item rows
> obtained : 6
> [2011/01/28 16:56:26.499] Completed parentDeltaQuery for Entity: item
> [2011/01/28 16:56:32.563] Deleting stale documents
> .........
> .........
> [2011/01/28 16:58:00.319] Deleting document: BAAH
> [2011/01/28 17:06:50.537] Deleting document: BAAI
> [2011/01/28 17:07:28.470] Deleting document: BAAL
> [2011/01/28 17:08:13.187] Deleting document: BAAM
> [2011/01/28 17:08:27.011] Deleting document: BAAJ
> [2011/01/28 17:08:44.218] Deleting document: BAAK
> [2011/01/28 17:09:13.487] Delta Import completed successfully
> [2011/01/28 17:09:32.174] Import completed successfully
> [2011/01/28 17:09:32.175] start
>
> commit(optimize=true,waitFlush=false,waitSearcher=true,expungeDeletes=false)
> ..........
> [2011/01/28 17:09:32.212] autowarming Searcher@a44b35 main from
> Searcher@f41f34 main
> [2011/01/28 17:09:32.215] Read dataimport.properties
> [2011/01/28 17:09:32.217] Wrote last indexed time to dataimport.properties
> [2011/01/28 17:09:33.791] Time taken = 0:13:45.366
>
>
> Any suggestions would be highly appreciated.
>
> Thanks,
> Prad.
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/DeletepkQuery-is-not-actually-deleting-the-records-please-help-tp2368463p2368463.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>