You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jay Potharaju <js...@gmail.com> on 2016/06/23 16:43:03 UTC

Sorting & searching on the same field

Hi,
I would like to have 1 field that can used for both searching and case
insensitive sorting. As far as i know the only way to do is to have two
fields one for searching (text_en) and one for sorting(lowercase & string).
Any ideas how the two can be combined into 1 field.


-- 
Thanks
Jay Potharaju

Re: Sorting & searching on the same field

Posted by Jay Potharaju <js...@gmail.com>.
Thanks Alex, I will check this out.
 Is it possible to do something at query time , using a function query to lowercase the field and then sort on it.?
Jay

> On Jun 24, 2016, at 12:03 AM, Alexandre Rafalovitch <ar...@gmail.com> wrote:
> 
> Keep voting for SOLR-8362?
> 
> You could do your preprocessing in UpdateRequestProcessor chain. There
> is nothing specifically for Lower/Upper case, but there is a generic
> scripting one: http://www.solr-start.com/javadoc/solr-lucene/org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.html
> 
> Regards,
>   Alex.
> ----
> Newsletter and resources for Solr beginners and intermediates:
> http://www.solr-start.com/
> 
> 
>> On 24 June 2016 at 13:42, Jay Potharaju <js...@gmail.com> wrote:
>> Any ideas on how to handle case insensitive search, string fields and
>> docvalues in 1 field?
>> 
>> On Thu, Jun 23, 2016 at 8:14 PM, Alexandre Rafalovitch <ar...@gmail.com>
>> wrote:
>> 
>>> At least you don't need to store the sort field. Or even index, if it is
>>> docvalues (good for sort).
>>> 
>>> Regards,
>>>    Alex
>>>> On 24 Jun 2016 9:01 AM, "Jay Potharaju" <js...@gmail.com> wrote:
>>>> 
>>>> yes, that is what i thought. but was checking to see if there was
>>> something
>>>> I was missing.
>>>> Thanks
>>>> 
>>>> On Thu, Jun 23, 2016 at 12:55 PM, Ahmet Arslan <iorixxx@yahoo.com.invalid
>>>> 
>>>> wrote:
>>>> 
>>>>> Hi Jay,
>>>>> 
>>>>> I don't think it can be combined.
>>>>> Mainly because: searching requires a tokenized field.
>>>>> Sorting requires a single value (token) to be meaningful.
>>>>> 
>>>>> Ahmet
>>>>> 
>>>>> 
>>>>> 
>>>>> On Thursday, June 23, 2016 7:43 PM, Jay Potharaju <
>>> jspotharaju@gmail.com
>>>>> 
>>>>> wrote:
>>>>> Hi,
>>>>> I would like to have 1 field that can used for both searching and case
>>>>> insensitive sorting. As far as i know the only way to do is to have two
>>>>> fields one for searching (text_en) and one for sorting(lowercase &
>>>> string).
>>>>> Any ideas how the two can be combined into 1 field.
>>>>> 
>>>>> 
>>>>> --
>>>>> Thanks
>>>>> Jay Potharaju
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Thanks
>>>> Jay Potharaju
>> 
>> 
>> 
>> --
>> Thanks
>> Jay Potharaju

Re: Sorting & searching on the same field

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Keep voting for SOLR-8362?

You could do your preprocessing in UpdateRequestProcessor chain. There
is nothing specifically for Lower/Upper case, but there is a generic
scripting one: http://www.solr-start.com/javadoc/solr-lucene/org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.html

Regards,
   Alex.
----
Newsletter and resources for Solr beginners and intermediates:
http://www.solr-start.com/


On 24 June 2016 at 13:42, Jay Potharaju <js...@gmail.com> wrote:
> Any ideas on how to handle case insensitive search, string fields and
> docvalues in 1 field?
>
> On Thu, Jun 23, 2016 at 8:14 PM, Alexandre Rafalovitch <ar...@gmail.com>
> wrote:
>
>> At least you don't need to store the sort field. Or even index, if it is
>> docvalues (good for sort).
>>
>> Regards,
>>     Alex
>> On 24 Jun 2016 9:01 AM, "Jay Potharaju" <js...@gmail.com> wrote:
>>
>> > yes, that is what i thought. but was checking to see if there was
>> something
>> > I was missing.
>> > Thanks
>> >
>> > On Thu, Jun 23, 2016 at 12:55 PM, Ahmet Arslan <iorixxx@yahoo.com.invalid
>> >
>> > wrote:
>> >
>> > > Hi Jay,
>> > >
>> > > I don't think it can be combined.
>> > > Mainly because: searching requires a tokenized field.
>> > > Sorting requires a single value (token) to be meaningful.
>> > >
>> > > Ahmet
>> > >
>> > >
>> > >
>> > > On Thursday, June 23, 2016 7:43 PM, Jay Potharaju <
>> jspotharaju@gmail.com
>> > >
>> > > wrote:
>> > > Hi,
>> > > I would like to have 1 field that can used for both searching and case
>> > > insensitive sorting. As far as i know the only way to do is to have two
>> > > fields one for searching (text_en) and one for sorting(lowercase &
>> > string).
>> > > Any ideas how the two can be combined into 1 field.
>> > >
>> > >
>> > > --
>> > > Thanks
>> > > Jay Potharaju
>> > >
>> >
>> >
>> >
>> > --
>> > Thanks
>> > Jay Potharaju
>> >
>>
>
>
>
> --
> Thanks
> Jay Potharaju

