Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Solr data import handler support custom variables?

I currently have an issue with my data import handler where ${dataimporter.last_index_time} is not granular enough to capture two events that happen within a second of each other, leading to issues where a record is skipped over in my database.

I am thinking to replace last_index_time with a simple atomically incrementing value as opposed to a datetime, but in order to do that I need to be able to set and read custom variables through solr that can be referenced in my data-config.xml file.

Alternatively, if I could find some way to set dataimporter.last_index_time, that would work just as well as I could ensure that the last_index_time is less than the newly-committed rows (and more importantly, that it is set from the same clock).

Does Solr support this?

like image 496
devios1 Avatar asked Feb 01 '26 21:02

devios1


1 Answers

Short answer: Yes it does

Long answer:

At work I'm passing parameters in request (DataImportHandler: Accessing request parameters) with default values set in handler (solrconfig.xml)

To sum up:

You can do use something like that in data-config.xml

${dataimporter.request.your_variable}

With request:

/dataimport&command=delta-import&clean=false&commit=true&your_variable=123
like image 134
Fuxi Avatar answered Feb 03 '26 10:02

Fuxi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!