question about sorting

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

question about sorting

Xuesong Luo
Hi,
My sorting fields include both TextField type and StrField type. Because
TextField uses TokenizerFactory, they can't be sorted. I have to copy
each TextField to a StrField and sort on those StrFields. Does anyone
know if there is a better way to do that?

Thanks
Xuesong

Reply | Threaded
Open this post in threaded view
|

Re: question about sorting

Yonik Seeley-2
On 6/11/07, Xuesong Luo <[hidden email]> wrote:
> My sorting fields include both TextField type and StrField type. Because
> TextField uses TokenizerFactory, they can't be sorted. I have to copy
> each TextField to a StrField and sort on those StrFields. Does anyone
> know if there is a better way to do that?

What information does this TextField carry?
Sorting works on indexed field values, and thus needs to be
single-valued per document.

-Yonik
Reply | Threaded
Open this post in threaded view
|

RE: question about sorting

Xuesong Luo
In reply to this post by Xuesong Luo
For example, first name, department, job title etc.

Thanks
Xuesong

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Yonik
Seeley
Sent: Monday, June 11, 2007 6:35 PM
To: [hidden email]
Subject: Re: question about sorting

On 6/11/07, Xuesong Luo <[hidden email]> wrote:
> My sorting fields include both TextField type and StrField type.
Because
> TextField uses TokenizerFactory, they can't be sorted. I have to copy
> each TextField to a StrField and sort on those StrFields. Does anyone
> know if there is a better way to do that?

What information does this TextField carry?
Sorting works on indexed field values, and thus needs to be
single-valued per document.

-Yonik


Reply | Threaded
Open this post in threaded view
|

Re: question about sorting

Yonik Seeley-2
On 6/11/07, Xuesong Luo <[hidden email]> wrote:
> For example, first name, department, job title etc.

Something like first name might be able to be a single field that is
searchable and sortable (use a keyword tokenizer followed by a
lowercase filter).  If the field contains multiple words, and you want
to both search and sort on that field, there isn't currently a better
alternative to copyField.

-Yonik
Reply | Threaded
Open this post in threaded view
|

RE: question about sorting

Xuesong Luo
In reply to this post by Xuesong Luo
Thanks, Yonik. Unfortunately we have users whose first names contain
more than one word, it seems copy field is my only option.

Thanks
Xuesong

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Yonik
Seeley
Sent: Tuesday, June 12, 2007 10:35 AM
To: [hidden email]
Subject: Re: question about sorting

On 6/11/07, Xuesong Luo <[hidden email]> wrote:
> For example, first name, department, job title etc.

Something like first name might be able to be a single field that is
searchable and sortable (use a keyword tokenizer followed by a
lowercase filter).  If the field contains multiple words, and you want
to both search and sort on that field, there isn't currently a better
alternative to copyField.

-Yonik


Reply | Threaded
Open this post in threaded view
|

Re: question about sorting

Yonik Seeley-2
On 6/12/07, Xuesong Luo <[hidden email]> wrote:
> Thanks, Yonik. Unfortunately we have users whose first names contain
> more than one word, it seems copy field is my only option.

Yes, if you need to be able to match on part of a first name, rather
than just exact first name.

-Yonik