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 Dmitry Kan <dm...@gmail.com> on 2011/05/18 13:21:39 UTC

sorting on date field in facet query

Hello list,

Is it possible to sort on date field in a facet query in SOLR 3.1?

-- 
Regards,

Dmitry Kan

Re: sorting on date field in facet query

Posted by Dmitry Kan <dm...@gmail.com>.
Hi,

1. Is it possible to produce the collapsed docs count in the same query?
2. What is the performance of Field Collapsing versus Facet Search?

Dmitry

On Thu, May 19, 2011 at 5:36 PM, kenf_nc <ke...@realestate.com> wrote:

> This is more a speculation than direction, I don't currently use Field
> Collapsing but my take on it is that it returns the number of docs
> collapsed. So instead of faceting could you do a search returning DocID,
> collapsing on DocID sorting on date, then the count of collapsed docs
> *should* match the facet count?
>
> Just wondering.
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/sorting-on-date-field-in-facet-query-tp2956540p2961612.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Regards,

Dmitry Kan

Re: sorting on date field in facet query

Posted by Dmitry Kan <dm...@gmail.com>.
Wanted to say thanks to everyone contributed: Erick, Stefan, kenf_nc.
Erick a solution based on your proposition has been implemented and
pushed to users. Thanks!

Best

On 5/19/11, Erick Erickson <er...@gmail.com> wrote:
> Oooh, that's clever....
>
> The glitch is that field collapsing is scheduled for 3.2, but that
> probably means
> the patch is close to being applicable to 3.1 but I don't know that for
> sure.
>
> Erick
>
> On Thu, May 19, 2011 at 10:36 AM, kenf_nc <ke...@realestate.com> wrote:
>> This is more a speculation than direction, I don't currently use Field
>> Collapsing but my take on it is that it returns the number of docs
>> collapsed. So instead of faceting could you do a search returning DocID,
>> collapsing on DocID sorting on date, then the count of collapsed docs
>> *should* match the facet count?
>>
>> Just wondering.
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/sorting-on-date-field-in-facet-query-tp2956540p2961612.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>


-- 
Regards,

Dmitry Kan

Re: sorting on date field in facet query

Posted by Erick Erickson <er...@gmail.com>.
Oooh, that's clever....

The glitch is that field collapsing is scheduled for 3.2, but that
probably means
the patch is close to being applicable to 3.1 but I don't know that for sure.

Erick

On Thu, May 19, 2011 at 10:36 AM, kenf_nc <ke...@realestate.com> wrote:
> This is more a speculation than direction, I don't currently use Field
> Collapsing but my take on it is that it returns the number of docs
> collapsed. So instead of faceting could you do a search returning DocID,
> collapsing on DocID sorting on date, then the count of collapsed docs
> *should* match the facet count?
>
> Just wondering.
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/sorting-on-date-field-in-facet-query-tp2956540p2961612.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: sorting on date field in facet query

Posted by kenf_nc <ke...@realestate.com>.
This is more a speculation than direction, I don't currently use Field
Collapsing but my take on it is that it returns the number of docs
collapsed. So instead of faceting could you do a search returning DocID,
collapsing on DocID sorting on date, then the count of collapsed docs
*should* match the facet count?

Just wondering.

--
View this message in context: http://lucene.472066.n3.nabble.com/sorting-on-date-field-in-facet-query-tp2956540p2961612.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: sorting on date field in facet query

Posted by Dmitry Kan <dm...@gmail.com>.
Thanks Erick, this sounds solid to me!

It of course will require the repost of the entire index (pretty big one,
sharded), but that's not an issue as we periodically do that anyway.

Thanks and regards,

Dmitry

On Thu, May 19, 2011 at 5:08 PM, Erick Erickson <er...@gmail.com>wrote:

