When I tried to search for a package I received the following error We're so sorry, something is wrong on our end. and in the application logs the below critical error message was occurred.
fyi, I have installed solr and run it without making any additional configuration changes.
[2015-08-16 09:20:09] request.INFO: Matched route "search.ajax". {"route_parameters":{"_controller":"Packagist\\WebBundle\\Controller\\WebController::searchAction","_route":"search.ajax"},"request_uri":"http://localhost:8001/app.php/search/?search_query%5Bquery%5D=ac"} []
[2015-08-16 09:20:09] security.DEBUG: Read existing security token from the session. {"key":"_security_main"} []
[2015-08-16 09:20:09] security.DEBUG: User was reloaded from a user provider. {"username":"andreas","provider":"Packagist\\WebBundle\\Security\\Provider\\UserProvider"} []
[2015-08-16 09:20:09] request.CRITICAL: Uncaught PHP Exception Solarium_Client_HttpException: "Solr HTTP error: Not Found (404)" at /home/achristodoulou/Projects/test/packagist/vendor/solarium/solarium/library/Solarium/Result.php line 98 {"exception":"[object] (Solarium_Client_HttpException(code: 404): Solr HTTP error: Not Found (404) at /home/achristodoulou/Projects/test/packagist/vendor/solarium/solarium/library/Solarium/Result.php:98)"} []
[2015-08-16 09:20:09] security.DEBUG: Stored the security token in the session. {"key":"_security_main"} []
You need to set up the schema.xml for Solr, and then run app/console
packagist:index to build up the solr index. Then search should work.
I took a look at the doc/schema.xml and I did not see anything that needs to be change, so I just run app/console packagist:index while solr was running on default port in the background and I received the below error. Any suggestions like what needs to be updated in doc/schema.xml?
$ php app/console packagist:index
[Solarium_Client_HttpException]
Solr HTTP error: Not Found (404)
packagist:index [--force] [--all] [--] [<package>]
But did you actually configure solr with said schema?
On Aug 16, 2015 1:21 PM, "achristodoulou" [email protected] wrote:
I took a look at the doc/schema.xml and I did not see anything that needs
to be change, so I just run app/console packagist:index while solr was
running on default port in the background and I received the below error.
Any suggestions like what needs to be updated in doc/schema.xml?$ php app/console packagist:index
[Solarium_Client_HttpException]
Solr HTTP error: Not Found (404)
packagist:index [--force] [--all] [--] [] —
Reply to this email directly or view it on GitHub
https://github.com/composer/packagist/issues/568#issuecomment-131528436.
Copy the schema.xml.
cp doc/schema.xml /opt/solr/example/solr/conf/schema.xml
Add core in the configuration of solarium:
nelmio_solarium:
clients:
default:
dsn: http://solr:8983/solr
core: collection1
fyi, I am using the latest version of solr-5.2.1 and I had to modify the schema.xml by removing some deprecated attributes in order to be able to add a new core through solr interface. I even added the above lines nelmio_solarium in packagist config.yml but still when I run the following command I am getting the same error message.
php app/console packagist:index --no-debug --env=prod
[Solarium_Client_HttpException]
Solr HTTP error: Not Found (404)
Hi,
Can you put your solr configuration.
I have uploaded solr 2 config files in github:
I have updated also the schema that it was with packagist as some attributes were not valid in the latest version:
https://github.com/achristodoulou/dump/blob/master/solr/schema.xml
https://github.com/achristodoulou/dump/blob/master/solr/solrconfig.xml
I think I ran into this issue before; solr-5.2.1 could not load the packagist schema.xml and I got a 404.
I ended up dropping to solr-4.10.4 to get the search to work; even then, I had to add this:
<field name="_version_" type="long" indexed="true" stored="true"/>
to the list of fields to make it work.
Same here on Solr 5.3.0
I could make it works with two adjustments :
<field name="_version_" type="string" indexed="true" stored="true" multiValued="false" />
I could make a PR if it works with Solr 3.6
To make it work now(in 2017 and solr 6), you need to make changes from previous comment and comment 2 more lines in solrconfig.xml:
<!--<requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />-->
<!--<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />-->
I have got the same issue, in my case it was a misconfiguration: in solr config the core was called 'packagist', but in nelmio_solarium it was called 'collection1'
@vitman If you have solr 6 operational with packagist, could you publish your config files?
@HadesArchitect
here is the gist:
https://gist.github.com/vitman/ff693986ca294f3a39183a1d396e9393
also please note that you will need to copy few more files into your data/{collectionName} folder:
stopwords_en.txt synonyms.txt protwords.txt stopwords.txt
I've took them from collection example bundled with solr ( /opt/solr-6.4.1/example/files/conf/ in my case)
We decided to use docker to install Solr 3.6 on our Ubuntu 16.04 server.
Pretty straight forward, and saves worrying about compatibility with a Solr version that isn't supported.
https://github.com/UKWebMedia/packagist-solr
Most helpful comment
Same here on Solr 5.3.0
I could make it works with two adjustments :
I could make a PR if it works with Solr 3.6