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 122jxgcn <yw...@gmail.com> on 2012/11/12 08:30:11 UTC

Integrating Solr with Database

Hello,

I'm currently working on file management system based on Solr.

What I have accomplished now is that I have Solr server and windows client
application that runs on different computers.
When the client indexes rich document to Solr server remotely, it also
uploads the file itself via FTP.
So that when anyone searches for the document, he/she can download the raw
file from server.

What I want to do right now is that whenever the client indexes document and
uploads the raw file,
database gets update with the pairs of (Document ID in Solr, path of the raw
file inside server).
So on search result page, instead of giving the direct link of the raw file,
I'd like to make server to look up the database based on the Document ID in
Solr and return the linked file path.

As I'm new to database, Apache, RESTful API, and stuff, 
I'm not sure how to begin implementing this feature.
Any help or starting point would be appreciated.

Thank you.



--
View this message in context: http://lucene.472066.n3.nabble.com/Integrating-Solr-with-Database-tp4019692.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Integrating Solr with Database

Posted by Gora Mohanty <go...@mimirtech.com>.
On 12 November 2012 13:54, 122jxgcn <yw...@gmail.com> wrote:
> I was thinking of using RESTful API instead of client application accessing
> database directly.
> Something like, client application opens url named http://(server
> url)/updatedb?(id of document),
> or something similar, then Java logic inside the Solr server can update
> database inside the server.
> I'm pretty sure that's called as RESTful API but I cannot find any reference
> regarding RESTful API of Solr.

There is no such Solr API.

Solr is a search engine, and as such it is unnecessary to have
such functionality built into Solr.

Regards,
Gora

Re: Integrating Solr with Database

Posted by 122jxgcn <yw...@gmail.com>.
I was thinking of using RESTful API instead of client application accessing
database directly.
Something like, client application opens url named http://(server
url)/updatedb?(id of document),
or something similar, then Java logic inside the Solr server can update
database inside the server.
I'm pretty sure that's called as RESTful API but I cannot find any reference
regarding RESTful API of Solr.

Thanks.



--
View this message in context: http://lucene.472066.n3.nabble.com/Integrating-Solr-with-Database-tp4019692p4019700.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Integrating Solr with Database

Posted by Gora Mohanty <go...@mimirtech.com>.
On 12 November 2012 13:17, 122jxgcn <yw...@gmail.com> wrote:
[...]
>> If you still want to do what you had in mind, you should handle
>> that as part of your indexing process, i.e., update both Solr and
>> the database at the same time
>
> I have thought about that, but I could not figure out how to update database
> when I'm updating Solr.
> I'm pretty sure database has to be connected with Solr somehow (first
> difficulty)
> and database has to be updated remotely with Windows Form Application
> written in C# (second difficulty)

Updating the database, and indexing to Solr are independent tasks.
Depending on how you are updating the database, it might be
easier to also index to Solr at the same time, or you could use DIH
to index to Solr from the updated database via a delta-import.

How to update the database is off-topic for this list, and if you are
using C# you would have better luck asking on a list for that. I am
sure that there must be any easy way of updating a database from
C#.

Regards,
Gora

Re: Integrating Solr with Database

Posted by 122jxgcn <yw...@gmail.com>.
> This might make sense if you were using Solr to search for the
> ID of an object in the database with relations to other objects.
> However, if all you are doing is retrieving the file path/URL, why
> not index that into Solr, and get it directly from Solr?

That's what I'm doing right now but since there are some naming and security
issues,
I'd like to integrate Solr with database eventually.

> If you still want to do what you had in mind, you should handle
> that as part of your indexing process, i.e., update both Solr and
> the database at the same time

I have thought about that, but I could not figure out how to update database
when I'm updating Solr.
I'm pretty sure database has to be connected with Solr somehow (first
difficulty)
and database has to be updated remotely with Windows Form Application
written in C# (second difficulty)

Thank you.



--
View this message in context: http://lucene.472066.n3.nabble.com/Integrating-Solr-with-Database-tp4019692p4019695.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Integrating Solr with Database

Posted by Gora Mohanty <go...@mimirtech.com>.
On 12 November 2012 13:00, 122jxgcn <yw...@gmail.com> wrote:
[...]
> What I want to do right now is that whenever the client indexes document and
> uploads the raw file,
> database gets update with the pairs of (Document ID in Solr, path of the raw
> file inside server).
> So on search result page, instead of giving the direct link of the raw file,
> I'd like to make server to look up the database based on the Document ID in
> Solr and return the linked file path.

This might make sense if you were using Solr to search for the
ID of an object in the database with relations to other objects.
However, if all you are doing is retrieving the file path/URL, why
not index that into Solr, and get it directly from Solr?

If you still want to do what you had in mind, you should handle
that as part of your indexing process, i.e., update both Solr and
the database at the same time, or update the database and index
to Solr from there.

Regards,
Gora