> Oh, isn't that ducky. The facet.sort parameter only sorts ascending
> as far as I can tell. Which is exactly the reverse of what you want.
>
> Would it work to cleverly encode the facet field to do what you want
> just by a lexical sort? Something like use a very large constant,
> subtract the date for each record from that and then put that in a
> new field that you facet/sort by? Then un-transform it for display? Let's
> say you have a range from 0-9. Then your facet field could be
> something like
> original doc values
> doc 1: 2 <- oldest
> doc 2: 5
> doc 3: 8  <- newest
>
> You'd store values like these in "facetme" (9 - orig value) + text
> doc1: 7_docid1
> doc2: 4_docid2
> doc3: 1_docid3
>
> Now a natural ordering (facet.sort=index) wold return them in
> date order. If this was a well-defined process you could easily
> transform it back for proper display. Although watch out for
> leading zeros!
>
> Thinking off the top of my head here....
>
> Erick
>
> On Thu, May 19, 2011 at 9:46 AM, Dmitry Kan <dm...@gmail.com> wrote:
> > Hi,
> >
> > Thanks for the questions, guys, and sorry for the confusion. I should
> start
> > with a broader picture of what we are trying to achieve. The only problem
> is
> > that I cannot speak about specifics of the task we are solving the way we
> > do. We currently sort the facets on the client side, having the date
> values
> > at hand (done by an boolean query to SOLR with a list of ids). However,
> > sometimes we have "glitches", that is since we limit the facets to first
> > facet.limit ones, and there is no "date boosting" we may have some facet
> > counts end up beyond the facet counts range and that's sad. One way
> around
> > it would be to facet with pagination, where a page would correspond to a
> > date subrange in the range of required dates. But we haven't tried it yet
> > before we investigate what can be done inside SOLR (by modifying its
> source
> > code, if needed).
> >
> > So as said every solr doc that has some id in the solr index (this id is
> > used to combine several solr docs logically, only that purpose; this
> design
> > comes from the task definition) has a date field, and the value of that
> date
> > field is always same for a given doc id across all the solr docs with the
> > same doc id.
> >
> > Now, taking the Stefan's example, I would like to sort desc the facets by
> > date (yes, date boosting during the facet gathering process) that were
> > calculated against someStr field:
> >
> > <int name="T-AS_1386181">
> > 45
> > </int>
> > <int name="T-AS_1386229">
> > 54
> > </int>
> >
> > So SOLR facet component would ignore the counts and sort the facets by
> dates
> > desc (in reverse chronological order).
> >
> > Is it possible to implement such a solution through some class
> inheritance
> > in facet component?
> >
> > Regards,
> >
> > Dmitry
> >
> > On Thu, May 19, 2011 at 4:25 PM, Stefan Matheis <
> > matheis.stefan@googlemail.com> wrote:
> >
> >> Dmitry,
> >>
> >> how should that work? Take a this short sample-data:
> >>
> >> id | date
> >> T-AS_1386229 | 1995-12-31T23:59:59Z
> >> T-AS_1386181 | 1996-12-31T23:59:59Z
> >> T-AS_1386229 | 1997-12-31T23:59:59Z
> >>
> >> So, you'll have two facets for the ids .. but how should they be
> >> sorted? One (of the two) is the first and the other the last Document
> >> .. so, sort by lowest date? highest date? i guess, that would/could
> >> not really work.
> >>
> >> Perhaps we have to ask another Question .. what are you trying to
> >> achieve? "Boost by Date"?
> >>
> >> Regards
> >> Stefan
> >>
> >> On Thu, May 19, 2011 at 2:24 PM, Dmitry Kan <dm...@gmail.com>
> wrote:
> >> > Hi Erick,
> >> >
> >> > It is about ordering the facet information. The result set is empty
> via
> >> > rows=0.
> >> >
> >> > Here is the logics and example:
> >> >
> >> > Each doc has string field someStr and a date field associated with it,
> >> and
> >> > same doc id has same value of the date field. Question: is it possible
> to
> >> > sort the facet values given below on that date field?
> >> >
> >> > curl
> >> >
> >>
> http://localhost:8983/solr/select?q=someStr:network&facet=true&facet.field=id&facet.limit=1000&facet.mincount=1&rows=0
> >> >
> >> > result excerpt:
> >> >
> >> > <lst name="facet_fields">
> >> > <lst name="id">
> >> > <int name="T-AS_1386229">
> >> > 54
> >> > </int>
> >> > <int name="T-AS_1386181">
> >> > 45
> >> > </int>
> >> > <int name="T-CP_1370095">
> >> > 36
> >> > </int>
> >> > <int name="T-AS_1377809">
> >> > 25
> >> > </int>
> >> > <int name="T-CP_1380207">
> >> > 18
> >> > </int>
> >> > <int name="T-CP_1373820">
> >> > 11
> >> > </int>
> >> > <int name="T-AS_1372073-1">
> >> > 8
> >> > </int>
> >> > <int name="T-AS_1367577">
> >> > 6
> >> > </int>
> >> > <int name="T-AS_1383141">
> >> > 5
> >> > </int>
> >> > <int name="T-AS_1383648-1">
> >> > 5
> >> > </int>
> >> > <int name="T-AS_1351183-1">
> >> > 4
> >> > </int>
> >> > </lst>
> >> > </lst>
> >> >
> >> >
> >> > Regards,
> >> >
> >> > Dmitry
> >> >
> >> >
> >> >
> >> >
> >> > On Wed, May 18, 2011 at 3:33 PM, Erick Erickson <
> erickerickson@gmail.com
> >> >wrote:
> >> >
> >> >> Can you provide an example of what you are trying to do? Are you
> >> >> referring to ordering the result set or the facet information?
> >> >>
> >> >> Best
> >> >> Erick
> >> >>
> >> >> On Wed, May 18, 2011 at 7:21 AM, Dmitry Kan <dm...@gmail.com>
> >> wrote:
> >> >> > Hello list,
> >> >> >
> >> >> > Is it possible to sort on date field in a facet query in SOLR 3.1?
> >> >> >
> >> >> > --
> >> >> > Regards,
> >> >> >
> >> >> > Dmitry Kan
> >> >> >
> >> >>
> >> >
> >>
> >
>

