[PHP] Configuration php.ini

As I said in my blog, it is just a place to remind me the technology that I used everyday, there will be nothing so profound but useful in daily work.

This blog will present a simple schema for the configuration of the php.ini. There are several php.ini after installed php, it is very easy to be confused.

Continue reading

Advertisements

[Apache] Solr 4.3.1 released

Apache Solr 4.3.1 released Juin 18 2013

Here is the link to download : http://www.apache.org/dyn/closer.cgi/lucene/solr/4.3.1

Solr is the popular, blazing fast, open source NoSQL search platform
from the Apache Lucene project. Its major features include powerful
full-text search, hit highlighting, faceted search, dynamic
clustering, database integration, rich document (e.g., Word, PDF)
handling, and geospatial search. Solr is highly scalable, providing
fault tolerant distributed search and indexing, and powers the search
and navigation features of many of the world's largest internet sites.

[Apache] Install configuration perl and php for apache

To install the configuration of perl and php for apache in Ubuntu, it is sufficient to execute several commands.

For perl : sudo apt-get install apache2

For php : sudo apt-get install php5 libapache2-mod-php5

After doing these commands, if we check whether the modules are avaliable, we just need a short script :

check_mod(){
    mode=$1
    mods_enabled=/etc/apache2/mods-enabled
    mods_available=/etc/apache2/mods-available

    if [ -f "$mods_enabled/$mode" ] ; then
    echo "The module $mode is enabled"
    else  
    if [ -f "$mods_avalable/$mode" ] ; then
        echo "The module $mode is available"
        sudo ln -s $mods_available/$mode $mods_enabled/$mode
    else  
        echo "[KO]The module is not installed[KO]"
    fi
    fi
}

check_mod perl.load
check_mod php5.conf
check_mod php5.load

Ref.
https://help.ubuntu.com/10.04/serverguide/php5.html
http://www.blog.highub.com/perl/install-configure-apache-localhost-perl-on-linux-ubuntu/

Apache Solr – Delete index by URL

There is a method to delete all the index in solr by using url :

http://localhost:8080/solr/your_solr_admin/update
?stream.body= <delete><query>*:*</query></delete>&commit=true

And if you want just delete a field which id is 1, you can do this :

http://localhost:8080/solr/your_solr_admin/update
?stream.body= <delete><query>id:1</query></delete>&commit=true

Apache Solr NGram/EdgeNGram

### Apache Solr NGram/EdgeNGram ###

=== NGram ===
NGram is very useful for auto-complete, it will cut the word by a size specified by yourself.

For example, the word “paris”, minGramSize takes 2, maxGramSize takes 3, we will get :
paris => “pa”, “ar”, “ri”, “is”
=> “par”, “ari”, “ris”

By default, minGramSize is 1, maxGramSize is 1 and side is “front”.
You can also set side to “back” to generate the ngrams from right to left.

 <fieldType name="text_general_ngram" positionIncrementGap="100">
   <analyzer type="index">
       <tokenizer .../>
       <filter minGramSize="2" maxGramSize="15"/>
   </analyzer>
   <analyzer type="query">
       <tokenizer.../>
    </analyzer>
 </fieldType>

Continue reading

Deploy Apache Solr 3.5 in Ubuntu 10.04

1. Background

Solr is an enterprise search platform from the Apache Lucene project. Its major features include powerful full-text search, hit highlighting, faceted search, dynamic clustering, database integration, rich document handling, and geospatial search.

— Wiki Apache Solr

The feature that I prefer is the full-text search. So let’s begin.

Continue reading