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 Nitin Solanki <ni...@gmail.com> on 2015/03/17 07:52:07 UTC

Want to modify Solr Source Code

Hi,
         I want to modify the solr source code. I don't have any idea where
source code is available. I want to edit source code. How can I do ?
Any help please...

RE: Select and Update after with DataImportHandler

Posted by Gabi <ga...@idieikon.com>.
Yes, that's the point Steve.

In a full-import from the UI of Solr a select defined in configuration file
data-config.xml is executed.
This select retrieves the fields indexed as defined in this config file and
schema.xml.

But what I try to do is to execute this select and update a field of one of
the tables used in the select.

I tried to change the "select" with a "merge", but Oracle can't return
values in a merge so... the select is working, if I try to do " merge into
tablename t (the select) e on ( e.ID = t.ID) when matched then
    update set t.timestamp = systimestamp it works (the update) but I don’t
get the data, if I add to this sql, returning e.* I get an error because
returning is not available in Oracle.

So I've a complex select in data-config.xml that works, I can change it with
an update that work but only the update, so I'll not retrieve any data in
the full-import.

So I've no solution at the moment on how to make the select on the database
and then update a value of one of the tables used into this select.

I've tried with UPDATE and not with MERGE but then I got another Oracle
error.

My sql knowledge is limited and I ask in this list searching perhaps for
another kind of solution or idea perhaps into solr config, options etc...


Regards.

-----Mensaje original-----
De: steve [mailto:sc_shepard@hotmail.com] 
Enviado el: martes, 17 de marzo de 2015 10:02
Para: solr-user@lucene.apache.org
Asunto: RE: Select and Update after with DataImportHandler

Hi, maybe I'm missing the point here, but there could be a separate
table/database that has a record inserted after the full import is
completed; this could be part of the same "batch" or script file, or one
that is "chained" after the original query completes.

> From: gabi@idieikon.com
> To: solr-user@lucene.apache.org
> Subject: Select and Update after with DataImportHandler
> Date: Tue, 17 Mar 2015 09:47:25 +0100
> 
> Hello, we have a sql to retrieve fields from DB and they are indexed in a
full-import defined in a data-config.xml.
> 
> It works as expected but now we want to update the database fields so we
know when data was imported.
> So we add to the table being indexed a timestamp. Now we have table1
field1 field2... and fieldN (the timestamp).
> 
> Is there any way to indicate "after you finish the select of the
full-import, now you have to do this sql update of the timestamp in the
database table"?
> 
> We use Solr 4.6.0
> 
> 
> We've tried in the same sql, with cursors or transactions, etc, but the
sql select is pretty complex and we can't make it work in such way, but
perhaps the only way to do it is to substitute the select with some kind of
transaction but we don’t know if this is possible to do in the query for the
full-import.
> 
> Regards.
> 
> 
> ---
> El software de antivirus Avast ha analizado este correo electrónico en
busca de virus.
> http://www.avast.com
> 
> 
 		 	   		  


---
El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
http://www.avast.com



RE: Select and Update after with DataImportHandler

Posted by steve <sc...@hotmail.com>.
Hi, maybe I'm missing the point here, but there could be a separate table/database that has a record inserted after the full import is completed; this could be part of the same "batch" or script file, or one that is "chained" after the original query completes.

> From: gabi@idieikon.com
> To: solr-user@lucene.apache.org
> Subject: Select and Update after with DataImportHandler
> Date: Tue, 17 Mar 2015 09:47:25 +0100
> 
> Hello, we have a sql to retrieve fields from DB and they are indexed in a full-import defined in a data-config.xml.
> 
> It works as expected but now we want to update the database fields so we know when data was imported.
> So we add to the table being indexed a timestamp. Now we have table1 field1 field2... and fieldN (the timestamp).
> 
> Is there any way to indicate "after you finish the select of the full-import, now you have to do this sql update of the timestamp in the database table"?
> 
> We use Solr 4.6.0
> 
> 
> We've tried in the same sql, with cursors or transactions, etc, but the sql select is pretty complex and we can't make it work in such way, but perhaps the only way to do it is to substitute the select with some kind of transaction but we don’t know if this is possible to do in the query for the full-import.
> 
> Regards.
> 
> 
> ---
> El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
> http://www.avast.com
> 
> 
 		 	   		  

