简体   繁体   中英

Loading data into django haystack database indexing with solr

i have some existing data in json that i would like to load into the django haystack database and do indexing using solr(rebuild_index).

I have roughly about 100k records and i do not want to use fixtures to do it. I find fixtures quite confusing to understand.

  1. Is it possible that django can point to the solr index without using a database?
  2. Is it possible to store the whole json file into the database without serialization?
  3. If i generate my index using solr and the JSON file, is it possible to store the solr index into the database?
  4. If i am forced to use fixtures, is there a good example of people using fixtures?

Haystack is a great solution when you want to combine the Django ORM (backed by a database like MySQL or Postgres) with a search platform like Solr or Elasticsearch.

If you don't have models defined for your data, or your data does not like in a DB set up with the Django ORM, then you're better off just using a python/solr library like solrpy . See: http://django-haystack.readthedocs.org/en/latest/faq.html#when-should-i-not-be-using-haystack

Note that when you use Haystack, you will have data in both your DB and the search index. If you just Solr, you without Haystack, you just need data in Solr.

With solr, you can bulk import into your index from a JSON file. See: import data from JSON in solr

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM