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 Gustav <xb...@sharklasers.com> on 2013/09/25 17:34:33 UTC

Solr sorting situation!

Hey guys, I know that sorting in Solr works as a cascade, but i'm kind stuck
in a rough situation:


I've got the following sort fields in a Product:
ProductSequence(0~99
default=99),ProductName(text_general),ProductType(0~1),ProductHasPrinciples(0~1),ProductInStock(0~1),ProductPrice(0~999,99)

Then, i must apply the following rules to these products(i'll put the
sorting i've done so far)

1 - Sort by the Product Sequence Field

	Ok, easy! &sort=ProductSequence asc
	
2 - Sort by the product name inputed(that means, the product who got the
input search in name will come first), in which those, will be sorted by
price ascending

	So far, so good! &sort=ProductSequence asc, rint(query({!edismax
qf=ProductName v=searchTerm})) desc, price asc
	
3 - And now, my problem! Then, sort the rest of the products, first those
who ProducType = 1 in which:
		ProductHasPrinciples = 1 will be sorted by price ascending
		ProductHasPrinciples = 0 will be sorted by price ascending
		
	Oh boy! &sort=ProductSequence asc, rint(query({!edismax qf=ProductName
v=searchTerm})) desc, price asc, productType desc,ProductHasPrinciples desc,
price asc?????
	
	That didnt work, because it doesnt attend the third "Product type=1" rule,
so i tried:
	
	&sort=ProductSequence asc, rint(query({!edismax qf=ProductName
v=searchTerm})) desc, productType desc,ProductHasPrinciples desc, price
asc?????
	
	Which also didnt work, cause it breaks the second rule "Price ascending
sorting"
	

Any ideas/suggestions?

Thanks :)



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-sorting-situation-tp4091966.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr sorting situation!

Posted by Gustav <xb...@sharklasers.com>.
Anyone with any ideas?



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-sorting-situation-tp4091966p4092688.html
Sent from the Solr - User mailing list archive at Nabble.com.