At the moment, it is not possible to set apache_solr as the default search.

How to activate Apache Solr as the default Search?

Any easy way to activate apachesolr on all search forms as the default search, is to download and install the module I created for this reason:

Download Apache Solr Default Search Module

I also use this module on my page. 


Recently a customer of me asked me to modify his advanced search form. Normally the advanced search form looks like this:

You realize quickly, that the user can't cope with this selection form. The goal was to split the taxonomy selection form into multiple forms, each for every vocabulary.


1.Installation of Java 

First you have to install SUN JRE and JDK on your system. Version 6 is the current version. The following entries in /etc/apt/sources.list are necessary to download Java directly from the repository

# in non-free are the Java packages
deb http://ftp.de.debian.org/debian/lenny main non-free contrib
 
#Security updates for all debian packages
deb http://security.debian.org/ etch/updates main non-free contrib
 
Install Java 6 JRE und JDK packages:


apt-get install sun-java6-jre sun-java6-jdk


Define the index FieldS in Solr schema.xml

Before you can index data with solr, you need to define the types of the data. You can do this with the file "schema.xml", which can be found in the /conf folder of your solr installation.

Solr indexes so called "documents" which consists of an array of fields. If you want to add new documents to the index with PHP, you create a $doc-object with the PHP Service Class and fill the fields of the object with its value. Then you send the $doc-object to the solr server. The index will be updated if the $doc-object fits the defined index-schema in the schemal.xml file.

With the following example I will explain the structure of the solr schema.xml:

erläutert:

Example:

<schema name="ayalon" version="1.1">
  ...
  <fields>
  <field name="id" type="string" indexed="true" stored="true" required="true" />
  <field name="title" type="text" indexed="true" stored="true"/>
  <field name="titleSort" type="string" indexed="true" stored="false"/>
  <field name="text" type="text" indexed="true" stored="true"/>
  <field name="category" type="text" indexed="true" stored="true" multiValued="true"/>
  ...
  </fields>
 
  <uniqueKey>id</uniqueKey>
  ...
  <copyField source="title" dest="titleSort"/>
  ...
</schema>

Explanation:


Syndicate content