Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7656281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:43:34+00:00 2026-05-31T12:43:34+00:00

I’ve written a custom indexer using php to import data to solr from mysql

  • 0

I’ve written a custom indexer using php to import data to solr from mysql instead of using solr’s own data import handler. It’s working great but I’m stuck when doing the periodical indexing. Here’s the process in my mind:

  1. Search all index and find deleted entities comparing them with the
    data in mysql and remove them from solr.

  2. Find recently changed entities in mysql and only index them. (I’ve
    at least 12 tables for a core and I need to check all)

So my question is, is this a good way or do you suggest something more efficient. Thanks.

Ps: I didn’t use solr’s data import handler because there were too many things to do on my own like hierarchical data management etc. I don’t know if I could do all of them with data import handler.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:43:36+00:00Added an answer on May 31, 2026 at 12:43 pm

    You can start tracking changes when the items are changes or removed from your DB. Then you’ll only need to go through that list to update your index. Or add a “created / last updated” field to your DB entities. But that could be a complex task depending on your system architecture and logic.

    You can also save on checking if your items exist in the database or index and just re-index everything – on datasets not very huge that could be quicker (just make sure that the same indexed entity would receive the same Solr ID as before in order to replace its older version instead of duplicating it).

    Another way is to have so called “delta index” only containing the recently modified items, so you’d have to merge Solr with Solr and not Solr with DB.

    If you still need to check every single item it’d be probably better first to request them from DB because Solr search is generally quicker. Then you can run a Solr query in a batch requesting many documents by their ID at once and loop through that set to match them against your DB records. So something like request N results from DB / produce their Solr IDs / request N Solr documents by ID in a single query / match sets should work. But this is a “brute force” method, obviously.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.