Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I keep the size of stored fields in Solr to a minimum?

I am looking to introduce Solr to power the search for a business listing website. The site has around 2 million records.

There is a search results page which will display some key data for each result. I believe the data needed for this summary information is around 1KB per result.

I could simply index the fields needed for the search within Solr - but this means a separate database call for each result to populate the summary information. If Solr could return all of this data I would expect it to yield greater performance than ~40 database round-trips.

The concern is that Solr's memory usage would be too large (how might I calculate this?) and that indexing might take too long with the extra data.

like image 637
David Neale Avatar asked Dec 27 '22 16:12

David Neale


1 Answers

You would benefit greatly to store those fields in Solr compared to the 40 db roundtrips. Just make sure that you marked the field as "not indexed" (indexed = false) in your schema config and maybe also compressed (compressed = true) (however this will of course use some CPU when indexing and retrieving).

When marking a field as "not indexed" no analyzers will process the field when indexing making it stored much faster than a indexed field.

like image 196
lindstromhenrik Avatar answered Jan 21 '23 13:01

lindstromhenrik