Sorry, but Solr doesn't perform SQL-like operations.
But, please rephrase your "query" in simple, plain English, and we'll be
happy to suggest approaches using Solr.
Starting principle: When you think "Solr", think "NoSQL". You're still
thinking SQL!
That said, generally, SQL "order by" refers to sorting, and Solr does have a
"sort" parameter:
http://wiki.apache.org/solr/CommonQueryParameters#sort
-- Jack Krupansky
-----Original Message-----
From: cmd.ares
Sent: Saturday, July 20, 2013 2:51 AM
To: solr-user@lucene.apache.org
Subject: Order by an expression in Solr
In SQL you can order by an expression like:
SELECT * FROM TABLE1 ORDER BY
(
CASE WHEN COL1 BETWEEN ${PARAM1} - 10 AND ${PARAM1} + 10 AND COL2=${PARAM2}
THEN 1
WHEN COL1 BETWEEN ${PARAM1} - 10 AND ${PARAM1} + 10 AND
COL3=${PARAM2} THEN 2
WHEN COL1 - COL3=${PARAM3} THEN 3
WHEN COL4 LIKE '${PARAM4}%' THEN 4
END
)
AND HOW TO DO THAT IN SOLR?
THANKS!
--
View this message in context:
http://lucene.472066.n3.nabble.com/Order-by-an-expression-in-Solr-tp4079270.html
Sent from the Solr - User mailing list archive at Nabble.com.