Re: sorting on date field in facet query

Posted by Erick Erickson <er...@gmail.com>.
Oh, isn't that ducky. The facet.sort parameter only sorts ascending
as far as I can tell. Which is exactly the reverse of what you want.

Would it work to cleverly encode the facet field to do what you want
just by a lexical sort? Something like use a very large constant,
subtract the date for each record from that and then put that in a
new field that you facet/sort by? Then un-transform it for display? Let's
say you have a range from 0-9. Then your facet field could be
something like
original doc values
doc 1: 2 <- oldest
doc 2: 5
doc 3: 8  <- newest

You'd store values like these in "facetme" (9 - orig value) + text
doc1: 7_docid1
doc2: 4_docid2
doc3: 1_docid3

Now a natural ordering (facet.sort=index) wold return them in
date order. If this was a well-defined process you could easily
transform it back for proper display. Although watch out for
leading zeros!

Thinking off the top of my head here....

Erick

On Thu, May 19, 2011 at 9:46 AM, Dmitry Kan <dm...@gmail.com> wrote:
> Hi,
>
> Thanks for the questions, guys, and sorry for the confusion. I should start
> with a broader picture of what we are trying to achieve. The only problem is
> that I cannot speak about specifics of the task we are solving the way we
> do. We currently sort the facets on the client side, having the date values
> at hand (done by an boolean query to SOLR with a list of ids). However,
> sometimes we have "glitches", that is since we limit the facets to first
> facet.limit ones, and there is no "date boosting" we may have some facet
> counts end up beyond the facet counts range and that's sad. One way around
> it would be to facet with pagination, where a page would correspond to a
> date subrange in the range of required dates. But we haven't tried it yet
> before we investigate what can be done inside SOLR (by modifying its source
> code, if needed).
>
> So as said every solr doc that has some id in the solr index (this id is
> used to combine several solr docs logically, only that purpose; this design
> comes from the task definition) has a date field, and the value of that date
> field is always same for a given doc id across all the solr docs with the
> same doc id.
>
> Now, taking the Stefan's example, I would like to sort desc the facets by
> date (yes, date boosting during the facet gathering process) that were
> calculated against someStr field:
>
> <int name="T-AS_1386181">
> 45
> </int>
> <int name="T-AS_1386229">
> 54
> </int>
>
> So SOLR facet component would ignore the counts and sort the facets by dates
> desc (in reverse chronological order).
>
> Is it possible to implement such a solution through some class inheritance
> in facet component?
>
> Regards,
>
> Dmitry
>
> On Thu, May 19, 2011 at 4:25 PM, Stefan Matheis <
> matheis.stefan@googlemail.com> wrote:
>
>> Dmitry,
>>
>> how should that work? Take a this short sample-data:
>>
>> id | date
>> T-AS_1386229 | 1995-12-31T23:59:59Z
>> T-AS_1386181 | 1996-12-31T23:59:59Z
>> T-AS_1386229 | 1997-12-31T23:59:59Z
>>
>> So, you'll have two facets for the ids .. but how should they be
>> sorted? One (of the two) is the first and the other the last Document
>> .. so, sort by lowest date? highest date? i guess, that would/could
>> not really work.
>>
>> Perhaps we have to ask another Question .. what are you trying to
>> achieve? "Boost by Date"?
>>
>> Regards
>> Stefan
>>
>> On Thu, May 19, 2011 at 2:24 PM, Dmitry Kan <dm...@gmail.com> wrote:
>> > Hi Erick,
>> >
>> > It is about ordering the facet information. The result set is empty via
>> > rows=0.
>> >
>> > Here is the logics and example:
>> >
>> > Each doc has string field someStr and a date field associated with it,
>> and
>> > same doc id has same value of the date field. Question: is it possible to
>> > sort the facet values given below on that date field?
>> >
>> > curl
>> >
>> http://localhost:8983/solr/select?q=someStr:network&facet=true&facet.field=id&facet.limit=1000&facet.mincount=1&rows=0
>> >
>> > result excerpt:
>> >
>> > <lst name="facet_fields">
>> > <lst name="id">
>> > <int name="T-AS_1386229">
>> > 54
>> > </int>
>> > <int name="T-AS_1386181">
>> > 45
>> > </int>
>> > <int name="T-CP_1370095">
>> > 36
>> > </int>
>> > <int name="T-AS_1377809">
>> > 25
>> > </int>
>> > <int name="T-CP_1380207">
>> > 18
>> > </int>
>> > <int name="T-CP_1373820">
>> > 11
>> > </int>
>> > <int name="T-AS_1372073-1">
>> > 8
>> > </int>
>> > <int name="T-AS_1367577">
>> > 6
>> > </int>
>> > <int name="T-AS_1383141">
>> > 5
>> > </int>
>> > <int name="T-AS_1383648-1">
>> > 5
>> > </int>
>> > <int name="T-AS_1351183-1">
>> > 4
>> > </int>
>> > </lst>
>> > </lst>
>> >
>> >
>> > Regards,
>> >
>> > Dmitry
>> >
>> >
>> >
>> >
>> > On Wed, May 18, 2011 at 3:33 PM, Erick Erickson <erickerickson@gmail.com
>> >wrote:
>> >
>> >> Can you provide an example of what you are trying to do? Are you
>> >> referring to ordering the result set or the facet information?
>> >>
>> >> Best
>> >> Erick
>> >>
>> >> On Wed, May 18, 2011 at 7:21 AM, Dmitry Kan <dm...@gmail.com>
>> wrote:
>> >> > Hello list,
>> >> >
>> >> > Is it possible to sort on date field in a facet query in SOLR 3.1?
>> >> >
>> >> > --
>> >> > Regards,
>> >> >
>> >> > Dmitry Kan
>> >> >
>> >>
>> >
>>
>

