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 Hetan Shah <He...@Sun.COM> on 2004/07/15 02:26:43 UTC

Searching against Database

Hello All,

I have got all the answers from this fantastic mailing list. I have 
another question ;)

What is the best way (Best Practices) to integrate Lucene with live 
database, Oracle to be more specific. Any pointers are really very much 
appreciated.

thanks guys.
-H


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


Re: Searching against Database

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
In this situation, you may want to investigate implementing a custom  
Filter which is user-specific and constrains the search space to only  
the rows a specific user is allowed to search.

	Erik

On Jul 15, 2004, at 3:04 AM, Sergiu Gordea wrote:

>
> Hi again,
>
> I'm thinking to get the list of IDs from the database and the list of  
> hits from Lucene Index and to create a comparator in order to  
> eliminate the
> not permitted  Hits from the list.
>
> Which solution do you think is better?
>
> Thanks,
>
> Sergiu
>
>
>
> Sergiu Gordea wrote:
>
>> Hi,
>>
>> I have a simillar problem. I'm working on a web application in which  
>> the users have different permissions.
>> Not all information stored in the index is public for all users.
>>
>> The documents in Index are identified by the same  ID that the  rows  
>> have in database tables.
>>
>> I can get the  IDs of the documents that can be accesible by the  
>> user, but if this are 1000, what will happen in Lucene?
>>
>> Is this a valid solution? Can anyone provide a better idea?
>>
>> Thanks,
>>
>> Sergiu
>>
>>
>> lingaraju wrote:
>>
>>> Hello
>>>
>>> Even i am searching the same code as all my web display information  
>>> is
>>> stored  in database.
>>> Early response will be very much helpful
>>>
>>> Thanks and regards
>>> Raju
>>>
>>> ----- Original Message ----- From: "Hetan Shah" <He...@Sun.COM>
>>> To: "Lucene Users List" <lu...@jakarta.apache.org>
>>> Sent: Thursday, July 15, 2004 5:56 AM
>>> Subject: Searching against Database
>>>
>>>
>>>
>>>> Hello All,
>>>>
>>>> I have got all the answers from this fantastic mailing list. I have
>>>> another question ;)
>>>>
>>>> What is the best way (Best Practices) to integrate Lucene with live
>>>> database, Oracle to be more specific. Any pointers are really very  
>>>> much
>>>> appreciated.
>>>>
>>>> thanks guys.
>>>> -H
>>>>
>>>>
>>>> -------------------------------------------------------------------- 
>>>> -
>>>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org


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


Re: Searching against Database

Posted by Sergiu Gordea <gs...@ifit.uni-klu.ac.at>.
Hi again,

 I'm thinking to get the list of IDs from the database and the list of 
hits from Lucene Index and to create a comparator in order to eliminate the
not permitted  Hits from the list.

 Which solution do you think is better?

 Thanks,

 Sergiu



Sergiu Gordea wrote:

> Hi,
>
> I have a simillar problem. I'm working on a web application in which 
> the users have different permissions.
> Not all information stored in the index is public for all users.
>
> The documents in Index are identified by the same  ID that the  rows 
> have in database tables.
>
> I can get the  IDs of the documents that can be accesible by the user, 
> but if this are 1000, what will happen in Lucene?
>
> Is this a valid solution? Can anyone provide a better idea?
>
> Thanks,
>
> Sergiu
>
>
> lingaraju wrote:
>
>> Hello
>>
>> Even i am searching the same code as all my web display information is
>> stored  in database.
>> Early response will be very much helpful
>>
>> Thanks and regards
>> Raju
>>
>> ----- Original Message ----- From: "Hetan Shah" <He...@Sun.COM>
>> To: "Lucene Users List" <lu...@jakarta.apache.org>
>> Sent: Thursday, July 15, 2004 5:56 AM
>> Subject: Searching against Database
>>
>>
>>  
>>
>>> Hello All,
>>>
>>> I have got all the answers from this fantastic mailing list. I have
>>> another question ;)
>>>
>>> What is the best way (Best Practices) to integrate Lucene with live
>>> database, Oracle to be more specific. Any pointers are really very much
>>> appreciated.
>>>
>>> thanks guys.
>>> -H
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>>>
>>>
>>>   
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>>
>>  
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>



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


Re: Searching against Database

Posted by Sergiu Gordea <gs...@ifit.uni-klu.ac.at>.
Hi,

I have a simillar problem. I'm working on a web application in which the 
users have different permissions.
Not all information stored in the index is public for all users.

The documents in Index are identified by the same  ID that the  rows 
have in database tables.

I can get the  IDs of the documents that can be accesible by the user, 
but if this are 1000, what will happen in Lucene?

 Is this a valid solution? Can anyone provide a better idea?

 Thanks,

 Sergiu


lingaraju wrote:

>Hello
>
>Even i am searching the same code as all my web display information is
>stored  in database.
>Early response will be very much helpful
>
>Thanks and regards
>Raju
>
>----- Original Message ----- 
>From: "Hetan Shah" <He...@Sun.COM>
>To: "Lucene Users List" <lu...@jakarta.apache.org>
>Sent: Thursday, July 15, 2004 5:56 AM
>Subject: Searching against Database
>
>
>  
>
>>Hello All,
>>
>>I have got all the answers from this fantastic mailing list. I have
>>another question ;)
>>
>>What is the best way (Best Practices) to integrate Lucene with live
>>database, Oracle to be more specific. Any pointers are really very much
>>appreciated.
>>
>>thanks guys.
>>-H
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>  
>



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


Re: Searching against Database

Posted by lingaraju <li...@infactindia.com>.
Hello

Even i am searching the same code as all my web display information is
stored  in database.
Early response will be very much helpful

