Skip to content

Instantly share code, notes, and snippets.

@arunchinnachamy
arunchinnachamy / location_search_solarium.php
Last active July 25, 2024 11:36
PHP code to show Location search in SOLR using Solarium. Details can be found at http://www.arunchinnachamy.com/how-to-use-solr-geo-spatial-search/
<?php
//Solarium Installed using composer.
require "vendor/autoload.php";
$config = array(
'endpoint' => array(
'localhost' => array(
'host' => SOLR_IP,
'port' => 8080,
'path' => '/solr/',
@arunchinnachamy
arunchinnachamy / SOLR-PHP-JSON-API.php
Created May 8, 2013 19:18
This file shows how to consume a SOLR API in your PHP script as a JSON output. The script is easy and less than half a dozen code lines. You can find example and tutorial at SOLR Search in PHP tutorial.
<?php
//replace with your query URL
$url = "http://127.0.0.1:8080/solr/core1/select/?q=*%3A*&start=0&rows=10&wt=json";
//Executes the URL and saves the content (json) in the variable.
$content = file_get_contents($url);
if($content) {
$result = json_decode($content,true);
@arunchinnachamy
arunchinnachamy / schema.xml
Last active October 16, 2020 12:09
Default schema.xml for tutorials in http://www.installationpage.com. Look in the comments for the link.
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@arunchinnachamy
arunchinnachamy / solrconfig.xml
Created April 5, 2013 09:48
Default SOLR Configuration file solrconfig.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@arunchinnachamy
arunchinnachamy / redis-server
Created December 2, 2012 14:30
Redis Init script for CentOS/Fedora/RedHat
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
@arunchinnachamy
arunchinnachamy / redis-server
Created December 2, 2012 14:20
Redis Start up script for Debian/Ubuntu
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db