I\'ve been trying to use ExternalFileField in ApacheSolr for external scoring.
I\'m using the example config. Basically I want to set scores for items using their
Alright, so I had the same problem. This is what I did:
Create a file:
solr_home/PROJECT/multicore/core1/data/external_popularProducts.txt
The file should contain values like this:
uniqueID_in_core=count
Example:
873728721=19
842728342=20
Update schema.xml, add this under <types> </types>
<fieldType name="popularProductsFile" keyField="key" defVal="0" stored="true" indexed="true" class="solr.ExternalFileField" valType="float" />
Here, key
is the column name for the primaryID of solr core.
Add this under <fields></fields>
<field name="popularProducts" type="popularProductsFile" indexed="true" stored="true" />
Reload the core. I am using solr4.3 which has a bug. When I try to reload any core,the solrcloud node goes down. SOLR-4805: SolrCloud - RELOAD on collections or cores leaves collection offline and unusable till restart . So, I had to restart my solrcloud nodes.
Query:
http://SOLR_NODE:8983/solr/core1/select?q=ipad&sort=popularProducts desc
Note:
Most of the blogs written about ExternalFileField are not completely accurate. So just refer to the original documentation:
Please improve this answer if you find any issues with it.