Hi Jeff,

Good catch. As I was putting this together, I was learning Solr at the same
time. Having another pair of eyes on this helps a lot.
I have changed the code from :

solrQuery.addField("*");
solrQuery.addField("score");

to:

solrQuery.addField(keyIdField);
solrQuery.addField("score");

It's been updated and pushed to github.

-Jared


On Mon, Jan 20, 2014 at 8:28 PM, Jeff Schmidt <notifications@github.com>wrote:

> In
> titan-solr/src/main/java/com/thinkaurelius/titan/diskstorage/solr/SolrIndex.java:
>
> > +        } catch (SolrServerException e) {
> > +            log.error("Unable to query Solr index.", e);
> > +        }
> > +        return result;
> > +    }
> > +
> > +    @Override
> > +    public Iterable<RawQuery.Result<String>> query(RawQuery query, KeyInformation.IndexRetriever informations, TransactionHandle tx) throws StorageException {
> > +        List<RawQuery.Result<String>> result = new ArrayList<RawQuery.Result<String>>();
> > +        String core = query.getStore();
> > +        String keyIdField = keyFieldIds.get(core);
> > +        SolrServer solr = this.solrServers.get(core);
> > +        SolrQuery solrQuery = new SolrQuery();
> > +        solrQuery.setQuery("*:*");
> > +        solrQuery.addFilterQuery(query.getQuery());
> > +        solrQuery.addField("*");
>
> Why retrieve all fields when only the score and the key ID field are used
> below? Seems this would cause unnecessary overhead particularly for stores
> with lots and/or multi-valued fields.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/thinkaurelius/titan/pull/372/files#r9024792>
> .
>