YiiSolr is a Yii extension that provides a wrapper for the pecl solr library (http://www.php.net/manual/en/book.solr.php) to make fast searching with Yii really easy. The wrapper allows the use of familiar Yii constructs such as models, data providers etc with a solr index.
Tested with Yii 1.18 but should work with any recent version
Please see the github page for usage examples
Total 8 comments
A. Yes, configure the host settings for the connection in your main config.
Will this work with a remote Solr instance? I am assuming I can just specify an alternative host in the config, but I want to make sure before I hassle my webhost to install the PECL Solr package.
Thanks
Addenum: For any others new to Solr you need to add your custom fields in the solr config/schema.xml file. Then everything should work fine.
Has anyone figured out the adding new fields to a document for indexing? This will blow up with the error: ERROR: [doc=1] unknown field 'creator'.
ASolrDocument::setAttributes() and ASolrDocument::add() also return this error.
Thanks,
Dean
So you can just do
$criteria->addParam("foo","bar")
phpnode,
How would I incorporate SolrParams class so I can add individual params like:
SolrParams::addParam('q.op', 'OR');
Thanks in advance
Hi,
How can add fields. It is not accepting any other name for example
Error
SolrClientExceptionIt fetches only 10 records even if i using findAll($criteria); If i manually search from solr it fetches more than 10 records. Can you please tell me how to fetch all records.
I have modified the function query in ASolrDocument to fetch all the records.
You have to import the extension components, so in your config/main.php:
For the tests to work, you must have SQLite installed as well as the example index that comes with Solr. I will try and improve this in future to make it easier to run the tests
Could you please eloborate more on how to set up.
I have configured the aliases path and solr component. And also i have started the solr. I have indexed my database using solr. Now i want to use this extension to fetch the records. But initial set up was problem. When i do the phpunit test as mentioned it throws me below mentioned 6errors.
And after adding the configuration to the config file. and i use the following code in my controller it shows an error
code:
Error:
Thanks in advance.
Leave a comment
Please login to leave your comment.