Hi,

Yes, the new sort query worked!. Thank you for the quick response.

Thanks,
Indika

On 8 November 2012 04:31, Rafał Kuć <r....@solr.pl> wrote:

> Hello!
>
> Ahhh, sorry. I see now. The function query you are specifying for the
> sort is not proper. Solr doesn't understand that part:
>
> exists(start_time:[* TO 1721] AND end_time:[1721 TO *])
>
> try something like that:
>
>
> sort=if(exists(query($innerQuery)),100,0)+desc&innerQuery={!edismax}(start_time:[*+TO+1721]
> AND end_time:[1721+TO+*])
>
> However remember that exists function is only Solr 4.0.
>
> I don't have any example data with me right now, so I can't
> say if it will work for sure, but clean Solr 4.0 doesn't cry about
> errors now :)
>
> --
> Regards,
>  Rafał Kuć
>  Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch - ElasticSearch
>
> > Thanks for the response, I did append the sort order but the result was
> the
> > same,
>
> > Can't determine a Sort Order (asc or desc) in sort spec
> > 'if(exists(start_time:[* TO 1721] AND end_time:[1721 TO *]),100,0) asc',
> > pos=23
>
> > Thanks,
> > Indika
>
>
>
> > On 8 November 2012 04:02, Rafał Kuć <r....@solr.pl> wrote:
>
> >> Hello!
> >>
> >> From looking at your sort parameter it seems that you are missing the
> >> order of sorting. The function query will return a value on which
> >> Solr will sort and Solr needs to know if the documents should be
> >> sorted in descending or ascending order. Try something like that:
> >>
> >> sort=if(exists(start_time:[* TO 1721] AND end_time:[1721 TO
> >> *]),100,0)+desc
> >>
> >> --
> >> Regards,
> >>  Rafał Kuć
> >>  Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch -
> ElasticSearch
> >>
> >> > Hi All,
> >>
> >> > I am trying to sort by a boolean function to sort the places that are
> >> open
> >> > and not open as given below
> >>
> >> > sort=if(exists(start_time:[* TO 1721] AND end_time:[1721 TO *]),100,0)
> >>
> >> > However I keep getting an error message saying
> >> > Can't determine a Sort Order (asc or desc) in sort spec
> >> > 'if(exists(start_time:[* TO 1721] AND end_time:[1721 TO *]),100,0)
> asc',
> >> > pos=23
> >>
> >> > I assume that boolean functions can be used to sort. Is there anything
> >> > missing from the sort function ?
> >>
> >> > Thanks,
> >> > Indika
> >>
> >>
>
>

Reply via email to