> How do I perform a "starts with"
> search in Lucene/Solr.
> 
> Ex: I need all results that start with
> "Bill"   - NOT just contain "Bill" somewhere
> in the search string.

In Lucene with SpanFirstQuery [1].

In Solr you can copy your field into a string typed field. And use prefix 
query: string_field:Bill*

[1]http://lucene.apache.org/java/2_9_0/api/all/org/apache/lucene/search/spans/SpanFirstQuery.html



Reply via email to