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 George Abraham <ge...@gmail.com> on 2005/12/02 22:03:34 UTC

lucene and database searching, keeping score

All,
I have created a Lucene index from data in a SQL Server db. When I conduct a
Lucene search, I get back in the hits the primary key (WorkID) and the
scores associated with the hits. Then using the list of WorkIDs, I query the
database for the other associated information of the assets associated with
the WorkIDs. Since this is a SQL query, it is independent of the Lucene
scoring and the order is all screwed up. How do I then add the scores to the
resultset returned from the database? Basically I would want to merge the
resultset from Lucene with the resultset from the SQL query.

Thanks,
George

Re: lucene and database searching, keeping score

Posted by Jeff Rodenburg <je...@gmail.com>.
George -

There are a number of SQL Server specific ways you can do this.  Email me
off-list as the solution is not relevant to Lucene.

-- j

On 12/2/05, George Abraham <ge...@gmail.com> wrote:
>
> All,
> I have created a Lucene index from data in a SQL Server db. When I conduct
> a
> Lucene search, I get back in the hits the primary key (WorkID) and the
> scores associated with the hits. Then using the list of WorkIDs, I query
> the
> database for the other associated information of the assets associated
> with
> the WorkIDs. Since this is a SQL query, it is independent of the Lucene
> scoring and the order is all screwed up. How do I then add the scores to
> the
> resultset returned from the database? Basically I would want to merge the
> resultset from Lucene with the resultset from the SQL query.
>
> Thanks,
> George
>
>

Re: lucene and database searching, keeping score

Posted by John Powers <jp...@configureone.com>.
Instead of just putting the keys in the index, can you put all the data you
might be getting out to display to the user, or whatever the final thing is?
That's what we do.    Search on the id as you are, and then the hit has
documents that are loaded with all your final information instead of just
the keys.   It'll save you a db connection at result time.

On 12/2/05 3:03 PM, "George Abraham" <ge...@gmail.com>
wrote:

> All,
> I have created a Lucene index from data in a SQL Server db. When I conduct a
> Lucene search, I get back in the hits the primary key (WorkID) and the
> scores associated with the hits. Then using the list of WorkIDs, I query the
> database for the other associated information of the assets associated with
> the WorkIDs. Since this is a SQL query, it is independent of the Lucene
> scoring and the order is all screwed up. How do I then add the scores to the
> resultset returned from the database? Basically I would want to merge the
> resultset from Lucene with the resultset from the SQL query.
> 
> Thanks,
> George


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