External file field in Apache Solr

I am trying to use ExternalFileField in ApacheSolr for external scoring.

I am using the config example. Basically, I want to set ratings for elements using their identifiers.

I set the fieldType idRankFile and the idRank field in schema.xml:

<fieldType name="idRankFile" keyField="id" defVal="0" stored="true" indexed="true" class="solr.ExternalFileField" valType="pfloat" />
<field name="idRank" type="idRankFile" indexed="true" stored="true" />

And he made a file called external_idRank in / solr / example / solr / data with the following contents:

F8V7067-APL-KIT = 1.0
IW-02 = 10.0
9885A004 = 100.0
SOLR1000 = 1000.0

(This assigns idRank values ​​for various identifiers)

Now I run the following query:

http: // localhost: 8983 / solr / select /? indent = on & q = car% 20power% 20adapter% 20_val_:% 22product (idRank, 1)% 22 & fl = name, id

This should basically return the results in the order of their idRanks. However, it is not.

Any ideas?

+3
source share
1 answer

, . , :

  • :
    solr_home/PROJECT/multicore/core1/data/external_popularProducts.txt

    :
    uniqueID_in_core=count

    :
     873728721=19
     842728342=20

  • schema.xml, <types> </types>
    <fieldType name="popularProductsFile" keyField="key" defVal="0" stored="true" indexed="true" class="solr.ExternalFileField" valType="float" />

    key - primaryID solr.
    <fields></fields>
    <field name="popularProducts" type="popularProductsFile" indexed="true" stored="true" />

  • . solr4.3, . , solrcloud node . SOLR-4805: SolrCloud - RELOAD . , solrcloud.

  • : http://SOLR_NODE:8983/solr/core1/select?q=ipad&sort=popularProducts desc

:
, ExternalFileField, . :

, , - .

+2

All Articles