You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Eugeny N Dzhurinsky <eu...@jdevelop.com> on 2005/09/29 14:34:19 UTC

Lucene vs SQL database

Is there any way to use the contents of the SQL database as source for Lucene
search engine? Is there any example applications or workarounds to do that?

-- 
Eugene N Dzhurinsky

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Lucene vs SQL database

Posted by Eugeny N Dzhurinsky <eu...@jdevelop.com>.
On Thu, Sep 29, 2005 at 09:29:56AM -0400, Mag Gam wrote:
> Check this link out....I am trying to do the same
> 
> http://marc.theaimsgroup.com/?l=lucene-user&m=100556272928584&w=2
> I am using Apache Derby and trying to integrate that with lucene....
> Its tough to find a very very simple example for this online.
> goodluck

Nice, thanks!

-- 
Eugene N Dzhurinsky

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Lucene vs SQL database

Posted by Mag Gam <ma...@gmail.com>.
Check this link out....I am trying to do the same

http://marc.theaimsgroup.com/?l=lucene-user&m=100556272928584&w=2

I am using Apache Derby and trying to integrate that with lucene....

Its tough to find a very very simple example for this online.


goodluck


On 9/29/05, Erik Hatcher <er...@ehatchersolutions.com> wrote:
>
>
> On Sep 29, 2005, at 8:46 AM, Eugeny N Dzhurinsky wrote:
> > On Thu, Sep 29, 2005 at 08:39:53AM -0400, George Abraham wrote:
> >
> >> Eugene,
> >> You could grab all the fields for a record in a SQL database, mash
> >> it all
> >> together and transfer it into one indexing field in Lucene. Use some
> >> scripting tools (or even JDBC and Java) to do this. However if you
> >> are
> >> asking if Lucene can go and look over a SQL database and return
> >> results,
> >> that would not work. Lucene has to index the database fields
> >> first. The
> >> indexing would happen with the first two sentences of my post.
> >>
> >
> > Integersting. We have some kind of set of privileges, required to
> > access the
> > object (let's say rows in table(s)), I thought if it is possible to
> > use
> > kind of "injection" of access control statement to SQL query for
> > extraction
> > of only allowed data... But if Lucene needs to index anything, how
> > could I
> > define the access privileges for data?
>
> There are many options available. One such technique I described in
> "Lucene in Action" ... a SecurityFilter. This simple example scheme
> assumes each document has an "owner" and only owners are allowed to
> see their documents and no others. By applying a SecurityFilter on a
> search, the results are constrained appropriately. This scheme is
> intentionally simplistic to show the possibilities. More commonly
> would be a situation with users and groups that need to be
> dynamically configurable - a Filter could still do this sort of
> thing, but how documents are associated with groups would need to be
> thoroughly conceived.
>
> Erik
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Lucene vs SQL database

Posted by Eugeny N Dzhurinsky <eu...@jdevelop.com>.
On Fri, Sep 30, 2005 at 12:22:53PM -0400, Erik Hatcher wrote:
> 
> That is exactly correct.  The source code to the SecurityFilter is  
> found in the .zip file you can download from http:// 
> www.lucenebook.com - and it wouldn't hurt our feelings one bit if you  
> bought the book too :)

Nice, I will get the book next week from Amazon. Thanks for your help!

-- 
Eugene N Dzhurinsky

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Lucene vs SQL database

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Sep 30, 2005, at 5:45 AM, Eugeny N Dzhurinsky wrote:

> On Thu, Sep 29, 2005 at 08:56:50AM -0400, Erik Hatcher wrote:
>
>>> of only allowed data... But if Lucene needs to index anything,  
>>> how  >
>>>
>> could I > >define the access privileges for data?
>>
>
>
>> There are many options available.  One such technique I described in
>> "Lucene in Action" ... a SecurityFilter.
>>
>
> This SecurityFilter is implementation of the Filter, right?
> As I found, the Filter defineds the bits() method, and I should  
> implement some
> capacities to return set of bits, where first bit means first found  
> document,
> and if it is set to 1 - document will be shown, otherwise if 0 - it  
> will not
> be shown, right?

That is exactly correct.  The source code to the SecurityFilter is  
found in the .zip file you can download from http:// 
www.lucenebook.com - and it wouldn't hurt our feelings one bit if you  
bought the book too :)

     Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Lucene vs SQL database

Posted by mark harwood <ma...@yahoo.co.uk>.
See the code here for an example:

http://issues.apache.org/jira/browse/LUCENE-434

This demonstrates:
* embedding and running Lucene queries directly in
Derby or HSQLDB databases 
* alternatively, using an RDBMS-provided result set
(from potentially any database) to filter an
externally run Lucene query. This, I think, is what
you are more probably interested in for your security
filter. Take a look at the
HsqlDbLuceneQuery.doRDBMSFilteredQuery() method.

Cheers,
Mark



		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Lucene vs SQL database

Posted by Eugeny N Dzhurinsky <eu...@jdevelop.com>.
On Thu, Sep 29, 2005 at 08:56:50AM -0400, Erik Hatcher wrote:
> >of only allowed data... But if Lucene needs to index anything, how  >
>could I > >define the access privileges for data?

> There are many options available.  One such technique I described in  
> "Lucene in Action" ... a SecurityFilter.  

