I am trying to use Solr 3.6.1 ExternalFileField
. Here is my fieldtype definition:
<fieldtype name="file" keyField="id" defVal="0" stored="true" indexed="true" class="solr.ExternalFileField" valType="float"/>
and here is the field definition:
<field name="fviews" type="file"/>
I was able to test it by sorting on fviews
like
http://localhost:8983/solr/select?q=tag_id:1&sort={!func}fviews desc
and it is working correctly.
But I am running into two issues:
I need this field back in my search results. Even though I've marked the field as stored="true"
I do not get it back. I even tried adding &fl=*
query param but it doesn't work.
If I make changes to the external file, they are not getting reflected in the search results immediately (which is the very reason why I wanted to use external file field). The documentation for solr 4.0 at https://lucene.apache.org/solr/api-4_0_0-BETA/org/apache/solr/schema/ExternalFileField.html reads "If the external file has already been loaded, and it is changed, those changes will not be visible until a commit has been done.". I tried doing a commit using http://localhost:8983/solr/update?commit=true
in the hope that Solr may read the edited file based on modified timestamp, but it does not work. However, if I do a full import, then the results are correct.
Update (Answer): The 2nd question has been answered by @Persimmonium below. The answer for the first question (how to retrieve the value) is to use fl=*,field(EXTERNAL_FILE_FIELD_NAME)
as mentioned in this blog post I wrote.