Re: Sort basics
Yes, when I upgraded to version 1.2 of Solr, sort works fine. Thank you for your reply and help. Yonik Seeley wrote: The separate sort parameter for the standard handler is relatively new (as of Solr 1.2) Is that the version of Solr you are using? If so, can you also supply the output Solr gives you as the result of your query? -Yonik On 8/23/07, mel2k [EMAIL PROTECTED] wrote: Hello, I am new to Solr and trying to understand how the sort functionality is working. Thanks in advance for your help on the following questions. I have taken the default download, started Solr and posted the mem.xml. I updated the mem.xml by copying each of the items and changing ONLY the id and price fields. The xml file is shown below. Now when I sort by price it does not seem to work. Simply shows me the documents in the order I have inserted. I was expecting the results that matched the term to be sorted by price despite the 'score'. 1. What am I doing wrong? 2. Does the 'score' overwrite any sort parameter? Or how do I get the list that match 'sdram' in name field sorted by price? Query: http://localhost:8983/solr/select?q=name%3A%28sdram%29sort=price%20ascversion=2.1start=0rows=100fl=name+price+scoreqt=standard Results: response − responseHeader status0/status QTime0/QTime − lst name=params str name=sortprice asc/str str name=flname price score/str str name=start0/str str name=qname:(sdram)/str str name=qtstandard/str str name=version2.1/str str name=rows100/str /lst /responseHeader − result name=response numFound=6 start=0 maxScore=0.30217415 − doc float name=score0.30217415/float − str name=name CORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail /str float name=price374.99/float /doc − doc float name=score0.30217415/float − str name=name A-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - OEM /str /doc − doc float name=score0.30217415/float − str name=name CORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail /str float name=price274.99/float /doc − doc float name=score0.30217415/float − str name=name A-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - OEM /str /doc − doc float name=score0.2590064/float − str name=name CORSAIR XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail /str float name=price3185.0/float /doc − doc float name=score0.2590064/float − str name=name CORSAIR XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail /str float name=price2185.0/float /doc /result /response Data file posted: ?xml version=1.0 ? add doc field name=idTWINX2048-3200PRO/field field name=nameCORSAIR XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail/field field name=manuCorsair Microsystems Inc./field field name=catelectronics/field field name=catmemory/field field name=featuresCAS latency 2, 2-3-3-6 timing, 2.75v, unbuffered, heat-spreader/field field name=price3185/field field name=popularity5/field field name=inStocktrue/field /doc doc field name=idVS1GB400C3/field field name=nameCORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail/field field name=manuCorsair Microsystems Inc./field field name=catelectronics/field field name=catmemory/field field name=price374.99/field field name=popularity7/field field name=inStocktrue/field /doc doc field name=idVDBDB1A16/field field name=nameA-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - OEM/field field name=manuA-DATA Technology Inc./field field name=catelectronics/field field name=catmemory/field field name=featuresCAS latency 3, 2.7v/field !-- note: price is missing on this one -- field name=popularity5/field field name=inStocktrue/field /doc doc field name=id2TWINX2048-3200PRO/field field name=nameCORSAIR XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail/field field name=manu2Corsair Microsystems Inc./field field name=catelectronics/field field name=catmemory/field field name=featuresCAS latency 2, 2-3-3-6 timing, 2.75v, unbuffered, heat-spreader/field field name=price2185/field field name=popularity5/field field name=inStocktrue/field /doc doc field name=id2VS1GB400C3/field field name=nameCORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail/field field name=manu2Corsair Microsystems Inc./field field name=catelectronics/field field name
Sort basics
Hello, I am new to Solr and trying to understand how the sort functionality is working. Thanks in advance for your help on the following questions. I have taken the default download, started Solr and posted the mem.xml. I updated the mem.xml by copying each of the items and changing ONLY the id and price fields. The xml file is shown below. Now when I sort by price it does not seem to work. Simply shows me the documents in the order I have inserted. I was expecting the results that matched the term to be sorted by price despite the 'score'. 1. What am I doing wrong? 2. Does the 'score' overwrite any sort parameter? Or how do I get the list that match 'sdram' in name field sorted by price? Query: http://localhost:8983/solr/select?q=name%3A%28sdram%29sort=price%20ascversion=2.1start=0rows=100fl=name+price+scoreqt=standard Results: response − responseHeader status0/status QTime0/QTime − lst name=params str name=sortprice asc/str str name=flname price score/str str name=start0/str str name=qname:(sdram)/str str name=qtstandard/str str name=version2.1/str str name=rows100/str /lst /responseHeader − result name=response numFound=6 start=0 maxScore=0.30217415 − doc float name=score0.30217415/float − str name=name CORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail /str float name=price374.99/float /doc − doc float name=score0.30217415/float − str name=name A-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - OEM /str /doc − doc float name=score0.30217415/float − str name=name CORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail /str float name=price274.99/float /doc − doc float name=score0.30217415/float − str name=name A-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - OEM /str /doc − doc float name=score0.2590064/float − str name=name CORSAIR XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail /str float name=price3185.0/float /doc − doc float name=score0.2590064/float − str name=name CORSAIR XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail /str float name=price2185.0/float /doc /result /response Data file posted: ?xml version=1.0 ? add doc field name=idTWINX2048-3200PRO/field field name=nameCORSAIR XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail/field field name=manuCorsair Microsystems Inc./field field name=catelectronics/field field name=catmemory/field field name=featuresCAS latency 2, 2-3-3-6 timing, 2.75v, unbuffered, heat-spreader/field field name=price3185/field field name=popularity5/field field name=inStocktrue/field /doc doc field name=idVS1GB400C3/field field name=nameCORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail/field field name=manuCorsair Microsystems Inc./field field name=catelectronics/field field name=catmemory/field field name=price374.99/field field name=popularity7/field field name=inStocktrue/field /doc doc field name=idVDBDB1A16/field field name=nameA-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - OEM/field field name=manuA-DATA Technology Inc./field field name=catelectronics/field field name=catmemory/field field name=featuresCAS latency 3, 2.7v/field !-- note: price is missing on this one -- field name=popularity5/field field name=inStocktrue/field /doc doc field name=id2TWINX2048-3200PRO/field field name=nameCORSAIR XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail/field field name=manu2Corsair Microsystems Inc./field field name=catelectronics/field field name=catmemory/field field name=featuresCAS latency 2, 2-3-3-6 timing, 2.75v, unbuffered, heat-spreader/field field name=price2185/field field name=popularity5/field field name=inStocktrue/field /doc doc field name=id2VS1GB400C3/field field name=nameCORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail/field field name=manu2Corsair Microsystems Inc./field field name=catelectronics/field field name=catmemory/field field name=price274.99/field field name=popularity7/field field name=inStocktrue/field /doc doc field name=id2VDBDB1A16/field field name=nameA-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - OEM/field field name=manu2A-DATA Technology Inc./field field name=catelectronics/field field name=catmemory/field field name=featuresCAS latency 3, 2.7v/field !-- note: price is missing on this one -- field name=popularity5/field field name=inStocktrue/field /doc /add -- View this