0

I have read many forums and followed a couple of suggestions but I cannot get this to work. I get the results in the reverse order, i.e., the oldest first despite boosting by a non-multivalued date field.

The field specified in schema

<field name="last_modified" type="tdate" indexed="true" stored="true" multiValued="false"/>

and

<fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>

I have tried with and without omitNorms and with varying values for precisionStep in case that plays any role in boosting a field.

I have tried all the queries specified here. For instance,

http://localhost:8983/solr/select?q={!boost b=$dateboost v=$qq}&dateboost=recip(ms(NOW,last_modified),3.16e-11,1,1)&qq=1234

Additionally, I have tried

defType=dismax&bf=recip(rord(last_modified),1,1000,1000)^2.5&q=1234

I also do a sorting, just plain sorting that discards any relevance scores.

q=1234; last_modified asc;

Actually, I try both asc and desc. Quite strange. Why do I still see the latest modified document last and the oldest document first? What is that I am doing wrong? Any help appreciated!

sehe
  • 374,641
  • 47
  • 450
  • 633
user592748
  • 1,194
  • 3
  • 21
  • 45
  • How does one check contents of the index? When I queried using solr, the dates stored in each document is different. – user592748 Mar 05 '14 at 07:43

1 Answers1

0

Unlikely this gives you the sorting order on last_modified

q=1234; last_modified asc;

Perhaps you meant

q=1234&sort=last_modified desc
leoh
  • 10,378
  • 7
  • 28
  • 39
  • I tried both. But the order remains. For instance, this order always remains 2014-03-04T04:07:16.515Z // 2014-03-04T04:07:21.677Z // 2014-03-04T04:07:22.433Z // – user592748 Mar 05 '14 at 07:41
  • I see.Sorting may rely on the precisionStep. The higher the value, the less precisions... You might want to try precisionStep="0" to see if it works. Note that the smaller the precisionStep, the bigger index size http://lucene.apache.org/core/4_5_0/core/org/apache/lucene/search/NumericRangeQuery.html – leoh Mar 05 '14 at 15:06
  • Oh, well. I had tried with date which has a precision step 0. But the same result. Do you think the format in which the date is stored is alright? – user592748 Mar 05 '14 at 16:28