Storing data outside of Solr index
Although Solr allows us to use the partial update API to update a single field of our document, what it does in the background is the complete reindexing of a document. However, there are situations where such reindexing is not possible. For example, we can have an index containing articles about published books, and we can store the information on how many users visited this article and read it. The number of users is so high that we have thousands of updates per second. Sending a high amount of updates can be demanding for Solr; however, we can store such information in external files and use it for boosting or sorting. This recipe will show how to do this.
How to do it...
The following steps are needed to achieve our requirements:
- First of all, we will create the index structure by adding the following field definition to our
schema.xml
file:<field name="name" type="text_general" indexed="true" stored="true" ...