lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anupam Bhattacharya <anupam...@gmail.com>
Subject Re: Sorting fields of text_general fieldType
Date Fri, 03 Aug 2012 08:30:08 GMT
Few titles are as following:

Embattled JPMorgan boss survives power challenge - Jakarta Globe

Kitten Survives 6500-Mile Trip in China-US Container - Jakarta Globe

Guard survives hail of bullets - Jakarta Post

On Fri, Aug 3, 2012 at 1:09 PM, Lance Norskog <goksron@gmail.com> wrote:

> Give us some pairs of titles which sort the wrong way.
>
> On Thu, Aug 2, 2012 at 10:06 AM, Anupam Bhattacharya
> <anupamb82@gmail.com> wrote:
> > The approach used to work perfectly.
> >
> > But recently i realized that it is not working for more than 300000
> indexed
> > records.
> > I am using SOLR 3.5 version.
> >
> > Is there another approach to SORT a title field in proper alphabetical
> > order irrespective of Lower case and Upper case.
> >
> > Regards
> > Anupam
> >
> > On Thu, May 17, 2012 at 4:32 PM, Ahmet Arslan <iorixxx@yahoo.com> wrote:
> >
> >> > The title sort works in a strange manner because the SOLR
> >> > server treats
> >> > title string based on Upper Case or Lower Case String. Thus
> >> > if we sort in
> >> > ascending order, first the title with numeric shows up then
> >> > the titles in
> >> > alphabetical order which starts with Upper Case & after
> >> > that the titles
> >> > starting with Lowercase.
> >> >
> >> > The title field is indexed as text_general fieldtype.
> >> >
> >> > <field name="title" type="text_general" indexed="true"
> >> > stored="true"/>
> >>
> >> Please see Otis' response http://search-lucene.com/m/uDxTF1scW0d2
> >>
> >> Simply create an additional field named title_sortable with the
> following
> >> type
> >>
> >>  <!-- lowercases the entire field value, keeping it as a single token.
>  -->
> >>     <fieldType name="lowercase" class="solr.TextField"
> >> positionIncrementGap="100">
> >>       <analyzer>
> >>         <tokenizer class="solr.KeywordTokenizerFactory"/>
> >>         <filter class="solr.LowerCaseFilterFactory" />
> >>         <filter class="solr.TrimFilterFactory" />
> >>       </analyzer>
> >>     </fieldType>
> >>
> >> Populate it via copyField directive :
> >>
> >>   <copyField source="title" dest="title_sortable" maxChars="N"/>
> >>
> >> then &sort=title_sortable asc
> >>
> >>
> >>
>
>
>
> --
> Lance Norskog
> goksron@gmail.com
>



-- 
Thanks & Regards
Anupam Bhattacharya

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message