Re: Sorting & searching on the same field

Posted by Jay Potharaju <js...@gmail.com>.
Any ideas on how to handle case insensitive search, string fields and
docvalues in 1 field?

On Thu, Jun 23, 2016 at 8:14 PM, Alexandre Rafalovitch <ar...@gmail.com>
wrote:

> At least you don't need to store the sort field. Or even index, if it is
> docvalues (good for sort).
>
> Regards,
>     Alex
> On 24 Jun 2016 9:01 AM, "Jay Potharaju" <js...@gmail.com> wrote:
>
> > yes, that is what i thought. but was checking to see if there was
> something
> > I was missing.
> > Thanks
> >
> > On Thu, Jun 23, 2016 at 12:55 PM, Ahmet Arslan <iorixxx@yahoo.com.invalid
> >
> > wrote:
> >
> > > Hi Jay,
> > >
> > > I don't think it can be combined.
> > > Mainly because: searching requires a tokenized field.
> > > Sorting requires a single value (token) to be meaningful.
> > >
> > > Ahmet
> > >
> > >
> > >
> > > On Thursday, June 23, 2016 7:43 PM, Jay Potharaju <
> jspotharaju@gmail.com
> > >
> > > wrote:
> > > Hi,
> > > I would like to have 1 field that can used for both searching and case
> > > insensitive sorting. As far as i know the only way to do is to have two
> > > fields one for searching (text_en) and one for sorting(lowercase &
> > string).
> > > Any ideas how the two can be combined into 1 field.
> > >
> > >
> > > --
> > > Thanks
> > > Jay Potharaju
> > >
> >
> >
> >
> > --
> > Thanks
> > Jay Potharaju
> >
>



-- 
Thanks
Jay Potharaju

Re: Sorting & searching on the same field

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
At least you don't need to store the sort field. Or even index, if it is
docvalues (good for sort).

Regards,
    Alex
On 24 Jun 2016 9:01 AM, "Jay Potharaju" <js...@gmail.com> wrote:

> yes, that is what i thought. but was checking to see if there was something
> I was missing.
> Thanks
>
> On Thu, Jun 23, 2016 at 12:55 PM, Ahmet Arslan <io...@yahoo.com.invalid>
> wrote:
>
> > Hi Jay,
> >
> > I don't think it can be combined.
> > Mainly because: searching requires a tokenized field.
> > Sorting requires a single value (token) to be meaningful.
> >
> > Ahmet
> >
> >
> >
> > On Thursday, June 23, 2016 7:43 PM, Jay Potharaju <jspotharaju@gmail.com
> >
> > wrote:
> > Hi,
> > I would like to have 1 field that can used for both searching and case
> > insensitive sorting. As far as i know the only way to do is to have two
> > fields one for searching (text_en) and one for sorting(lowercase &
> string).
> > Any ideas how the two can be combined into 1 field.
> >
> >
> > --
> > Thanks
> > Jay Potharaju
> >
>
>
>
> --
> Thanks
> Jay Potharaju
>

Re: Sorting & searching on the same field

Posted by Jay Potharaju <js...@gmail.com>.
yes, that is what i thought. but was checking to see if there was something
I was missing.
Thanks

On Thu, Jun 23, 2016 at 12:55 PM, Ahmet Arslan <io...@yahoo.com.invalid>
wrote:

> Hi Jay,
>
> I don't think it can be combined.
> Mainly because: searching requires a tokenized field.
> Sorting requires a single value (token) to be meaningful.
>
> Ahmet
>
>
>
> On Thursday, June 23, 2016 7:43 PM, Jay Potharaju <js...@gmail.com>
> wrote:
> Hi,
> I would like to have 1 field that can used for both searching and case
> insensitive sorting. As far as i know the only way to do is to have two
> fields one for searching (text_en) and one for sorting(lowercase & string).
> Any ideas how the two can be combined into 1 field.
>
>
> --
> Thanks
> Jay Potharaju
>



-- 
Thanks
Jay Potharaju

Re: Sorting & searching on the same field

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
Hi Jay,

I don't think it can be combined.
Mainly because: searching requires a tokenized field.
Sorting requires a single value (token) to be meaningful.

Ahmet



On Thursday, June 23, 2016 7:43 PM, Jay Potharaju <js...@gmail.com> wrote:
Hi,
I would like to have 1 field that can used for both searching and case
insensitive sorting. As far as i know the only way to do is to have two
fields one for searching (text_en) and one for sorting(lowercase & string).
Any ideas how the two can be combined into 1 field.


-- 
Thanks
Jay Potharaju