Storing users' data in lucene or querying rdbms?
I'm struggling with lucene and not sure how it's better to do: i've got users' data for their profiles - some of them(3-4 fields) are storing in lucene.But on query results i开发者_Python百科 need also to show user's age/name/etc.
I don't think it's reasonable to save all of these fields(additional, which are not participate in the search process) in lucene, but querying rdmbs will either take some time, so my question is how it's better to do?
Thanks.
Indexing all profile fields with lucene gives better search experience to end users, as it will search over all fields and do appropriate ranking. In RDBMS, i dont know abt full text search over multiple columns and ranking. In such case i have always preferred Lucene.
you are also required to sync index with rdms.
This blog post tries to give you tools to choose between a full text search engine and a database. A compromise is to index all searchable fields and store an id you can use to retrieve a record from the database using a database key.
Apart from taking more disk space, using "stored" field in the index does not impact performance of queries. I would go with that.
精彩评论