You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Gian Marco Tagliani (JIRA)" <ji...@apache.org> on 2010/02/05 12:29:27 UTC

[jira] Created: (SOLR-1759) DIH $skipDoc issue

DIH $skipDoc issue
------------------

                 Key: SOLR-1759
                 URL: https://issues.apache.org/jira/browse/SOLR-1759
             Project: Solr
          Issue Type: Bug
          Components: contrib - DataImportHandler
    Affects Versions: 1.4
            Reporter: Gian Marco Tagliani


I'm using the version 1.4.0 of Solr and I'm having some trouble with the DIH when I use the special command $skipDoc.

After skipping a document to insert, the next one is not inserted in the proper way.


My DIH configuration is quite complex so I'll try to explain myself with a simpler example:

item table:
id 	name
1	aaa
2	bbb

feature table:
Item_id	hidden
1		true
2 		false


DIH conf:

<document name="products">
	<entity name="item" query="select * from item">
		<field column="ID" name="id" />
		<field column="NAME" name="name" />

		<entity name="feature" query="select hidden from feature where item_id='${item.ID}'">
			<field name="$skipDoc" column="hidden" />
		</entity>
	</entity>
</document>


The result I expected is that the record named "bbb" would be imported, but the result of my import case is that the other record (the "aaa") has been inserted.


I took a look to the DIH code and I found a possible problem that could cause this result. 
In the DocBuilder class when a $skipDoc is detected, an exception is raised. After handling the exception another loop starts, without cleaning up the doc variable.
When the next record is read, the addFieldToDoc method can't fill the doc fields because they are already filled.

To solve this problem I just clean up the doc variable when handling the exception.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-1759) DIH $skipDoc issue

Posted by "Gian Marco Tagliani (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gian Marco Tagliani updated SOLR-1759:
--------------------------------------

    Attachment: patch.txt

I attached the patch with this tiny change

> DIH $skipDoc issue
> ------------------
>
>                 Key: SOLR-1759
>                 URL: https://issues.apache.org/jira/browse/SOLR-1759
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.4
>            Reporter: Gian Marco Tagliani
>         Attachments: patch.txt
>
>
> I'm using the version 1.4.0 of Solr and I'm having some trouble with the DIH when I use the special command $skipDoc.
> After skipping a document to insert, the next one is not inserted in the proper way.
> My DIH configuration is quite complex so I'll try to explain myself with a simpler example:
> item table:
> id 	name
> 1	aaa
> 2	bbb
> feature table:
> Item_id	hidden
> 1		true
> 2 		false
> DIH conf:
> <document name="products">
> 	<entity name="item" query="select * from item">
> 		<field column="ID" name="id" />
> 		<field column="NAME" name="name" />
> 		<entity name="feature" query="select hidden from feature where item_id='${item.ID}'">
> 			<field name="$skipDoc" column="hidden" />
> 		</entity>
> 	</entity>
> </document>
> The result I expected is that the record named "bbb" would be imported, but the result of my import case is that the other record (the "aaa") has been inserted.
> I took a look to the DIH code and I found a possible problem that could cause this result. 
> In the DocBuilder class when a $skipDoc is detected, an exception is raised. After handling the exception another loop starts, without cleaning up the doc variable.
> When the next record is read, the addFieldToDoc method can't fill the doc fields because they are already filled.
> To solve this problem I just clean up the doc variable when handling the exception.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SOLR-1759) DIH $skipDoc issue

Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noble Paul resolved SOLR-1759.
------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5
         Assignee: Noble Paul

committed Revision: 906906
Thanks: Gian Marco Tagliani

> DIH $skipDoc issue
> ------------------
>
>                 Key: SOLR-1759
>                 URL: https://issues.apache.org/jira/browse/SOLR-1759
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.4
>            Reporter: Gian Marco Tagliani
>            Assignee: Noble Paul
>             Fix For: 1.5
>
>         Attachments: patch.txt
>
>
> I'm using the version 1.4.0 of Solr and I'm having some trouble with the DIH when I use the special command $skipDoc.
> After skipping a document to insert, the next one is not inserted in the proper way.
> My DIH configuration is quite complex so I'll try to explain myself with a simpler example:
> item table:
> id 	name
> 1	aaa
> 2	bbb
> feature table:
> Item_id	hidden
> 1		true
> 2 		false
> DIH conf:
> <document name="products">
> 	<entity name="item" query="select * from item">
> 		<field column="ID" name="id" />
> 		<field column="NAME" name="name" />
> 		<entity name="feature" query="select hidden from feature where item_id='${item.ID}'">
> 			<field name="$skipDoc" column="hidden" />
> 		</entity>
> 	</entity>
> </document>
> The result I expected is that the record named "bbb" would be imported, but the result of my import case is that the other record (the "aaa") has been inserted.
> I took a look to the DIH code and I found a possible problem that could cause this result. 
> In the DocBuilder class when a $skipDoc is detected, an exception is raised. After handling the exception another loop starts, without cleaning up the doc variable.
> When the next record is read, the addFieldToDoc method can't fill the doc fields because they are already filled.
> To solve this problem I just clean up the doc variable when handling the exception.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.