Solr 1.4 supports this new feature:
http://wiki.apache.org/solr/TermsComponent
https://issues.apache.org/jira/browse/SOLR-877
It would seem like this component would be useful for some of the autocomplete needs of project_solr, but so far I don't see a way to apply any filtering to the generated terms - i.e. unless project nodes have a distinct field, it might not be that useful.
Note - also - the wiki page references a tutorial including this
/autocomplete path, but I cannot find any trace of such. I was able
to get results similar to the examples on the wiki page by adding the
following to solrconfig.xml:
<searchComponent name="terms"
class="org.apache.solr.handler.component.TermsComponent" />
<!-- a request handler utilizing the elevator component -->
<requestHandler name="/autocomplete" class="solr.SearchHandler"
startup="lazy">
<lst name="defaults">
<str name="echoParams">explicit</str>
</lst>
<arr name="components">
<str>terms</str>
</arr>
</requestHandler>
Comments
Comment #1
janusman commentedJust noting that in order to get the list of terms the Solr request URL for the partial string "foo" could be something like:
The response in this case is:
Comment #2
janusman commentedBTW #394076: Autocomplete in search box powered by Solr has a patch for apache solr that implements this.