This SecurityFilter is implementation of the Filter, right?
As I found, the Filter defineds the bits() method, and I should implement some
capacities to return set of bits, where first bit means first found document,
and if it is set to 1 - document will be shown, otherwise if 0 - it will not
be shown, right?

-- 
Eugene N Dzhurinsky

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Lucene vs SQL database

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Sep 29, 2005, at 8:46 AM, Eugeny N Dzhurinsky wrote:
> On Thu, Sep 29, 2005 at 08:39:53AM -0400, George Abraham wrote:
>
>> Eugene,
>> You could grab all the fields for a record in a SQL database, mash  
>> it all
>> together and transfer it into one indexing field in Lucene. Use some
>> scripting tools (or even JDBC and Java) to do this. However if you  
>> are
>> asking if Lucene can go and look over a SQL database and return  
>> results,
>> that would not work. Lucene has to index the database fields  
>> first. The
>> indexing would happen with the first two sentences of my post.
>>
>
> Integersting. We have some kind of set of privileges, required to  
> access the
> object (let's say rows in table(s)), I thought if it is possible to  
> use
> kind of "injection" of access control statement to SQL query for  
> extraction
> of only allowed data... But if Lucene needs to index anything, how  
> could I
> define the access privileges for data?

There are many options available.  One such technique I described in  
"Lucene in Action" ... a SecurityFilter.  This simple example scheme  
assumes each document has an "owner" and only owners are allowed to  
see their documents and no others.  By applying a SecurityFilter on a  
search, the results are constrained appropriately.  This scheme is  
intentionally simplistic to show the possibilities.  More commonly  
would be a situation with users and groups that need to be  
dynamically configurable - a Filter could still do this sort of  
thing, but how documents are associated with groups would need to be  
thoroughly conceived.

     Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Lucene vs SQL database

Posted by Eugeny N Dzhurinsky <eu...@jdevelop.com>.
On Thu, Sep 29, 2005 at 08:39:53AM -0400, George Abraham wrote:
> Eugene,
> You could grab all the fields for a record in a SQL database, mash it all
> together and transfer it into one indexing field in Lucene. Use some
> scripting tools (or even JDBC and Java) to do this. However if you are
> asking if Lucene can go and look over a SQL database and return results,
> that would not work. Lucene has to index the database fields first. The
> indexing would happen with the first two sentences of my post.

Integersting. We have some kind of set of privileges, required to access the
object (let's say rows in table(s)), I thought if it is possible to use 
kind of "injection" of access control statement to SQL query for extraction
of only allowed data... But if Lucene needs to index anything, how could I 
define the access privileges for data?

-- 
Eugene N Dzhurinsky

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Lucene vs SQL database

Posted by Nader Henein <ns...@bayt.net>.
You can use something like hibernate to load the database tables into 
java objects and then load them into Lucene Documents, fast and dirty 
will take you a few hours to code, but if you're going the distance a 
couple of days should do the trick.

Nader Henein

George Abraham wrote:

>Eugene,
>You could grab all the fields for a record in a SQL database, mash it all
>together and transfer it into one indexing field in Lucene. Use some
>scripting tools (or even JDBC and Java) to do this. However if you are
>asking if Lucene can go and look over a SQL database and return results,
>that would not work. Lucene has to index the database fields first. The
>indexing would happen with the first two sentences of my post.
>
>HTH,
>George
>
>On 9/29/05, Eugeny N Dzhurinsky <eu...@jdevelop.com> wrote:
>  
>
>>Is there any way to use the contents of the SQL database as source for
>>Lucene
>>search engine? Is there any example applications or workarounds to do
>>that?
>>
>>--
>>Eugene N Dzhurinsky
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>>    
>>
>
>  
>

-- 
Nader S. Henein
Senior Applications Architect
Bayt Technologies

*****************************
Bayt.com
Dubai Internet City
Building 2, Office 314
P.O. Box 500245
Tel.  +971 4  3911900
Dir.  +971 4  3613675
Cell. +971 50 5659557


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Lucene vs SQL database

Posted by George Abraham <ge...@gmail.com>.
Eugene,
You could grab all the fields for a record in a SQL database, mash it all
together and transfer it into one indexing field in Lucene. Use some
scripting tools (or even JDBC and Java) to do this. However if you are
asking if Lucene can go and look over a SQL database and return results,
that would not work. Lucene has to index the database fields first. The
indexing would happen with the first two sentences of my post.

HTH,
George

On 9/29/05, Eugeny N Dzhurinsky <eu...@jdevelop.com> wrote:
>
> Is there any way to use the contents of the SQL database as source for
> Lucene
> search engine? Is there any example applications or workarounds to do
> that?
>
> --
> Eugene N Dzhurinsky
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Lucene vs SQL database

Posted by Chris Lu <ch...@gmail.com>.
We have a product, DBSight, just to extract database content and
render search results.
Many features can be found on the website.

Chris
------------------------
Lucene RAD on Any Databases
http://www.dbsight.net

On 9/29/05, Eugeny N Dzhurinsky <eu...@jdevelop.com> wrote:
> Is there any way to use the contents of the SQL database as source for Lucene
> search engine? Is there any example applications or workarounds to do that?
>
> --
> Eugene N Dzhurinsky
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org