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 Rui Pereira <ru...@gmail.com> on 2009/02/20 13:14:27 UTC

Add jdbc entity to DataImportHandler in runtime

Hello all!
I'm trying to add jdbc entities to Solr in runtime. I can update
data-config.xml and reload the file using the reload-config command, but I
wanted to make the first index on the new entities (not full-index), that
is, add to index the data given by the query in the new entities.
How can I manage to do this?

Thanks in advance.

Re: Add jdbc entity to DataImportHandler in runtime

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Mar 6, 2009 at 11:12 PM, Rui Pereira <ru...@gmail.com>wrote:

> Hi again,Isn't 'preImportDeleteQuery' a Solr 1.4 feature? I'm unable to
> import only the entities I want, all the index is deleted.
>
> In all entities I have a field that is unique by entity ('alias') and I
> configured the preImportQuery in all entities like this: alias: '<entity
> name>'.
>

Right, I forgot to mention. preImportQuery and postImporQuery are 1.4
(trunk) features.

-- 
Regards,
Shalin Shekhar Mangar.

Re: Add jdbc entity to DataImportHandler in runtime

Posted by Rui Pereira <ru...@gmail.com>.
Hi again,Isn't 'preImportDeleteQuery' a Solr 1.4 feature? I'm unable to
import only the entities I want, all the index is deleted.

In all entities I have a field that is unique by entity ('alias') and I
configured the preImportQuery in all entities like this: alias: '<entity
name>'.

Thanks in advanced,
   Rui Pereira

On Fri, Feb 20, 2009 at 3:39 PM, Shalin Shekhar Mangar <
shalinmangar@gmail.com> wrote:

> On Fri, Feb 20, 2009 at 8:01 PM, Rui Pereira <ruipereira910@gmail.com
> >wrote:
>
> > Only one more question: doesn't full-import deletes all records before
> > execution, or in this case only deletes the entities passed in the url?
> >
>
> If no 'entity' parameter is specified, a full-import deletes all existing
> documents. But if a 'entity' is specified then the deleteQuery is not
> executed. There's no way for DataImportHandler to figure out which
> documents
> were generated by which entity.
>
> You can use the 'preImportDeleteQuery' attribute on an entity to specify a
> delete query which can delete the documents created by that entity.
>
>
> http://wiki.apache.org/solr/DataImportHandler#head-70d3fdda52de9ee4fdb54e1c6f84199f0e1caa76
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: Add jdbc entity to DataImportHandler in runtime

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Feb 20, 2009 at 8:01 PM, Rui Pereira <ru...@gmail.com>wrote:

> Only one more question: doesn't full-import deletes all records before
> execution, or in this case only deletes the entities passed in the url?
>

If no 'entity' parameter is specified, a full-import deletes all existing
documents. But if a 'entity' is specified then the deleteQuery is not
executed. There's no way for DataImportHandler to figure out which documents
were generated by which entity.

You can use the 'preImportDeleteQuery' attribute on an entity to specify a
delete query which can delete the documents created by that entity.

http://wiki.apache.org/solr/DataImportHandler#head-70d3fdda52de9ee4fdb54e1c6f84199f0e1caa76

-- 
Regards,
Shalin Shekhar Mangar.

Re: Add jdbc entity to DataImportHandler in runtime

Posted by Rui Pereira <ru...@gmail.com>.
Only one more question: doesn't full-import deletes all records before
execution, or in this case only deletes the entities passed in the url?

Thanks in advance,
    Rui Pereira


On Fri, Feb 20, 2009 at 1:07 PM, Shalin Shekhar Mangar <
shalinmangar@gmail.com> wrote:

> On Fri, Feb 20, 2009 at 5:44 PM, Rui Pereira <ruipereira910@gmail.com
> >wrote:
>
> > Hello all!
> > I'm trying to add jdbc entities to Solr in runtime. I can update
> > data-config.xml and reload the file using the reload-config command, but
> I
> > wanted to make the first index on the new entities (not full-index), that
> > is, add to index the data given by the query in the new entities.
> > How can I manage to do this?
> >
>
> You can use 'entity=<changed_entity_1>&entity=<changed_entity_2>' when
> calling full-import to import only the specified entities.
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: Add jdbc entity to DataImportHandler in runtime

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Feb 20, 2009 at 5:44 PM, Rui Pereira <ru...@gmail.com>wrote:

> Hello all!
> I'm trying to add jdbc entities to Solr in runtime. I can update
> data-config.xml and reload the file using the reload-config command, but I
> wanted to make the first index on the new entities (not full-index), that
> is, add to index the data given by the query in the new entities.
> How can I manage to do this?
>

You can use 'entity=<changed_entity_1>&entity=<changed_entity_2>' when
calling full-import to import only the specified entities.

-- 
Regards,
Shalin Shekhar Mangar.