Select and Update after with DataImportHandler

Posted by Gabi <ga...@idieikon.com>.
Hello, we have a sql to retrieve fields from DB and they are indexed in a full-import defined in a data-config.xml.

It works as expected but now we want to update the database fields so we know when data was imported.
So we add to the table being indexed a timestamp. Now we have table1 field1 field2... and fieldN (the timestamp).

Is there any way to indicate "after you finish the select of the full-import, now you have to do this sql update of the timestamp in the database table"?

We use Solr 4.6.0


We've tried in the same sql, with cursors or transactions, etc, but the sql select is pretty complex and we can't make it work in such way, but perhaps the only way to do it is to substitute the select with some kind of transaction but we don’t know if this is possible to do in the query for the full-import.

Regards.


---
El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
http://www.avast.com



Re: Want to modify Solr Source Code

Posted by Andrea Gazzarini <a....@gmail.com>.
Hi,
if you followed what is written in the link that Gora suggested, you 
should have a workspace without errors.
Eclipse compiler allows for incremental builds, that is, all code is 
incrementally compiled as soon as you finish typing.

So if you inserted those lines and you don't see any error then that 
means they have been successfully compiled.

Best,
Andrea

On 03/17/2015 01:52 PM, Nitin Solanki wrote:
> Hi all,
>             I have configured solr source code with eclipse. Now, I have
> written a print statement in between the SolrSpellChecker.java. Now, I want
> to compile this file. How to do that ?
> Any help please...
>
> On Tue, Mar 17, 2015 at 2:27 PM, Gora Mohanty <go...@mimirtech.com> wrote:
>
>> On 17 March 2015 at 13:38, Nitin Solanki <ni...@gmail.com> wrote:
>>> Hi Gora,
>>>               Thanks again. Do you have any link/ article of Wiki article?
>>> Please send me.
>> Sent the link in my very first follow-up:
>>
>> http://wiki.apache.org/solr/HowToContribute#Contributing_Code_.28Features.2C_Bug_Fixes.2C_Tests.2C_etc....29
>>
>> Regards,
>> Gora
>>


Re: Want to modify Solr Source Code

Posted by Nitin Solanki <ni...@gmail.com>.
Hi all,
           How to set breakpoints throughout the Solr code, step through
code ?

On Tue, Mar 17, 2015 at 6:22 PM, Nitin Solanki <ni...@gmail.com> wrote:

> Hi all,
>            I have configured solr source code with eclipse. Now, I have
> written a print statement in between the SolrSpellChecker.java. Now, I want
> to compile this file. How to do that ?
> Any help please...
>
> On Tue, Mar 17, 2015 at 2:27 PM, Gora Mohanty <go...@mimirtech.com> wrote:
>
>> On 17 March 2015 at 13:38, Nitin Solanki <ni...@gmail.com> wrote:
>> > Hi Gora,
>> >              Thanks again. Do you have any link/ article of Wiki
>> article?
>> > Please send me.
>>
>> Sent the link in my very first follow-up:
>>
>> http://wiki.apache.org/solr/HowToContribute#Contributing_Code_.28Features.2C_Bug_Fixes.2C_Tests.2C_etc....29
>>
>> Regards,
>> Gora
>>
>
>

Re: Want to modify Solr Source Code

Posted by Nitin Solanki <ni...@gmail.com>.
Hi all,
           I have configured solr source code with eclipse. Now, I have
written a print statement in between the SolrSpellChecker.java. Now, I want
to compile this file. How to do that ?
Any help please...

On Tue, Mar 17, 2015 at 2:27 PM, Gora Mohanty <go...@mimirtech.com> wrote:

> On 17 March 2015 at 13:38, Nitin Solanki <ni...@gmail.com> wrote:
> > Hi Gora,
> >              Thanks again. Do you have any link/ article of Wiki article?
> > Please send me.
>
> Sent the link in my very first follow-up:
>
> http://wiki.apache.org/solr/HowToContribute#Contributing_Code_.28Features.2C_Bug_Fixes.2C_Tests.2C_etc....29
>
> Regards,
> Gora
>

Re: Want to modify Solr Source Code

