Question

I wish that in my solr search the most recent documents which match a title float to the top. For speed I want this done at index-time (not query time).

I tried to boost the score using title and date at index-time (title is boosted but not date value?). Documentation and some stackflow responses suggests it can be done but how? Solr index time boost on document date

Example: I have 4 documents in a json file "datetest.json" with identical titles but different dates.

[{ "id": "test02",
    "title": { "boost": 1, "value": [ "test_title"] },
    "last_update":{ "boost": 2, "value": "2013-04-02T00:00:00Z"}},
{ "id": "test01",
    "title": { "boost": 1, "value": [ "test_title"] },
    "last_update":{ "boost": 2, "value": "2013-04-01T00:00:00Z"}},
{ "id": "test03",
    "title": { "boost": 1, "value": [ "test_title"] },
    "last_update":{ "boost": 2, "value": "2013-04-03T00:00:00Z"}},
{ "id": "test04",
    "title": { "boost": 1, "value": [ "test_title"] },
    "last_update":{ "boost": 2, "value": "2013-04-04T00:00:00Z"}}]

datetest.json is committed using..

curl 'http://localhost.com:8983/solr/update/json?commit=true' --data-binary @datetest.json -H 'Content-type:application/json'

Query is.. http://localhost.com:8983/solr/collection1/select?q=test_title

Hoped for result.. test04->test03->test02->test01

Actual result.. test02->test01->test03->test04

How do I tell solr to boost on the most recent date at index time? Thanks

No correct solution

OTHER TIPS

../collection1/select?q=test_title&sort=last_update desc 

works fine, But this is a query time boost and I would prefer an index-time boost if it is possible.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top