Hello, Adam. It's hard to witness about 3.4, but that assert works on master
diff --git a/solr/core/src/test/org/apache/solr/schema/ExternalFileFieldSortTest.java b/solr/core/src/test/org/apache/solr/schema/ExternalFileFieldSortTest.java index 632b413..4106e15 100644 --- a/solr/core/src/test/org/apache/solr/schema/ExternalFileFieldSortTest.java +++ b/solr/core/src/test/org/apache/solr/schema/ExternalFileFieldSortTest.java @@ -48,8 +48,9 @@ addDocuments(); assertQ("query", - req("q", "*:*", "sort", "eff asc"), + req("q", "*:*", "sort", "eff asc", "fl", "id,field(eff)"), "//result/doc[position()=1]/str[.='3']", + "//result/doc[position()=1]/float[@name='field(eff)' and .='0.001']", "//result/doc[position()=2]/str[.='1']", "//result/doc[position()=10]/str[.='8']"); } On Wed, Sep 4, 2019 at 8:28 PM Adam Taylor <a...@adzuna.com> wrote: > Hi All, > > We're running Solr 3.4 (I know, I know - we have another project to upgrade > this) and we have a fieldtype defined with an externalFileField as: > > <fieldtype name="filectr" keyField="id" defVal="1" stored="true" > indexed="false" class="solr.ExternalFileField" valType="float"/> > > (Actually, I have tried this with both `stored="true"` and > `stored="false"`). > > The field using this fieldtype is defined as: > > <field name="ctr" type="filectr" indexed="false" stored="true" > required="false"/> > > We're successfully using this in our boost function to alter the rankings > based on click through rates (ctr). > > Now we'd like to return this value so we can tag popular documents from our > index. > > I have tried various combinations from examples I've found in > Stackoverflow, the mailing list archives and so on. > > For example: > > fl=ctr > fl=field(ctr) > fl=ctr:field(ctr) > > None of these have returned a ctr field with the document. As part of the > queries I've been testing, I have ensured to filter on documents that > definitely have a value in our external file. I have also tried re-indexing > the documents as this was mentioned in a few places but it makes no > difference (which kind of makes sense to me as the whole point is that this > is an external field). > > Now, I found an old copy of the manual for 3.4 where it states about > externalFileFields that: > > > External fields are not searchable. They can be used only for function > queries > > Whereas, in the newer versions of the docs it states "they can be used for > function queries and display". > > Does this mean it's simply not possible in Solr 3.4 or am I just doing > something wrong? > > Thanks in advance, > Adam > -- Sincerely yours Mikhail Khludnev