Posted by Gora Mohanty <go...@mimirtech.com>.
On 17 March 2015 at 13:38, Nitin Solanki <ni...@gmail.com> wrote:
> Hi Gora,
>              Thanks again. Do you have any link/ article of Wiki article?
> Please send me.

Sent the link in my very first follow-up:
http://wiki.apache.org/solr/HowToContribute#Contributing_Code_.28Features.2C_Bug_Fixes.2C_Tests.2C_etc....29

Regards,
Gora

Re: Want to modify Solr Source Code

Posted by Nitin Solanki <ni...@gmail.com>.
Hi Gora,
             Thanks again. Do you have any link/ article of Wiki article?
Please send me.

On Tue, Mar 17, 2015 at 1:30 PM, Gora Mohanty <go...@mimirtech.com> wrote:

> On 17 March 2015 at 13:21, Nitin Solanki <ni...@gmail.com> wrote:
>
> > I have already downloaded
> > http://archive.apache.org/dist/lucene/solr/4.10.2/solr-4.10.2.tgz. Now,
> > How
> > to view or edit the source code of any file? I don't have any idea about
> > it.. Your help is appreciated..
> > Please guide my step by step..
> > Thanks again..
> >
>
> You need to learn the basics of putting together a development setup
> yourself, or from a local mentor. A .tgz is a gzip-compressed tar file that
> can be unarchived with tar, or most unarchivers. You are probably best off
> to use a Java IDE, such as Eclipse, to edit the source code. The Wiki
> article covers how to compile the code, and run the built-in tests.
>
> Regards,
> Gora
>

Re: Want to modify Solr Source Code

Posted by Gora Mohanty <go...@mimirtech.com>.
On 17 March 2015 at 13:21, Nitin Solanki <ni...@gmail.com> wrote:

> I have already downloaded
> http://archive.apache.org/dist/lucene/solr/4.10.2/solr-4.10.2.tgz. Now,
> How
> to view or edit the source code of any file? I don't have any idea about
> it.. Your help is appreciated..
> Please guide my step by step..
> Thanks again..
>

You need to learn the basics of putting together a development setup
yourself, or from a local mentor. A .tgz is a gzip-compressed tar file that
can be unarchived with tar, or most unarchivers. You are probably best off
to use a Java IDE, such as Eclipse, to edit the source code. The Wiki
article covers how to compile the code, and run the built-in tests.

Regards,
Gora

Re: Want to modify Solr Source Code

Posted by Nitin Solanki <ni...@gmail.com>.
I have already downloaded
http://archive.apache.org/dist/lucene/solr/4.10.2/solr-4.10.2.tgz. Now, How
to view or edit the source code of any file? I don't have any idea about
it.. Your help is appreciated..
Please guide my step by step..
Thanks again..


On Tue, Mar 17, 2015 at 1:16 PM, Gora Mohanty <go...@mimirtech.com> wrote:

> On 17 March 2015 at 13:12, Nitin Solanki <ni...@gmail.com> wrote:
> > Hi Gora,
> >                Hi, I want to make changes only into my machine without
> svn.
> > I want to do test on source code. How ? Any steps to do so ? Please
> help..
>
> You could still use SVN for a local repository. Else, you can download
> a tar.gz of a Solr distribution from under the Download link at the
> top right of http://lucene.apache.org/solr/
>
> Regards,
> Gora
>

Re: Want to modify Solr Source Code

Posted by Gora Mohanty <go...@mimirtech.com>.
On 17 March 2015 at 13:12, Nitin Solanki <ni...@gmail.com> wrote:
> Hi Gora,
>                Hi, I want to make changes only into my machine without svn.
> I want to do test on source code. How ? Any steps to do so ? Please help..

You could still use SVN for a local repository. Else, you can download
a tar.gz of a Solr distribution from under the Download link at the
top right of http://lucene.apache.org/solr/

Regards,
Gora

Re: Want to modify Solr Source Code

Posted by Nitin Solanki <ni...@gmail.com>.
Hi Anshum,
                  The reason behind to edit source code is that I am using