Re: sorting on date field in facet query

Posted by Dmitry Kan <dm...@gmail.com>.
Hi,

Thanks for the questions, guys, and sorry for the confusion. I should start
with a broader picture of what we are trying to achieve. The only problem is
that I cannot speak about specifics of the task we are solving the way we
do. We currently sort the facets on the client side, having the date values
at hand (done by an boolean query to SOLR with a list of ids). However,
sometimes we have "glitches", that is since we limit the facets to first
facet.limit ones, and there is no "date boosting" we may have some facet
counts end up beyond the facet counts range and that's sad. One way around
it would be to facet with pagination, where a page would correspond to a
date subrange in the range of required dates. But we haven't tried it yet
before we investigate what can be done inside SOLR (by modifying its source
code, if needed).

So as said every solr doc that has some id in the solr index (this id is
used to combine several solr docs logically, only that purpose; this design
comes from the task definition) has a date field, and the value of that date
field is always same for a given doc id across all the solr docs with the
same doc id.

Now, taking the Stefan's example, I would like to sort desc the facets by
date (yes, date boosting during the facet gathering process) that were
calculated against someStr field:

<int name="T-AS_1386181">
45
</int>
<int name="T-AS_1386229">
54
</int>

So SOLR facet component would ignore the counts and sort the facets by dates
desc (in reverse chronological order).

