angry kiwi
angry kiwi

Reputation: 11445

Search Lucene - Usage Practice

I’ve got search lucene set up and running. Everything works perfectly.

My website is an application that populates results similar to that of ebay, each item has an image, title, content description and some other information come with it.

I have two solutions for populating my data, I want you to suggest which one should I go for.

  1. store title, content, image name, and every other information in the index files. When users search, I will just query the index files, and get everything from there.

  2. just store title and content and row ids. When users search, I will query the index files, get ids of match search then use those ids to query my actual database for every other information.

Upvotes: 1

Views: 110

Answers (1)

Pascal MARTIN
Pascal MARTIN

Reputation: 401002

I would probably go with the first solution, storing everything into the search/index engine (Lucene, in your case).

This way, in order to display your list of products, you will not have to make any request to your database, which will lower the load on your DB server -- and your site will scale better.

Upvotes: 2

Related Questions