lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul <>
Subject autocomplete: case-insensitive and middle word
Date Tue, 17 Aug 2010 15:00:23 GMT
I have a couple questions about implementing an autocomplete function
in solr. Here's my scenario:

I have a name field that usually contains two or three names. For
instance, let's suppose it contains:

John Alfred Smith
Alfred Johnson
John Quincy Adams
Fred Jones

I'd like to have the autocomplete be case insensitive and match any of
the names, preferably just at the beginning.

In other words, if the user types "alf", I want

John Alfred Smith
Alfred Johnson

if the user types "fre", I want

Fred Jones

but not:
John Alfred Smith
Alfred Johnson

I can get the matches using the text_lu analyzer, but the hints that
are returned are lower case, and only one name.

If I use the "string" analyzer, I get the entire name like I want it,
but the user must match the case, that is, must type "Alf", and it
only matches the first name, not the middle name.

How can I get the matches of the "text_lu" analyzer, but get the hints
like the "string" analyzer?


View raw message