Code Monkey home page Code Monkey logo

ci-solrphp's Introduction

CodeIgniter Solr PHP Client

This is a simple library for CodeIgniter to interface with Solr. I am not the original author of the code, I've just made it compatible with codeigniter.

This CI library is based on Apache Solr PHP Client.

I created this while implementing solr search on my lyrics site.

Usage

Put the files from this repo into application/libraries/solr.

This library is very simple to install, simply load it the way you do any other CI library and pass it an array of parameters (optional).

$this->load->library('solr',array(
    'port' => 8983,
    'path' => '/solr/posts/'
));

You need to set /solr/posts/ to match the name of the core you are searching.

Peforming a simple search

Doing a simple search is easy:

$results = $this->solr->search('cactus');

Performing a DisMax or advanced search

The simple search above is not useful for real world search applications. You can use the other paramaters of search() to use advanced features such as DisMax:

$results = $this->solr->search('cactus', 0, 10, array(
    'defType' => 'edismax',
    'mm' => '100%',
    'qf' => 'title^10+bodytext'
));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.