spell check component on solr. I have implemented it and it is working
fine..
But something suggestion frequency goes vary. I have explain that it into
this -
http://stackoverflow.com/questions/28857915/original-frequency-is-not-matching-with-suggestion-frequency-in-solr.
Please check it..
And now, I am thinking that if I will able to add hitcount instead of freq
in suggestion then I will be helpful for my purpose.

On Tue, Mar 17, 2015 at 1:23 PM, Anshum Gupta <an...@anshumgupta.net>
wrote:

> Hi Nitin,
>
> Do you intend to browse the code? If you really want to modify the code,
> can you tell us about what exactly is it that you're trying to achieve?
> Can you clarify on how you want to test Solr? If so, do you plan on running
> the tests that Solr ships with or do you have your own tests?
>
>
> All said and done, if you don't want to use svn but still want to download
> the Solr source, you can download the same (for Solr 5.0.0) from any of the
> mirrors listed here:
>
> http://www.apache.org/dyn/closer.cgi/lucene/solr/5.0.0
>
>
>
> On Tue, Mar 17, 2015 at 12:42 AM, Nitin Solanki <ni...@gmail.com>
> wrote:
>
> > Hi Gora,
> >                Hi, I want to make changes only into my machine without
> svn.
> > I want to do test on source code. How ? Any steps to do so ? Please
> help..
> >
> > On Tue, Mar 17, 2015 at 1:01 PM, Gora Mohanty <go...@mimirtech.com>
> wrote:
> >
> > > On 17 March 2015 at 12:22, Nitin Solanki <ni...@gmail.com> wrote:
> > > >
> > > > Hi,
> > > >          I want to modify the solr source code. I don't have any idea
> > > where
> > > > source code is available. I want to edit source code. How can I do ?
> > > > Any help please...
> > >
> > > Please start with:
> > >
> > >
> >
> http://wiki.apache.org/solr/HowToContribute#Contributing_Code_.28Features.2C_Bug_Fixes.2C_Tests.2C_etc....29
> > >
> > > Regards,
> > > Gora
> > >
> >
>
>
>
> --
> Anshum Gupta
>

Re: Want to modify Solr Source Code

Posted by Anshum Gupta <an...@anshumgupta.net>.
Hi Nitin,

Do you intend to browse the code? If you really want to modify the code,
can you tell us about what exactly is it that you're trying to achieve?
Can you clarify on how you want to test Solr? If so, do you plan on running
the tests that Solr ships with or do you have your own tests?


All said and done, if you don't want to use svn but still want to download
the Solr source, you can download the same (for Solr 5.0.0) from any of the
mirrors listed here:

http://www.apache.org/dyn/closer.cgi/lucene/solr/5.0.0



On Tue, Mar 17, 2015 at 12:42 AM, Nitin Solanki <ni...@gmail.com>
wrote:

> Hi Gora,
>                Hi, I want to make changes only into my machine without svn.
> I want to do test on source code. How ? Any steps to do so ? Please help..
>
> On Tue, Mar 17, 2015 at 1:01 PM, Gora Mohanty <go...@mimirtech.com> wrote:
>
> > On 17 March 2015 at 12:22, Nitin Solanki <ni...@gmail.com> wrote:
> > >
> > > Hi,
> > >          I want to modify the solr source code. I don't have any idea
> > where
> > > source code is available. I want to edit source code. How can I do ?
> > > Any help please...
> >
> > Please start with:
> >
> >
> http://wiki.apache.org/solr/HowToContribute#Contributing_Code_.28Features.2C_Bug_Fixes.2C_Tests.2C_etc....29
> >
> > Regards,
> > Gora
> >
>



-- 
Anshum Gupta

Re: Want to modify Solr Source Code

Posted by Nitin Solanki <ni...@gmail.com>.
Hi Ramkumar,
                     Sorry but svn will create cumbersome for me and I
don't want to use it right now. I want to do anything on local machine
without using svn.
As you said to download -src.tgz. I have download solr-4.10.2-src.tar.gz.
Now able to see source code. Now how to configure it and compile any file,
if I will change?
Any help please..

On Tue, Mar 17, 2015 at 1:21 PM, Ramkumar R. Aiyengar <
andyetitmoves@gmail.com> wrote:

> Is your concern that you want to be able to modify source code just on your
> machine or that  you can't for some reason install svn?
>
> If it's the former, even if you checkout using svn, you can't modify
> anything outside the machine as changes can be checked in only by the
> committers of the project. You will need to raise a JIRA for the changes to
> go back in as described by the wiki page.
>
> If the latter, try downloading the source code using the downloads section
> in https://lucene.apache.org/solr and choose the download which ends as
> -src.tgz, that has the source bundled as a single file.
> On 17 Mar 2015 07:42, "Nitin Solanki" <ni...@gmail.com> wrote:
>
> > Hi Gora,
> >                Hi, I want to make changes only into my machine without
> svn.
> > I want to do test on source code. How ? Any steps to do so ? Please
> help..
> >
> > On Tue, Mar 17, 2015 at 1:01 PM, Gora Mohanty <go...@mimirtech.com>
> wrote:
> >
> > > On 17 March 2015 at 12:22, Nitin Solanki <ni...@gmail.com> wrote:
> > > >
> > > > Hi,
> > > >          I want to modify the solr source code. I don't have any idea
> > > where
> > > > source code is available. I want to edit source code. How can I do ?
> > > > Any help please...
> > >
> > > Please start with:
> > >
> > >
> >
> http://wiki.apache.org/solr/HowToContribute#Contributing_Code_.28Features.2C_Bug_Fixes.2C_Tests.2C_etc....29
> > >
> > > Regards,
> > > Gora
> > >
> >
>

Re: Want to modify Solr Source Code

Posted by "Ramkumar R. Aiyengar" <an...@gmail.com>.
Is your concern that you want to be able to modify source code just on your
machine or that  you can't for some reason install svn?

If it's the former, even if you checkout using svn, you can't modify
anything outside the machine as changes can be checked in only by the
committers of the project. You will need to raise a JIRA for the changes to
go back in as described by the wiki page.

If the latter, try downloading the source code using the downloads section
in https://lucene.apache.org/solr and choose the download which ends as
-src.tgz, that has the source bundled as a single file.
On 17 Mar 2015 07:42, "Nitin Solanki" <ni...@gmail.com> wrote:

> Hi Gora,
>                Hi, I want to make changes only into my machine without svn.
> I want to do test on source code. How ? Any steps to do so ? Please help..
>
> On Tue, Mar 17, 2015 at 1:01 PM, Gora Mohanty <go...@mimirtech.com> wrote:
>
> > On 17 March 2015 at 12:22, Nitin Solanki <ni...@gmail.com> wrote:
> > >
> > > Hi,
> > >          I want to modify the solr source code. I don't have any idea
> > where
> > > source code is available. I want to edit source code. How can I do ?
> > > Any help please...
> >
> > Please start with:
> >
> >
> http://wiki.apache.org/solr/HowToContribute#Contributing_Code_.28Features.2C_Bug_Fixes.2C_Tests.2C_etc....29
> >
> > Regards,
> > Gora
> >
>

Re: Want to modify Solr Source Code

Posted by Nitin Solanki <ni...@gmail.com>.
Hi Gora,
               Hi, I want to make changes only into my machine without svn.
I want to do test on source code. How ? Any steps to do so ? Please help..

On Tue, Mar 17, 2015 at 1:01 PM, Gora Mohanty <go...@mimirtech.com> wrote:

> On 17 March 2015 at 12:22, Nitin Solanki <ni...@gmail.com> wrote:
> >
> > Hi,
> >          I want to modify the solr source code. I don't have any idea
> where
> > source code is available. I want to edit source code. How can I do ?
> > Any help please...
>
> Please start with:
>
> http://wiki.apache.org/solr/HowToContribute#Contributing_Code_.28Features.2C_Bug_Fixes.2C_Tests.2C_etc....29
>
> Regards,
> Gora
>

Re: Want to modify Solr Source Code

Posted by Gora Mohanty <go...@mimirtech.com>.
On 17 March 2015 at 12:22, Nitin Solanki <ni...@gmail.com> wrote:
>
> Hi,
>          I want to modify the solr source code. I don't have any idea where
> source code is available. I want to edit source code. How can I do ?
> Any help please...

Please start with:
http://wiki.apache.org/solr/HowToContribute#Contributing_Code_.28Features.2C_Bug_Fixes.2C_Tests.2C_etc....29

Regards,
Gora