Thanks and regards
Raju

----- Original Message ----- 
From: "Hetan Shah" <He...@Sun.COM>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Thursday, July 15, 2004 5:56 AM
Subject: Searching against Database


> Hello All,
>
> I have got all the answers from this fantastic mailing list. I have
> another question ;)
>
> What is the best way (Best Practices) to integrate Lucene with live
> database, Oracle to be more specific. Any pointers are really very much
> appreciated.
>
> thanks guys.
> -H
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>


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


Re: Searching against Database

Posted by lingaraju <li...@infactindia.com>.
Hello

Even i am searching the same code as all my web display information is
stored  in database.
Early response will be very much helpful

Thanks and regards
Raju

----- Original Message ----- 
From: "Hetan Shah" <He...@Sun.COM>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Thursday, July 15, 2004 5:56 AM
Subject: Searching against Database


> Hello All,
>
> I have got all the answers from this fantastic mailing list. I have
> another question ;)
>
> What is the best way (Best Practices) to integrate Lucene with live
> database, Oracle to be more specific. Any pointers are really very much
> appreciated.
>
> thanks guys.
> -H
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>


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


Re: Search +QueryParser+Score

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
I don't really understand what QueryParser has to do with your 
question.  If you want only Hits that have a score of 1.0 (keep in mind 
that Hits normalizes scores if they are over 1.0), why not just walk 
all the Hits in order until you get to one that is not 1.0?

Or, use a HitCollector to collect hits (scores not normalized with a 
HitCollector) and bail out when you are done.  (although bailing out of 
a HitCollector is not as clean as we should make it in Lucene 2.0 - we 
should add that to the whiteboard).

	Erik

On Jul 15, 2004, at 7:36 AM, Karthik N S wrote:

> Hey Guys...
>
> Apologies
>
>
>   Let me be more Specific regarding the last mail
>
>   I would like to get all  Hits returned with score  = 1.0  ONLY  using
> Query Parser .
>
>
>
>   What are my Options.
>
>
> with regards
> Karthik
>
>
>
>
>
> -----Original Message-----
> From: Erik Hatcher [mailto:erik@ehatchersolutions.com]
> Sent: Thursday, July 15, 2004 4:45 PM
> To: Lucene Users List
> Subject: Re: Search +QueryParser+Score
>
>
> Kathik,
>
> I have a really hard time following your questions, otherwise I'd chime
> in on them more often.  Your meaning is not often clear.
>
> In the case of normalizing the score to 1.0 or less - this is precisely
> what Hits does for you.  I'm not sure what you mean by "BEFORE" doing
> QueryParser - a score is computed based on a query, so it necessarily
> must come after.
>
> 	Erik
>
>
> On Jul 15, 2004, at 6:55 AM, Karthik N S wrote:
>
>>
>>   Hey Guy's
>>
>>  Apologies.....
>>
>>  I have a Question
>>
>> Is there any API avaliable in Lucene1.4 to set the "Score value to
>> 1.0f or
>> lesser "
>>    BEFORE  doing the Query Parser  for search , so that the returns
>> Hits for
>> the Score settings only.
>>
>>
>>
>> with regards
>> Karthik
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org


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


RE: Search +QueryParser+Score

Posted by Karthik N S <ka...@controlnet.co.in>.
Hey Guys...

Apologies


  Let me be more Specific regarding the last mail

  I would like to get all  Hits returned with score  = 1.0  ONLY  using
Query Parser .



  What are my Options.


with regards
Karthik





-----Original Message-----
From: Erik Hatcher [mailto:erik@ehatchersolutions.com]
Sent: Thursday, July 15, 2004 4:45 PM
To: Lucene Users List
Subject: Re: Search +QueryParser+Score


Kathik,

I have a really hard time following your questions, otherwise I'd chime
in on them more often.  Your meaning is not often clear.

In the case of normalizing the score to 1.0 or less - this is precisely
what Hits does for you.  I'm not sure what you mean by "BEFORE" doing
QueryParser - a score is computed based on a query, so it necessarily
must come after.

	Erik


On Jul 15, 2004, at 6:55 AM, Karthik N S wrote:

>
>   Hey Guy's
>
>  Apologies.....
>
>  I have a Question
>
> Is there any API avaliable in Lucene1.4 to set the "Score value to
> 1.0f or
> lesser "
>    BEFORE  doing the Query Parser  for search , so that the returns
> Hits for
> the Score settings only.
>
>
>
> with regards
> Karthik
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org


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


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


Re: Search +QueryParser+Score

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Kathik,

I have a really hard time following your questions, otherwise I'd chime 
in on them more often.  Your meaning is not often clear.

In the case of normalizing the score to 1.0 or less - this is precisely 
what Hits does for you.  I'm not sure what you mean by "BEFORE" doing 
QueryParser - a score is computed based on a query, so it necessarily 
must come after.

	Erik


On Jul 15, 2004, at 6:55 AM, Karthik N S wrote:

>
>   Hey Guy's
>
>  Apologies.....
>
>  I have a Question
>
> Is there any API avaliable in Lucene1.4 to set the "Score value to 
> 1.0f or
> lesser "
>    BEFORE  doing the Query Parser  for search , so that the returns 
> Hits for
> the Score settings only.
>
>
>
> with regards
> Karthik
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org


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


Search +QueryParser+Score

Posted by Karthik N S <ka...@controlnet.co.in>.
  Hey Guy's

 Apologies.....

 I have a Question

Is there any API avaliable in Lucene1.4 to set the "Score value to 1.0f or
lesser "
   BEFORE  doing the Query Parser  for search , so that the returns Hits for
the Score settings only.



with regards
Karthik



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