Uppercase Zip/Postal Code

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Uppercase Zip/Postal Code

ron773
I'm using solr to query a database to find UK postal codes. However, I can
only find zip codes when they use capital letters, and I can't find them
with lowercase letters. I was wondering if it's possible to set solr to be
case-insensitive for zip codes or if not, is it possible to set the query so
that it forces uppercase onto search.

Here's an example of the code.

 [Display(Name = "Zip / Postcode")]
        public string ZipCode { get; set; }



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Uppercase Zip/Postal Code

nandan_solr
In case of lowercase search, you need to apply analyzer with filter..
<analyzer type="query">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
Hope this will help you

On Tue, Jun 12, 2018 at 1:52 AM, ron773 <[hidden email]> wrote:

> I'm using solr to query a database to find UK postal codes. However, I can
> only find zip codes when they use capital letters, and I can't find them
> with lowercase letters. I was wondering if it's possible to set solr to be
> case-insensitive for zip codes or if not, is it possible to set the query
> so
> that it forces uppercase onto search.
>
> Here's an example of the code.
>
>  [Display(Name = "Zip / Postcode")]
>         public string ZipCode { get; set; }
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>