Is it possible to implement such a solution through some class inheritance
in facet component?

Regards,

Dmitry

On Thu, May 19, 2011 at 4:25 PM, Stefan Matheis <
matheis.stefan@googlemail.com> wrote:

> Dmitry,
>
> how should that work? Take a this short sample-data:
>
> id | date
> T-AS_1386229 | 1995-12-31T23:59:59Z
> T-AS_1386181 | 1996-12-31T23:59:59Z
> T-AS_1386229 | 1997-12-31T23:59:59Z
>
> So, you'll have two facets for the ids .. but how should they be
> sorted? One (of the two) is the first and the other the last Document
> .. so, sort by lowest date? highest date? i guess, that would/could
> not really work.
>
> Perhaps we have to ask another Question .. what are you trying to
> achieve? "Boost by Date"?
>
> Regards
> Stefan
>
> On Thu, May 19, 2011 at 2:24 PM, Dmitry Kan <dm...@gmail.com> wrote:
> > Hi Erick,
> >
> > It is about ordering the facet information. The result set is empty via
> > rows=0.
> >
> > Here is the logics and example:
> >
> > Each doc has string field someStr and a date field associated with it,
> and
> > same doc id has same value of the date field. Question: is it possible to
> > sort the facet values given below on that date field?
> >
> > curl
> >
> http://localhost:8983/solr/select?q=someStr:network&facet=true&facet.field=id&facet.limit=1000&facet.mincount=1&rows=0
> >
> > result excerpt:
> >
> > <lst name="facet_fields">
> > <lst name="id">
> > <int name="T-AS_1386229">
> > 54
> > </int>
> > <int name="T-AS_1386181">
> > 45
> > </int>
> > <int name="T-CP_1370095">
> > 36
> > </int>
> > <int name="T-AS_1377809">
> > 25
> > </int>
> > <int name="T-CP_1380207">
> > 18
> > </int>
> > <int name="T-CP_1373820">
> > 11
> > </int>
> > <int name="T-AS_1372073-1">
> > 8
> > </int>
> > <int name="T-AS_1367577">
> > 6
> > </int>
> > <int name="T-AS_1383141">
> > 5
> > </int>
> > <int name="T-AS_1383648-1">
> > 5
> > </int>
> > <int name="T-AS_1351183-1">
> > 4
> > </int>
> > </lst>
> > </lst>
> >
> >
> > Regards,
> >
> > Dmitry
> >
> >
> >
> >
> > On Wed, May 18, 2011 at 3:33 PM, Erick Erickson <erickerickson@gmail.com
> >wrote:
> >
> >> Can you provide an example of what you are trying to do? Are you
> >> referring to ordering the result set or the facet information?
> >>
> >> Best
> >> Erick
> >>
> >> On Wed, May 18, 2011 at 7:21 AM, Dmitry Kan <dm...@gmail.com>
> wrote:
> >> > Hello list,
> >> >
> >> > Is it possible to sort on date field in a facet query in SOLR 3.1?
> >> >
> >> > --
> >> > Regards,
> >> >
> >> > Dmitry Kan
> >> >
> >>
> >
>

