Recommendations for combining Lucene.NET and relational database?

I am working on a project in which I will have a lot of data, and it will be searchable in several forms, which are very effectively expressed as SQL queries, but they also need to be searched using natural language processing.

My plan is to create an index using Lucene for this search form.

My question is, if I do this and do a search, Lucene will return the identifier of the relevant documents to the index, then I have to look for these entities from the relational database.

There are two ways to do this (which I can still think of):

  • N number of requests (Awful)
  • Pass the entire identifier to the stored procedure immediately (possibly as a comma-delimited parameter). This has the disadvantage of limiting the maximum parameter size and slow UDF performance in order to split a row into a temporary table.

I am almost tempted to reflect everything in the lucenes index, so that I can periodically generate the index from the backup storage, but you only need to access it for the interface.

Tips?

+5
source share
4 answers

I would save the "frontend" data inside the index itself, avoiding any interaction with db. Db will only be requested when you need additional information about a particular record.

+4
source

, , ( PostgreSQL 8.3, ft, steming thesaurus). , SQL ft. , , , , lucene.

+2

, , , , , , , , 200 , , , , .

, , . , .

+1

, , , , , db , . , (, , db, URL- , , ). , db, , Lucene.NET, .

. , , .

The cache in memory is always fresh for several hours, and the only time I have to hit db is if I need to get more detailed data for one object (if the user clicks on the link for a specific object to go to the page for that object )

0
source

All Articles