We used copyField to copy the address to two fields:

1.  Which contains just the first token up to the first whitespace
2.  Which copies all of it, but translates to lower case.

Then our users can enter either a street number, a street name, or both.   We 
copied all of it to the second field because it is not, in general, possible to 
distinguish between a house number and something else: a house number is not 
always present, and when present is not always numeric.  Both are 
solr.TextField:


    <fieldType name="streetnumber" class="solr.TextField">
       <analyzer>
          <tokenizer class="solr.PatternTokenizerFactory"
             pattern="(^\S+)"
             group="1"
          />
          <filter class="solr.LowerCaseFilterFactory" />
       </analyzer>
    </fieldType>


JRJ

-----Original Message-----
From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] 
Sent: Friday, September 23, 2011 9:27 AM
To: solr-user@lucene.apache.org
Subject: Re: A fieldType for a address street

Nicolas,

A text or ngram field should do it.

Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Lucene ecosystem search :: http://search-lucene.com/


----- Original Message -----
> From: Nicolas Martin <nmar...@doyousoft.com>
> To: solr-user@lucene.apache.org
> Cc: 
> Sent: Friday, September 23, 2011 5:55 AM
> Subject: A fieldType for a address street
> 
> Hi solR users!
> 
> I'd like to make research on my client database, in particular, i need to 
> find client by their address (ex : "100 avenue des champs élysée")
> 
> Does anyone know a good fieldType to store my addresses to enable me to 
> search 
> client by address easily ?
> 
> 
> thank you all
>

Reply via email to