Re: sorting on date field in facet query

Posted by Stefan Matheis <ma...@googlemail.com>.
Dmitry,

how should that work? Take a this short sample-data:

id | date
T-AS_1386229 | 1995-12-31T23:59:59Z
T-AS_1386181 | 1996-12-31T23:59:59Z
T-AS_1386229 | 1997-12-31T23:59:59Z

So, you'll have two facets for the ids .. but how should they be
sorted? One (of the two) is the first and the other the last Document
.. so, sort by lowest date? highest date? i guess, that would/could
not really work.

Perhaps we have to ask another Question .. what are you trying to
achieve? "Boost by Date"?

Regards
Stefan

On Thu, May 19, 2011 at 2:24 PM, Dmitry Kan <dm...@gmail.com> wrote:
> Hi Erick,
>
> It is about ordering the facet information. The result set is empty via
> rows=0.
>
> Here is the logics and example:
>
> Each doc has string field someStr and a date field associated with it, and
> same doc id has same value of the date field. Question: is it possible to
> sort the facet values given below on that date field?
>
> curl
> http://localhost:8983/solr/select?q=someStr:network&facet=true&facet.field=id&facet.limit=1000&facet.mincount=1&rows=0
>
> result excerpt:
>
> <lst name="facet_fields">
> <lst name="id">
> <int name="T-AS_1386229">
> 54
> </int>
> <int name="T-AS_1386181">
> 45
> </int>
> <int name="T-CP_1370095">
> 36
> </int>
> <int name="T-AS_1377809">
> 25
> </int>
> <int name="T-CP_1380207">
> 18
> </int>
> <int name="T-CP_1373820">
> 11
> </int>
> <int name="T-AS_1372073-1">
> 8
> </int>
> <int name="T-AS_1367577">
> 6
> </int>
> <int name="T-AS_1383141">
> 5
> </int>
> <int name="T-AS_1383648-1">
> 5
> </int>
> <int name="T-AS_1351183-1">
> 4
> </int>
> </lst>
> </lst>
>
>
> Regards,
>
> Dmitry
>
>
>
>
> On Wed, May 18, 2011 at 3:33 PM, Erick Erickson <er...@gmail.com>wrote:
>
>> Can you provide an example of what you are trying to do? Are you
>> referring to ordering the result set or the facet information?
>>
>> Best
>> Erick
>>
>> On Wed, May 18, 2011 at 7:21 AM, Dmitry Kan <dm...@gmail.com> wrote:
>> > Hello list,
>> >
>> > Is it possible to sort on date field in a facet query in SOLR 3.1?
>> >
>> > --
>> > Regards,
>> >
>> > Dmitry Kan
>> >
>>
>

Re: sorting on date field in facet query

Posted by Erick Erickson <er...@gmail.com>.
The only two ways to influence facet order is by count and alphabetically.

facet.sort=index will sort by alpha, the default is facet.sort=count

All that said, I still don't quite understand what you're asking for. Facets
are simply a count of the documents that have unique values for, in your
case, the "id" field. It doesn't make sense to sort the returned facets
by some other field. You can facet on the other field and sort *that*.

Sorting the documents returned is unrelated, but I don't think that's what
you're asking...

Or I completely miss the point...

Best
Erick

