I have solr documents that look like this:
<doc>
<str name="some_attribute">some_attribute_value</str>
<!-- ... -->
<arr name="locationCoordinates">
<str>48.117,11.539</str>
<str>23.423,11.342</str>
<!-- ... -->
</arr>
</doc>
My question is whether it's possible to filter the returned fields of a document to only return certain values, for example to only return the locationCoordinates that are within a 50 km range of another point and leave the others out.
I.e. return the above document, but with only the first locationCoordinates.
I don't really know whether this should even be possible in Solr (because of the document-oriented structure), but I can at least ask :).
Maybe I should also elaborate on the way I want to use this feature and alternatives I "found" for this:
change the document design to create one document per location (Pro: works, Cons: need to check for duplicates on the client side, heaps of duplicated data in the Solr-database)
leave it with this structure (Pro: works, don't have to change the current structure, Cons: I have to sort the correct coordinates out by myself (on the client) and therefore encounter problems with distance calculation (I already filter the documents by distance beforehand, and maybe I will lose some data if I compute the distance on the client-side badly)
create a new Document "type" for the locations (and their names, etc.) on the Solr-side and use a foreign-key-like structure to add the locations to the articles and in order to compute distances I have to query for reachable locations first and then join on the articles (Pro: everything works on the solr-side, Cons: I will need Solr-Joins for that)