lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: query help
Date Thu, 29 Mar 2012 17:12:31 GMT
Solr doesn't support sorting on multValued fields so I don't think this
is possible OOB.

I can't come up with a clever indexing solution that does this either, sorry.

Best
Erick

On Thu, Mar 29, 2012 at 8:27 AM, Abhishek tiwari
<abhishek.tiwari.tek@gmail.com> wrote:
> a) No. i do not want to sort the content within document .
> I want to sort the documents .
> b) As i have explained i have result set( documents ) and each document
> contains a fields "*ad_text*" (with other fields also) which is
> multivalued..storing some tags say "B1, B2, B3" in each. bt order of tags
> are different for each doc. say (B1, B2, B3) *for doc1*,  B3,B1 B2*, for
> doc2*, B1, B3, B2*, doc3*, B2, B3, B1* for doc4*
>
> if i search for B1: result should come in following order:
> doc1,doc3,doc2,doc4
> (As B1 is first value in maltivalued result for doc1and doc3, and B1 is in
> 2nd value in doc2 while  B1 is at 3rd in doc4  )
> if i search for B2: result should come in following order: doc4
> ,doc1,doc3,doc2
>
>
> I donot know whether it is possible or not ..
>
> but please suggest how it can be done.
>
>
>
> On Thu, Mar 29, 2012 at 5:18 PM, Erick Erickson <erickerickson@gmail.com>wrote:
>
>> Hmmm, I don't quite get this. Are you saying that you want
>> to sort the documents or sort the content within the document?
>>
>> Sorting documents (i.e the results list) requires a single-valued
>> field. So you'd have to, at index time, sort the entries.
>>
>> Sorting the content within the document is something you'd
>> have to do when you index, Solr doesn't rearrange the
>> contents of a document.
>>
>> If all you want to do is display the results within the document
>> in order, your app can do that as it builds the display page.
>>
>> Best
>> Erick
>>
>> On Wed, Mar 28, 2012 at 9:02 AM, Abhishek tiwari
>> <abhishek.tiwari.tek@gmail.com> wrote:
>> > Hi ,
>> > i have multi valued field want to sort the docs order the particular
>> > text eq:'B1' is added.
>> > how i should query? ad_text is multivalued field.
>> >
>> > t
>> >
>> > <doc>
>> > <arr name="ad_text">
>> > <str>B1</str>
>> > <str>B2</str>
>> > <str>B3</str>
>> > </arr>
>> > </doc>
>> > <doc>
>> > <arr name="ad_text">
>> > <str>B2</str>
>> > <str>B1</str>
>> > <str>B3</str>
>> > </arr>
>> > </doc>
>> >
>> > <doc>
>> > <arr name="ad_text">
>> > <str>B1</str>
>> > <str>B2</str>
>> > <str>B3</str>
>> > </arr>
>> > </doc>
>> > <doc>
>> > <arr name="ad_text">
>> > <str>B3</str>
>> > <str>B2</str>
>> > <str>B1</str>
>> > </arr>
>> > </doc>
>>

Mime
View raw message