Not sure I'd say it's trivial. But there are lots of folks who've done it
successfully. As noted, batching is important, depending on the nature of
the data fault tolerance can be important too. Daily data loads are a bit
different than continuous feeds of data. Also depends on to what extent
one  wants to massage the data going in to reduce load on the server from
indexing. Size of the dataset can imply performance needs, and scalability
etc.

-Gus

On Fri, Jan 13, 2023 at 10:41 AM Dave <hastings.recurs...@gmail.com> wrote:

> Yeah, it’s trivial building your own indexer in any language that can read
> a db. Also I wouldn’t trust the dih on its own even when supported
>
> > On Jan 13, 2023, at 10:17 AM, Jan Høydahl <jan....@cominvent.com> wrote:
> >
> > I don't think the 3rd party DIH is maintained.
> >
> > Other options are using other 3rd party frameworks like
> > ManifoldCF <
> https://datafari.atlassian.net/wiki/spaces/DATAFARI/pages/2718007297/How+to+crawl+a+database+on+Solr+without+DIH+-+DIH+alternative>
> or Apache NiFI <
> https://www.datainmotion.dev/2020/04/building-search-indexes-with-apache.html>
> which is a more visual approach.
> > Personally I'd write a small Python program.
> >
> > When asking ChatGPT to sketch such a program, this is what I got :)
> >
> > Sure, here is a sample Python program that demonstrates how to import
> data from a MySQL database and index it into Solr using the SolrPy library:
> >
> > import mysql.connector
> > from solr import Solr
> >
> > # Connect to MySQL database
> > cnx = mysql.connector.connect(user='username',
> >                              password='password',
> >                              host='hostname',
> >                              database='database_name')
> > cursor = cnx.cursor()
> >
> > # Execute MySQL query
> > query = "SELECT * FROM table_name"
> > cursor.execute(query)
> >
> > # Fetch all data
> > data = cursor.fetchall()
> >
> > # Connect to Solr
> > solr = Solr('http://localhost:8983/solr/core_name')
> >
> > # Index data into Solr
> > for row in data:
> >    solr.add(row)
> >
> > # Commit changes
> > solr.commit()
> >
> > # Close database and Solr connection
> > cursor.close()
> > cnx.close()
> > solr.close()
> >
> >
> > I have not tested it, but with some massage you should be able to fly
> >
> > Jan
> >
> >> 13. jan. 2023 kl. 16:02 skrev Markus Jelsma <markus.jel...@openindex.io
> >:
> >>
> >> Hello,
> >>
> >> DIH was removed in Solr 9.x. You can either build your own importer, or
> use
> >> the, now 3rd party, DIH [1] that is available as a package.
> >>
> >> Regards,
> >> Markus
> >>
> >> [1] https://github.com/rohitbemax/dataimporthandler
> >>
> >>> Op vr 13 jan. 2023 om 14:47 schreef Anuj Bhargava <anujb...@gmail.com
> >:
> >>>
> >>> How do I import data from MySql database in Solr 9.1
> >>>
> >>> Earlier I was using DIH in version 8.6.2
> >>>
> >>> Regards,
> >>>
> >>> Anuj
> >>>
> >
>


-- 
http://www.needhamsoftware.com (work)
http://www.the111shift.com (play)

Reply via email to