On Thu, May 19, 2011 at 8:24 AM, Dmitry Kan <dm...@gmail.com> wrote:
> Hi Erick,
>
> It is about ordering the facet information. The result set is empty via
> rows=0.
>
> Here is the logics and example:
>
> Each doc has string field someStr and a date field associated with it, and
> same doc id has same value of the date field. Question: is it possible to
> sort the facet values given below on that date field?
>
> curl
> http://localhost:8983/solr/select?q=someStr:network&facet=true&facet.field=id&facet.limit=1000&facet.mincount=1&rows=0
>
> result excerpt:
>
> <lst name="facet_fields">
> <lst name="id">
> <int name="T-AS_1386229">
> 54
> </int>
> <int name="T-AS_1386181">
> 45
> </int>
> <int name="T-CP_1370095">
> 36
> </int>
> <int name="T-AS_1377809">
> 25
> </int>
> <int name="T-CP_1380207">
> 18
> </int>
> <int name="T-CP_1373820">
> 11
> </int>
> <int name="T-AS_1372073-1">
> 8
> </int>
> <int name="T-AS_1367577">
> 6
> </int>
> <int name="T-AS_1383141">
> 5
> </int>
> <int name="T-AS_1383648-1">
> 5
> </int>
> <int name="T-AS_1351183-1">
> 4
> </int>
> </lst>
> </lst>
>
>
> Regards,
>
> Dmitry
>
>
>
>
> On Wed, May 18, 2011 at 3:33 PM, Erick Erickson <er...@gmail.com>wrote:
>
>> Can you provide an example of what you are trying to do? Are you
>> referring to ordering the result set or the facet information?
>>
>> Best
>> Erick
>>
>> On Wed, May 18, 2011 at 7:21 AM, Dmitry Kan <dm...@gmail.com> wrote:
>> > Hello list,
>> >
>> > Is it possible to sort on date field in a facet query in SOLR 3.1?
>> >
>> > --
>> > Regards,
>> >
>> > Dmitry Kan
>> >
>>
>

Re: sorting on date field in facet query

Posted by Dmitry Kan <dm...@gmail.com>.
Hi Erick,

It is about ordering the facet information. The result set is empty via
rows=0.

Here is the logics and example:

Each doc has string field someStr and a date field associated with it, and
same doc id has same value of the date field. Question: is it possible to
sort the facet values given below on that date field?

curl
http://localhost:8983/solr/select?q=someStr:network&facet=true&facet.field=id&facet.limit=1000&facet.mincount=1&rows=0

result excerpt:

<lst name="facet_fields">
<lst name="id">
<int name="T-AS_1386229">
54
</int>
<int name="T-AS_1386181">
45
</int>
<int name="T-CP_1370095">
36
</int>
<int name="T-AS_1377809">
25
</int>
<int name="T-CP_1380207">
18
</int>
<int name="T-CP_1373820">
11
</int>
<int name="T-AS_1372073-1">
8
</int>
<int name="T-AS_1367577">
6
</int>
<int name="T-AS_1383141">
5
</int>
<int name="T-AS_1383648-1">
5
</int>
<int name="T-AS_1351183-1">
4
</int>
</lst>
</lst>


Regards,

Dmitry




On Wed, May 18, 2011 at 3:33 PM, Erick Erickson <er...@gmail.com>wrote:

> Can you provide an example of what you are trying to do? Are you
> referring to ordering the result set or the facet information?
>
> Best
> Erick
>
> On Wed, May 18, 2011 at 7:21 AM, Dmitry Kan <dm...@gmail.com> wrote:
> > Hello list,
> >
> > Is it possible to sort on date field in a facet query in SOLR 3.1?
> >
> > --
> > Regards,
> >
> > Dmitry Kan
> >
>

Re: sorting on date field in facet query

Posted by Erick Erickson <er...@gmail.com>.
Can you provide an example of what you are trying to do? Are you
referring to ordering the result set or the facet information?

Best
Erick

On Wed, May 18, 2011 at 7:21 AM, Dmitry Kan <dm...@gmail.com> wrote:
> Hello list,
>
> Is it possible to sort on date field in a facet query in SOLR 3.1?
>
> --
> Regards,
>
> Dmitry Kan
>