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 solr-user <so...@hotmail.com> on 2010/08/06 22:47:39 UTC

Re: can't use strdist in sortiing either?

I tried I also noticed that I am unable to sort by the strdist function:

http://localhost:8080/solr/select?q=*:*&sort=strdist("seattle",city,edit)%20desc

Am I using the strdist incorrectly?

The version of Solr I am using is $Id: CHANGES.txt 903398 2010-01-26
20:21:09Z hossman $

I know it isnt the latest version, but I am constrained by needing to keep
to a minimum the number of changes between our current version and the
version that accomplishes the task mentioned previously (essentially a
binary sort that separates results where the city matches a given criteria
from those that dont).

Appreciate any help or advice someone can offer on this
-- 
View this message in context: http://lucene.472066.n3.nabble.com/can-t-use-strdist-as-functionquery-tp1023390p1032200.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: can't use strdist in sorting either?

Posted by solr-user <so...@hotmail.com>.
issue resolved

I should have read the documentation with more care; "Calculate the distance
between two strings"

my city field was a tokenized text field so changing it to string type got
things working

sorry all
-- 
View this message in context: http://lucene.472066.n3.nabble.com/can-t-use-strdist-as-functionquery-tp1023390p1058059.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: can't use strdist in sorting either?

Posted by solr-user <so...@hotmail.com>.
finally figured out that I can simply escape the quotation marks in the query
URL using backslashes to use strdist as a functionquery (sorry all, that
should have been a no-brainer)

http://10.0.11.54:8994/solr/select?q=(*:*)^0%20_val_:"strdist(\"phoenix\",city,edit)"&fl=score,*&sort=score%20desc

however, sorting by the score in this query doesnt work (ie same problem as
when sorting by strdist function - results dont change when I go from asc to
desc or vice-versa).

-- 
View this message in context: http://lucene.472066.n3.nabble.com/can-t-use-strdist-as-functionquery-tp1023390p1057056.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: can't use strdist in sortiing either?

Posted by solr-user <so...@hotmail.com>.
forgot to mention:

1. yes, I upgraded to a version that allows sorting by Functions (thx Grant
for the work done on this feature, very cool)

2. when I try to sort by strdist, it doesnt seem to do any sorting; I get
the same results if I sort asc or desc, if I change the static string value,
if I change the third argument, etc.
-- 
View this message in context: http://lucene.472066.n3.nabble.com/can-t-use-strdist-as-functionquery-tp1023390p1032231.html
Sent from the Solr - User mailing list archive at Nabble.com.