问题
Is this is are possible to have indexed documents with the different set of the attributes.
For example:
There is some amount of the documents with the attr1,attr2, attr3 and soe amount of the documents with the attr4, attr5, attr6 ?
Can all of this documents be included in the one index without predefining all possible attributes from both types ?
回答1:
yes, you can use dynamic fields is Solr for this purpose.
回答2:
With Sphinx you may use json fields (sql_attr_json) where you will save your key:values. We have same situation, it depends on customer, which data he will save to Sphinx/Solr.
Unfortunately in current version of sphinx (tested 2.2.3 beta) json may not contain more than 4gb of data : http://sphinxsearch.com/forum/view.html?id=12550 - so it depends on amount of your data. We had 15 key:value pairs in json and only 6M of records fitted to 4GB.
回答3:
With Sphinx, I believe you have to set all your attributes ahead of time in your sphinx.conf file. There is no equivalent to Solr's dynamic fields.
来源:https://stackoverflow.com/questions/11248031/documents-with-the-different-attributes-sets-in-sphinx-and-solr