Hi Vincent,

If I recall correctly a wildcard query does not use any of the filters
defined in your fieldtype (search the news group for this). So using a
LowerCaseFilterFactory does not work and you'll need to do the to lower case
transform yourself on the client side (javascript?).

However, if I understand correctly you are trying to build an autocomplete
functionality. The wildcard query may be too slow for this. We are using an 
ngram filter for autocompleting over millions of names. This seems to work
fine in test (we are not live yet). Another advantage is that your lower
case issue is solved.

Example config:


                <fieldType name="autoComplete" class="solr.TextField" 
omitNorms="true">
                        <analyzer>
                                <tokenizer 
class="solr.WhitespaceTokenizerFactory" />
                                <filter class="solr.LowerCaseFilterFactory" />
                                <filter class="solr.EdgeNGramFilterFactory"
                                        maxGramSize="20" minGramSize="2" />
                        </analyzer>
                        <analyzer type="query">
                                <tokenizer 
class="solr.WhitespaceTokenizerFactory" />
        <filter class="solr.LowerCaseFilterFactory" />
                                <filter class="solr.PatternReplaceFilterFactory"
                                        pattern="^(.{20})(.*)?" 
replacement="$1" replace="all" />
                        </analyzer>
                </fieldType>


Cheers,

Richard


Vincent Pérès wrote:
> 
> Thanks very much, that's solve my problem !
> 
> Now I see another question : how can I manage the lower/upper cases in my
> search?
> 
> Thanks !
> 
> 
> Dietrich Featherston-2 wrote:
>> 
>> try searching for matches where the name starts with whatever the user
>> has
>> entered so far with a wildcard
>> 
>> ?q=vinc*
>> 
>> Are you always going to be searching for names?  If so you could see if
>> the
>> user has entered two terms and suffix each with a wildcard to get
>> potentially more relevant searches.
>> 
>> For example, if a user enters "vince p", you might substitute that with
>> the
>> query "vince* p*" to get the following hits
>> Vincent Pérès
>> Vincent Price
>> Vince Price
>> Vince Pérès
>> etc...
>> 
>> D
>> 
>> 
>> 
>> 2009/5/31 Vincent Pérès <vincent.pe...@gmail.com>
>> 
>>>
>>> Hello,
>>>
>>> I built a feature which allow users to search for other user thanks to a
>>> dynamic text box.
>>> Like facebook, when you search for your friends, the name is display in
>>> a
>>> javascript dropdown list with a small picture.
>>> But I'm not completely happy with the search... I'm using a standard
>>> search
>>> like "?q=vincent" and I get back the results list. If I type 'vinc' I
>>> will
>>> not get any results (But I would like to display all the users where the
>>> name start with 'vinc'). Maybe I need an extra param?
>>> I also tried the autosuggest, but I get a list of terms and not direct
>>> results...
>>>
>>> Could you suggest me some solr feature which could help me to get better
>>> results?
>>>
>>> Thanks a lot !
>>> Vincent
>>> --
>>> View this message in context:
>>> http://www.nabble.com/User-search-in-Facebook-like-tp23804854p23804854.html
>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/User-search-in-Facebook-like-tp23804854p23807385.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to