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 "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org> on 2008/12/30 11:38:44 UTC

[jira] Commented: (SOLR-946) DataImportHandler issue with SQL query using GROUP BY keyword

    [ https://issues.apache.org/jira/browse/SOLR-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659790#action_12659790 ] 

Shalin Shekhar Mangar commented on SOLR-946:
--------------------------------------------

Try using the deltaImportQuery. From the wiki document:

deltaImportQuery : (Only used in delta-import). If this is not present , DIH tries to construct the import query by(after identifying the delta) modifying the 'query' (this is error prone). There is a namespace ${dataimporter.delta.<column-name>} which can be used in this query. e.g: select * from tbl where id=${dataimporter.delta.id}

Note -- This is a Solr 1.4 feature so you must use a nightly build.

> DataImportHandler issue with SQL query using GROUP BY keyword
> -------------------------------------------------------------
>
>                 Key: SOLR-946
>                 URL: https://issues.apache.org/jira/browse/SOLR-946
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.3
>            Reporter: secmask
>
> hi, i'm using DataImportHandler to import my data from database to solr index. in db-data-import.xml i have i query like this:
> <document name="products">
>         <entity name="product" pk="products.id" Query="SELECT products.id products.name, features.props FROM products JOIN features ON products.id=features.product_id GROUP BY features.product_id"   deltaQuery="SELECT products.id from products where products.lastMod>'${dataimport.last_modify}'">          
>             <field name="id" column="id" />
>             <field name="name" column="name" boost="4.0" />
>         </entity>
>   </document>
> don't be attend at the database structs, problem is when i use delta-import, the sql query to mysql by solr will look like "$Query" + "WHERE pk={ id return by deltaQuery }" , this will cause sql query syntax error because WHERE keyword must be appear in front of GROUP BY keyword. i don't know how to solr this problem. please help me.
> thanks.

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