Index: sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/.classpath
===================================================================
--- sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/.classpath	(revision 7576)
+++ sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/.classpath	(revision 7576)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="lib" path="lib/apache-solr-analysis-extras-4.0.0-ALPHA.jar"/>
+	<classpathentry kind="lib" path="lib/apache-solr-cell-4.0.0-ALPHA.jar"/>
+	<classpathentry kind="lib" path="lib/apache-solr-clustering-4.0.0-ALPHA.jar"/>
+	<classpathentry kind="lib" path="lib/apache-solr-core-4.0.0-ALPHA.jar"/>
+	<classpathentry kind="lib" path="lib/apache-solr-dataimporthandler-4.0.0-ALPHA.jar"/>
+	<classpathentry kind="lib" path="lib/apache-solr-dataimporthandler-extras-4.0.0-ALPHA.jar"/>
+	<classpathentry kind="lib" path="lib/apache-solr-langid-4.0.0-ALPHA.jar"/>
+	<classpathentry kind="lib" path="lib/apache-solr-solrj-4.0.0-ALPHA.jar"/>
+	<classpathentry kind="lib" path="lib/apache-solr-test-framework-4.0.0-ALPHA.jar"/>
+	<classpathentry kind="lib" path="lib/apache-solr-uima-4.0.0-ALPHA.jar"/>
+	<classpathentry kind="lib" path="lib/apache-solr-velocity-4.0.0-ALPHA.jar"/>
+	<classpathentry kind="lib" path="lib/commons-codec-1.6.jar"/>
+	<classpathentry kind="lib" path="lib/commons-io-2.1.jar"/>
+	<classpathentry kind="lib" path="lib/httpclient-4.1.3.jar"/>
+	<classpathentry kind="lib" path="lib/httpcore-4.1.4.jar"/>
+	<classpathentry kind="lib" path="lib/httpmime-4.1.3.jar"/>
+	<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.6.4.jar"/>
+	<classpathentry kind="lib" path="lib/ldapjdbc.jar"/>
+	<classpathentry kind="lib" path="lib/mail.jar"/>
+	<classpathentry kind="lib" path="lib/slf4j-api-1.6.4.jar"/>
+	<classpathentry kind="lib" path="lib/wstx-asl-3.2.7.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/.project
===================================================================
--- sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/.project	(revision 7576)
+++ sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/.project	(revision 7576)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>JCrawlerForIMAP</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/src/pkg/crawler/main/Main.java
===================================================================
--- sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/src/pkg/crawler/main/Main.java	(revision 7576)
+++ sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/src/pkg/crawler/main/Main.java	(revision 7576)
@@ -0,0 +1,43 @@
+package pkg.crawler.main;
+
+import pkg.crawler.data.conn.Crawler;
+
+public class Main {
+
+	/**
+	 * @param args
+	 * DeverÃ£o ser 4 argumentos: 
+	 */
+	public static void main(String[] args) {
+		
+		if (args == null || args.length != 4){
+			System.out.println("Uso:\n" +
+					"java -jar crawler.jar [imap_host] [imap_admin_password] " +
+					"[http_solr_host_address] [login_starts_with]\n" +
+					"imap_host - O endereÃ§o que estÃ¡ instalado o Expresso Ex: \"127.1.1.1\"\n" +
+					"imap_admin_password - Senha do usuÃ¡rio 'expresso-admin' Ex: \"admin123\"\n" +
+					"http_solr_host_address - EndereÃ§o do servidor do Solr Ex: \"http://127.1.1.1:8983/solr/\"\n" +
+					"login_starts_with - Caracteres que esse crawler deverÃ¡ verificar Ex: \"abcde\"");
+			System.exit(0);
+		}
+		
+		//O endereÃ§o que estÃ¡ instalado o Expresso Ex: "127.1.1.1"
+		String host = args[0];
+		//Senha do usuÃ¡rio 'expresso-admin' Ex: "admin123"
+		String password = args[1];
+		//EndereÃ§o do servidor do Solr Ex: "http://127.1.1.1:8983/solr/"
+		String hostSolr = args[2];
+		//Caracteres que esse crawler deverÃ¡ verificar Ex: "abcde"
+		String loginStartsWith = args[3];
+		
+		//Para cada letra definida contida na variÃ¡vel "loginStartsWith" iniciarÃ¡ uma thread do crawler
+		for ( int i = 0; i < loginStartsWith.length(); i++)
+		{
+			Crawler crawler = new Crawler(host, password, hostSolr, String.valueOf(loginStartsWith.charAt(i)));
+			
+			new Thread(crawler).start();
+		}
+		
+	}
+
+}
Index: sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/src/pkg/crawler/data/conn/CopyOfCrawler.java
===================================================================
--- sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/src/pkg/crawler/data/conn/CopyOfCrawler.java	(revision 7576)
+++ sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/src/pkg/crawler/data/conn/CopyOfCrawler.java	(revision 7576)
@@ -0,0 +1,314 @@
+package pkg.crawler.data.conn;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Properties;
+
+import javax.mail.Address;
+import javax.mail.Folder;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Multipart;
+import javax.mail.Part;
+import javax.mail.Session;
+
+import org.apache.solr.client.solrj.SolrServer;
+import org.apache.solr.client.solrj.impl.HttpSolrServer;
+import org.apache.solr.common.SolrInputDocument;
+
+import pkg.crawler.entity.Message2SolrEntity;
+
+import com.sun.mail.imap.ACL;
+import com.sun.mail.imap.IMAPFolder;
+import com.sun.mail.imap.IMAPMessage;
+import com.sun.mail.imap.IMAPStore;
+import com.sun.mail.imap.Rights;
+import com.sun.mail.imap.Rights.Right;
+
+public class CopyOfCrawler{
+
+	private String host;
+	private String user;
+	private String password;
+	private String mbox;
+	private String url;
+	private boolean debug;
+	private String loginStartsWith;
+	private static ArrayList<Message2SolrEntity> listIMAPMsgs = new ArrayList<Message2SolrEntity>();
+
+
+//	public CopyOfCrawler(String loginStartsWith)
+//	{
+//		this.host = "172.25.60.61";
+//		this.user = "expresso-admin";
+//		this.password = "pti123";
+//		this.mbox = "user";
+//		this.url = null;
+//		this.debug = false;
+//		this.loginStartsWith = loginStartsWith; 
+//	}
+//
+//
+//	@Override
+//	public void run()
+//	{
+//
+//		//Inicializando as propriedades default da mÃ¡quina para conexÃ£o
+//		//com o servidor IMAP
+//		Properties props = System.getProperties();
+//		Session session = Session.getInstance(props, null);
+//
+//		IMAPStore store = new IMAPStore(session, null);
+//
+//		try {
+//
+//			//Conectando com o servidor IMAP
+//			store.connect(host, user, password);
+//			//Definindo a pasta base a ser usada
+//			IMAPFolder imapFolder = (IMAPFolder)store.getFolder(mbox);
+//
+//			//Cria a ACL a ser configurada
+//			ACL acl = new ACL("expresso-admin");
+//
+//			Rights rights = new Rights();
+//			rights.add(Right.READ);
+//
+//
+//			//Configura direito de leitura para a ACL
+//			acl.setRights(rights);
+//
+//			SolrServer solrServer = new HttpSolrServer("http://172.25.60.61:8983/solr/");
+//			
+//			solrServer.deleteByQuery("*:*");
+//			//Faz a iteraÃ§Ã£o entre os usuÃ¡rios
+//			for (Folder fINBOXAux : imapFolder.list())
+//			{
+//				//INBOX
+//				IMAPFolder imapFINBOXAux = (IMAPFolder)fINBOXAux;
+//
+//				imapFINBOXAux.addACL(acl);
+//
+//				imapFINBOXAux.open(Folder.READ_ONLY);
+//
+//				Message[] msgsINBOX = imapFINBOXAux.getMessages();
+//
+//				for (Message msgAuxINBOX : msgsINBOX)
+//				{
+//					dumpPart(msgAuxINBOX);
+//				}
+//				imapFINBOXAux.removeACL("expresso-admin");
+//				for(int i = 0; i < CopyOfCrawler.listIMAPMsgs.size(); i++ )
+//				{
+//					SolrInputDocument doc = new SolrInputDocument();
+//					doc.addField("id", listIMAPMsgs.get(i).getId());
+//					doc.addField("user", listIMAPMsgs.get(i).getUser());
+//					doc.addField("folder", listIMAPMsgs.get(i).getUser());
+//					doc.addField("from", listIMAPMsgs.get(i).getFrom());
+//					doc.addField("to", listIMAPMsgs.get(i).getTo());
+//					doc.addField("subject", listIMAPMsgs.get(i).getSubject());
+//					doc.addField("content", listIMAPMsgs.get(i).getContent());
+//					doc.addField("copyto", listIMAPMsgs.get(i).getCopyto());
+//					doc.addField("hiddencopyto", listIMAPMsgs.get(i).getHiddencopyto());
+//
+//					solrServer.add(doc);
+//				}
+//
+//				CopyOfCrawler.listIMAPMsgs.clear();
+//
+//				solrServer.commit();
+//
+//				for (Folder fAux : imapFINBOXAux.list())
+//				{
+//
+//					//INBOX
+//					IMAPFolder imapFAux = (IMAPFolder)fAux;
+//
+//					imapFAux.addACL(acl);
+//
+//					imapFAux.open(Folder.READ_ONLY);
+//
+//					Message[] msgs= imapFAux.getMessages();
+//
+//					for (Message msgAux: msgs)
+//					{
+//						dumpPart(msgAux);
+//					}
+//					imapFAux.removeACL("expresso-admin");
+//					System.out.println(imapFAux.getFullName()); 
+//					for(int i = 0; i < CopyOfCrawler.listIMAPMsgs.size(); i++ )
+//					{
+//						SolrInputDocument doc = new SolrInputDocument();
+//						doc.addField("id", listIMAPMsgs.get(i).getId());
+//						doc.addField("user", listIMAPMsgs.get(i).getUser());
+//						doc.addField("folder", listIMAPMsgs.get(i).getUser());
+//						doc.addField("from", listIMAPMsgs.get(i).getFrom());
+//						doc.addField("to", listIMAPMsgs.get(i).getTo());
+//						doc.addField("subject", listIMAPMsgs.get(i).getSubject());
+//						doc.addField("content", listIMAPMsgs.get(i).getContent());
+//						doc.addField("copyto", listIMAPMsgs.get(i).getCopyto());
+//						doc.addField("hiddencopyto", listIMAPMsgs.get(i).getHiddencopyto());
+//
+//						solrServer.add(doc);
+//					}
+//					CopyOfCrawler.listIMAPMsgs.clear();
+//				}
+//
+//
+//				System.out.println(imapFINBOXAux.getFullName()); 
+//				//				IMAPFolder imapFAux = (IMAPFolder)imapFolder.list()[0]; //INBOX
+//				//				IMAPFolder imapFAux = (IMAPFolder)imapFolder.list()[0].list()[0]; //AprovaÃ§Ãµes e talz
+//				//				
+//				//				imapFAux.addRights(acl);
+//				//				imapFAux.open(IMAPFolder.READ_ONLY);
+//				//				System.out.println(imapFAux.getMessageCount());
+//				//				
+//				//				IMAPMessage message = (IMAPMessage)imapFAux.getMessages()[0];
+//				//				
+//				//				System.out.println(message.getMessageID());
+//				//				System.out.println(message.getContentType());
+//				//				
+//				//				
+//				//				imapFAux.removeACL("expresso-admin");
+//				//				imapFAux.close(false);
+//			}
+//
+//
+//		} catch (MessagingException e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+//		catch (Exception e)
+//		{
+//			e.printStackTrace();
+//		}
+//	}
+//
+//
+//	public static void dumpPart(Part p) throws Exception {
+//		Message2SolrEntity msgEntity = null;
+//
+//		if (p instanceof Message) {
+//			msgEntity = new Message2SolrEntity();
+//			IMAPMessage m = (IMAPMessage)p;
+//
+//			msgEntity.setId(m.getMessageID());
+//			
+//			if(msgEntity.getId() == null || msgEntity.getId().equals("")){
+//				System.out.println("Damn it!");
+//			}
+//
+//			String user = m.getFolder().getFullName().split("/")[1];
+//			msgEntity.setUser(user);
+//
+//			String folder = m.getFolder().getFullName().split("/")
+//					[m.getFolder().getFullName().split("/").length-1];
+//
+//			if(!user.equals(folder))
+//			{
+//				msgEntity.setFolder(folder);
+//			}
+//			else
+//			{
+//				msgEntity.setFolder("INBOX");
+//			}
+//			
+//			
+//			
+//			msgEntity.setSubject(m.getSubject());
+//			Address[] a;
+//			// FROM 
+//			if ((a = m.getFrom()) != null) {
+//				for (int j = 0; j < a.length; j++)
+//				{
+//					if(msgEntity.getFrom() == null)
+//					{
+//						msgEntity.setFrom(a[j].toString());
+//					}
+//					else
+//					{
+//						msgEntity.setFrom(msgEntity.getFrom() + ","+a[j].toString());
+//					}
+//					//					System.out.println("FROM: " + a[j].toString());
+//				}
+//
+//			}
+//
+//			// TO
+//			if ((a = m.getRecipients(Message.RecipientType.TO)) != null) {
+//				for (int j = 0; j < a.length; j++)
+//				{
+//					if(msgEntity.getTo() == null)
+//					{
+//						msgEntity.setTo(a[j].toString());
+//					}
+//					else
+//					{
+//						msgEntity.setTo(msgEntity.getTo() + ","+a[j].toString());
+//					}
+//				}
+//			}
+//
+//			// CC
+//			if ((a = m.getRecipients(Message.RecipientType.CC)) != null) {
+//				for (int j = 0; j < a.length; j++)
+//				{
+//					if(msgEntity.getCopyto() == null)
+//					{
+//						msgEntity.setCopyto(a[j].toString());
+//					}
+//					else
+//					{
+//						msgEntity.setCopyto(msgEntity.getCopyto() + ","+a[j].toString());
+//					}
+//				}
+//			}
+//			// CC
+//			if ((a = m.getRecipients(Message.RecipientType.BCC)) != null) {
+//				for (int j = 0; j < a.length; j++)
+//				{
+//					if(msgEntity.getHiddencopyto() == null)
+//					{
+//						msgEntity.setHiddencopyto(a[j].toString());
+//					}
+//					else
+//					{
+//						msgEntity.setHiddencopyto(msgEntity.getHiddencopyto() + ","+a[j].toString());
+//					}
+//				}
+//			}
+//
+//			// DATE
+//			Date d = m.getSentDate();
+//			if(msgEntity != null)
+//			{
+//				msgEntity.setSent_date((d != null ? d.toLocaleString() : "UNKNOWN"));
+//			}
+//
+//
+//		}
+//
+//		try{
+//			Object o = p.getContent();
+//			if (o instanceof String) {
+//				if( msgEntity != null )
+//				{
+//					msgEntity.setContent((String)o);
+//				}
+//			} else if (o instanceof Multipart) {
+//				Multipart mp = (Multipart)o;
+//				int count = mp.getCount();
+//				for (int i = 0; i < count; i++)
+//					dumpPart(mp.getBodyPart(i));
+//			}
+//		}catch (Exception e){
+//			System.out.println("Exception ocurred!");
+//			e.printStackTrace();
+//		}
+//
+//		if(msgEntity != null && msgEntity.getId() != null){
+//			CopyOfCrawler.listIMAPMsgs.add(msgEntity);
+//		}
+//
+//	}	
+
+}
Index: sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/src/pkg/crawler/data/conn/Crawler.java
===================================================================
--- sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/src/pkg/crawler/data/conn/Crawler.java	(revision 7576)
+++ sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/src/pkg/crawler/data/conn/Crawler.java	(revision 7576)
@@ -0,0 +1,406 @@
+package pkg.crawler.data.conn;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
+import javax.mail.Address;
+import javax.mail.BodyPart;
+import javax.mail.Folder;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Multipart;
+import javax.mail.Part;
+import javax.mail.Session;
+import javax.swing.JOptionPane;
+
+import org.apache.solr.client.solrj.SolrServer;
+import org.apache.solr.client.solrj.impl.HttpSolrServer;
+import org.apache.solr.common.SolrInputDocument;
+
+import pkg.crawler.entity.Message2SolrEntity;
+
+import com.sun.mail.imap.ACL;
+import com.sun.mail.imap.IMAPFolder;
+import com.sun.mail.imap.IMAPMessage;
+import com.sun.mail.imap.IMAPStore;
+import com.sun.mail.imap.Rights;
+import com.sun.mail.imap.Rights.Right;
+
+public class Crawler implements Runnable{
+
+	private String host;
+	private String user;
+	private String password;
+	private String mbox;
+	private String hostSolr;
+	private String loginStartsWith;
+	//	private ArrayList<Message2SolrEntity> listIMAPMsgs;
+	private ACL acl;
+
+	public Crawler(String host, String password, String hostSolr, String loginStartsWith)
+	{
+		this.host = host;
+		this.user = "expresso-admin";
+		this.password = password;
+		this.mbox = "user";
+		this.loginStartsWith = loginStartsWith;
+		this.hostSolr = hostSolr;
+
+		//Cria a ACL a ser configurada
+		acl = new ACL("expresso-admin");
+
+		//Define direito de leitura
+		Rights rights = new Rights();
+		rights.add(Right.READ);
+
+		//Configura direito de leitura para a ACL
+		acl.setRights(rights);
+	}
+
+
+	@Override
+	public void run()
+	{
+		while (true)
+		{
+
+
+			//Inicializando as propriedades default da mÃ¡quina para conexÃ£o
+			//com o servidor IMAP
+			Properties props = System.getProperties();
+			Session session = Session.getInstance(props, null);
+
+			IMAPStore store = new IMAPStore(session, null);
+
+			try {
+
+				//Conectando com o servidor IMAP
+				store.connect(host, user, password);
+				//Definindo a pasta base a ser usada
+				IMAPFolder imapFolder = (IMAPFolder)store.getFolder(mbox);
+
+				//Faz a iteraÃ§Ã£o entre os usuÃ¡rios/pastas do usuÃ¡rio
+				for (Folder fINBOXAux : imapFolder.list())
+				{
+					//Verifica se esse usuÃ¡rio comeÃ§a com a letra definida
+					if(fINBOXAux.getName().charAt(0) != loginStartsWith.charAt(0))
+					{
+						//Caso nÃ£o seja, pula para o prÃ³ximo
+						continue;
+					}
+
+					//Cria uma instÃ¢ncia de conexÃ£o com o servidor Solr
+					SolrServer solrServer = new HttpSolrServer(hostSolr);
+
+					//Cria 
+					List<Message2SolrEntity> listIMAPMsgs = new ArrayList<Message2SolrEntity>();
+					//INBOX
+					IMAPFolder imapFINBOXAux = (IMAPFolder)fINBOXAux;
+
+					imapFINBOXAux.addACL(acl);
+
+					imapFINBOXAux.open(Folder.READ_ONLY);
+
+					Message[] msgsINBOX = imapFINBOXAux.getMessages();
+
+					for (Message msgAuxINBOX : msgsINBOX)
+					{
+						IMAPMessage m = (IMAPMessage)msgAuxINBOX;
+						dumpPart(m, listIMAPMsgs);
+					}
+					imapFINBOXAux.removeACL("expresso-admin");
+					for(int i = 0; i < listIMAPMsgs.size(); i++ )
+					{
+						SolrInputDocument doc = new SolrInputDocument();
+						doc.addField("id", listIMAPMsgs.get(i).getId().toString());
+						doc.addField("user", listIMAPMsgs.get(i).getUser().toString());
+						doc.addField("folder", listIMAPMsgs.get(i).getFolder().toString());
+						doc.addField("msg_no", listIMAPMsgs.get(i).getMsgNo());
+						doc.addField("from", listIMAPMsgs.get(i).getFrom().toString());
+						doc.addField("to", listIMAPMsgs.get(i).getTo().toString());
+						doc.addField("subject", listIMAPMsgs.get(i).getSubject().toString());
+						doc.addField("content", listIMAPMsgs.get(i).getContent().toString());
+						doc.addField("copyto", listIMAPMsgs.get(i).getCopyto().toString());
+						doc.addField("sent_date", listIMAPMsgs.get(i).getSent_date());
+						doc.addField("hiddencopyto", listIMAPMsgs.get(i).getHiddencopyto().toString());
+
+						try {
+							solrServer.add(doc);
+						} catch (Exception e) {
+							System.err.println("solr -> " + e.getMessage());
+						}
+
+					}
+
+					listIMAPMsgs = null;
+
+					solrServer.commit();
+
+					solrServer = null;
+
+					for (Folder fAux : imapFINBOXAux.list())
+					{
+						//Verifica se nÃ£o Ã© uma pasta compartilhada
+						if(fAux.getFullName().split("/").length <= 3 && !fAux.getFullName().split("/")[2].equals("user"))
+						{
+							//INBOX
+							IMAPFolder imapFAux = (IMAPFolder)fAux;
+
+							crawIntoUserFolders(imapFAux);
+
+						}
+					}
+
+					System.out.println(imapFINBOXAux.getFullName()); 
+				}
+				store.close();
+
+
+			} catch (MessagingException e) {
+				System.out.println(e.getMessage());
+				e.printStackTrace();
+			}
+			catch (Exception e)
+			{
+				System.out.println(e.getMessage());
+				e.printStackTrace();
+			}
+		}
+	}
+
+	private void crawIntoUserFolders(IMAPFolder imapFAux) throws Exception
+	{
+		SolrServer solrServer = new HttpSolrServer(hostSolr);
+
+		List<Message2SolrEntity> listIMAPMsgs = new ArrayList<Message2SolrEntity>();
+		imapFAux.addACL(acl);
+
+		imapFAux.open(Folder.READ_ONLY);
+
+		Message[] msgs= imapFAux.getMessages();
+
+		for (Message msgAux: msgs)
+		{
+			IMAPMessage m = (IMAPMessage)msgAux;
+			dumpPart(m, listIMAPMsgs);
+		}
+		imapFAux.removeACL("expresso-admin");
+		System.out.println(imapFAux.getFullName()); 
+		for(int i = 0; i < listIMAPMsgs.size(); i++ )
+		{
+			SolrInputDocument doc = new SolrInputDocument();
+			doc.addField("id", listIMAPMsgs.get(i).getId());
+			doc.addField("user", listIMAPMsgs.get(i).getUser());
+			doc.addField("folder", listIMAPMsgs.get(i).getFolder());
+			doc.addField("msg_no", listIMAPMsgs.get(i).getMsgNo());
+			doc.addField("from", listIMAPMsgs.get(i).getFrom());
+			doc.addField("to", listIMAPMsgs.get(i).getTo());
+			doc.addField("subject", listIMAPMsgs.get(i).getSubject());
+			doc.addField("content", listIMAPMsgs.get(i).getContent());
+			doc.addField("copyto", listIMAPMsgs.get(i).getCopyto());
+			doc.addField("sent_date", listIMAPMsgs.get(i).getSent_date());
+			doc.addField("hiddencopyto", listIMAPMsgs.get(i).getHiddencopyto());
+
+			if(doc.getField("id").toString().trim().equals(""))
+			{
+				JOptionPane.showMessageDialog(null, " Â¬Â¬' ");
+			}
+
+			try {
+				solrServer.add(doc);
+			} catch (Exception e) {
+				System.err.println("solr -> " + e.getMessage());
+			}
+		}
+		listIMAPMsgs = null;
+		solrServer.commit();
+		solrServer = null;
+	}
+
+	public void dumpPart(IMAPMessage m, List<Message2SolrEntity> listIMAPMsgs) throws Exception {
+
+		if(m.getMessageID() == null || m.getMessageID().equals("")){
+			System.out.println("Damn it!");
+			return;
+		}
+
+		Message2SolrEntity msgEntity = null;
+		msgEntity = new Message2SolrEntity();
+		//		System.out.println(m.getSize());
+
+		msgEntity.setId(new StringBuilder( m.getMessageID()));
+
+		String user = m.getFolder().getFullName().split("/")[1];
+		msgEntity.setUser(new StringBuilder(user));
+
+		String folder = m.getFolder().getFullName().split("/")
+				[m.getFolder().getFullName().split("/").length-1];
+
+		if(!user.trim().equals(folder.trim()))
+		{
+			msgEntity.setFolder(new StringBuilder(folder));
+		}
+		else
+		{
+			msgEntity.setFolder(new StringBuilder("INBOX"));
+		}
+
+		msgEntity.setMsgNo(new StringBuilder(String.valueOf(m.getMessageNumber())));
+
+
+		if(m.getSubject() != null){
+			msgEntity.setSubject(new StringBuilder( m.getSubject() ));
+		}
+		Address[] a;
+		// FROM 
+		if ((a = m.getFrom()) != null) {
+			for (int j = 0; j < a.length; j++)
+			{
+				if(msgEntity.getFrom() == null)
+				{
+					msgEntity.setFrom(new StringBuilder(a[j].toString()));
+				}
+				else
+				{
+					msgEntity.setFrom(msgEntity.getFrom().append(", ").append(a[j].toString()));
+				}
+				//					System.out.println("FROM: " + a[j].toString());
+			}
+
+		}
+
+		// TO
+		if ((a = m.getRecipients(Message.RecipientType.TO)) != null) {
+			for (int j = 0; j < a.length; j++)
+			{
+				if(msgEntity.getTo() == null)
+				{
+					msgEntity.setTo(new StringBuilder(a[j].toString()));
+				}
+				else
+				{
+					msgEntity.setTo(msgEntity.getTo().append(", ").append(a[j].toString()));
+				}
+			}
+		}
+
+		// CC
+		if ((a = m.getRecipients(Message.RecipientType.CC)) != null) {
+			for (int j = 0; j < a.length; j++)
+			{
+				if(msgEntity.getCopyto() == null)
+				{
+					msgEntity.setCopyto(new StringBuilder(a[j].toString()));
+				}
+				else
+				{
+					msgEntity.setCopyto(msgEntity.getCopyto().append(", ").append(a[j].toString()));
+				}
+			}
+		}
+		// CC
+		if ((a = m.getRecipients(Message.RecipientType.BCC)) != null) {
+			for (int j = 0; j < a.length; j++)
+			{
+				if(msgEntity.getHiddencopyto() == null)
+				{
+					msgEntity.setHiddencopyto(new StringBuilder(a[j].toString()));
+				}
+				else
+				{
+					msgEntity.setHiddencopyto(new StringBuilder(msgEntity.getHiddencopyto() + ","+a[j].toString()));
+				}
+			}
+		}
+
+		// DATE
+		Date d = m.getSentDate();
+		if(msgEntity != null)
+		{
+			if(d != null)
+			{
+				msgEntity.setSent_date(new StringBuilder(String.valueOf(d.getTime())));
+			}
+			else
+			{
+				msgEntity.setSent_date(new StringBuilder(String.valueOf(new Date().getTime())));
+			}
+		}
+
+		try{
+			Object o = m.getContent();
+			if (o instanceof String) {
+				if( msgEntity != null )
+				{
+					msgEntity.setContent(new StringBuilder( o.toString()));
+				}
+			} else if (o instanceof Multipart) {
+				Multipart multipart = (Multipart)o;
+				int count = multipart.getCount();
+
+				for (int i = 0; i < count; i++)
+				{
+					if(msgEntity.getContent() == null || msgEntity.getContent().toString().trim().equals(""))
+					{
+						msgEntity.setContent(new StringBuilder(""));
+					}
+					if(multipart.getBodyPart(i).getContentType() != Part.ATTACHMENT)
+					{
+						msgEntity.setContent(msgEntity.getContent().append(" ").append(getPlainContent(multipart.getBodyPart(i))));
+					}
+
+				}
+
+			}
+		}catch (Exception e){
+			System.out.println("Exception ocurred!");
+			e.printStackTrace();
+		}
+
+		if(msgEntity != null && msgEntity.getId() != null){
+			listIMAPMsgs.add(msgEntity);
+		}
+
+	}
+
+	private StringBuilder getPlainContent(BodyPart bodyPart) throws IOException, MessagingException
+	{
+		try
+		{
+
+			if(bodyPart.getContent() instanceof String)
+			{
+				//				ByteArrayOutputStream out = new ByteArrayOutputStream();
+				//				InputStream in = bodyPart.getInputStream();
+				//				
+				//				byte[] buffer = new byte[1024];
+				//				byte[] data = null;
+				//				
+				//				while(in.read(buffer) != -1) {
+				//					out.write(buffer);
+				//				}
+				//				
+				//				data = out.toByteArray();
+
+				StringBuilder text = new StringBuilder(bodyPart.getContent().toString());
+
+				//				out.close();
+				//				in.close();
+
+				return text;
+			}
+		}catch(Exception e)
+		{
+			System.out.println(e.getMessage());
+			e.printStackTrace();
+			return new StringBuilder("");
+		}
+
+
+		return new StringBuilder("");
+	}
+
+}
Index: sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/src/pkg/crawler/entity/Message2SolrEntity.java
===================================================================
--- sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/src/pkg/crawler/entity/Message2SolrEntity.java	(revision 7576)
+++ sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/src/pkg/crawler/entity/Message2SolrEntity.java	(revision 7576)
@@ -0,0 +1,120 @@
+package pkg.crawler.entity;
+
+public class Message2SolrEntity {
+	
+	private StringBuilder id;
+	private StringBuilder user;
+	private StringBuilder folder;
+	private StringBuilder msgNo;
+	private StringBuilder from;
+	private StringBuilder to;
+	private StringBuilder subject;
+	private StringBuilder content;
+	private StringBuilder copyto;
+	private StringBuilder hiddencopyto;
+	private StringBuilder sent_date;
+	
+	public Message2SolrEntity()
+	{
+		id = new StringBuilder("");
+		user = new StringBuilder("");
+		folder = new StringBuilder("");
+		msgNo = new StringBuilder("");
+		from = new StringBuilder("");
+		to = new StringBuilder("");
+		subject = new StringBuilder("");
+		content = new StringBuilder("");
+		copyto = new StringBuilder("");
+		hiddencopyto = new StringBuilder("");
+		sent_date = new StringBuilder("");
+	}
+	
+	public StringBuilder getId() {
+		return id;
+	}
+	
+	public void setId(StringBuilder id) {
+		this.id = id;
+	}
+	
+	public StringBuilder getUser() {
+		return user;
+	}
+
+	public void setUser(StringBuilder user) {
+		this.user = user;
+	}
+
+	public StringBuilder getFolder() {
+		return folder;
+	}
+
+	public void setFolder(StringBuilder folder) {
+		this.folder = folder;
+	}
+	
+	public StringBuilder getMsgNo() {
+		return msgNo;
+	}
+
+	public void setMsgNo(StringBuilder msgNo) {
+		this.msgNo = msgNo;
+	}
+
+	public StringBuilder getFrom() {
+		return from;
+	}
+	
+	public void setFrom(StringBuilder from) {
+		this.from = from;
+	}
+	
+	public StringBuilder getTo() {
+		return to;
+	}
+	
+	public void setTo(StringBuilder to) {
+		this.to = to;
+	}
+	
+	public StringBuilder getSubject() {
+		return subject;
+	}
+	
+	public void setSubject(StringBuilder subject) {
+		this.subject = subject;
+	}
+	
+	public StringBuilder getContent() {
+		return content;
+	}
+	
+	public void setContent(StringBuilder content) {
+		this.content = content;
+	}
+	
+	public StringBuilder getCopyto() {
+		return copyto;
+	}
+	
+	public void setCopyto(StringBuilder copyto) {
+		this.copyto = copyto;
+	}
+	
+	public StringBuilder getHiddencopyto() {
+		return hiddencopyto;
+	}
+	
+	public void setHiddencopyto(StringBuilder hiddencopyto) {
+		this.hiddencopyto = hiddencopyto;
+	}
+	
+	public StringBuilder getSent_date() {
+		return sent_date;
+	}
+	
+	public void setSent_date(StringBuilder sent_date) {
+		this.sent_date = sent_date;
+	}
+	
+}
Index: sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/.settings/org.eclipse.jdt.core.prefs	(revision 7576)
+++ sandbox/expresso-solr/imapCrawler/JCrawlerForIMAP/.settings/org.eclipse.jdt.core.prefs	(revision 7576)
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/bootstrap.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/bootstrap.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/bootstrap.php	(revision 7576)
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+error_reporting(E_ALL | E_STRICT); 
+ini_set('display_errors',true);
+
+// Define path to application directory
+$basePath = realpath(dirname(__FILE__) . '/../');
+
+// Ensure library/ is on include_path
+set_include_path(implode(PATH_SEPARATOR, array(
+    realpath($basePath . '/library'),
+    realpath($basePath . '/tests/library'),
+    get_include_path(),
+)));
+
+function solariumUnittestAutoload($class)
+{
+    @include(str_replace("_", DIRECTORY_SEPARATOR, $class) . ".php");
+}
+
+// set up an autoload for Zend / Pear style class loading
+spl_autoload_register('solariumUnittestAutoload');
+
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/ClientTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/ClientTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/ClientTest.php	(revision 7576)
@@ -0,0 +1,866 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_ClientTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Client
+     */
+    protected $_client;
+
+    public function setUp()
+    {
+        $this->_client = new Solarium_Client();
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'adapter' => 'MyAdapter',
+            'adapteroptions' => array(
+                'host' => 'myhost',
+                'port' => 8080,
+            ),
+            'querytype' => array(
+                'myquerytype' => array(
+                    'query'          => 'MyQuery',
+                    'requestbuilder' => 'MyRequestBuilder',
+                    'responseparser' => 'MyResponseParser'
+                )
+            ),
+            'plugin' => array(
+                'myplugin' => array(
+                    'plugin' => 'MyClientPlugin',
+                    'options' => array(
+                        'option1' => 'value1',
+                        'option2' => 'value2',
+                    )
+                )
+            ),
+        );
+
+        $this->_client->setOptions($options);
+
+        $adapter = $this->_client->getAdapter();
+
+        $this->assertThat($adapter, $this->isInstanceOf('MyAdapter'));
+        $this->assertEquals(8080, $adapter->getPort());
+
+
+        $queryTypes = $this->_client->getQueryTypes();
+        $this->assertEquals(
+            $options['querytype']['myquerytype'],
+            $queryTypes['myquerytype']
+        );
+
+        $plugin = $this->_client->getPlugin('myplugin');
+        $this->assertThat($plugin, $this->isInstanceOf('MyClientPlugin'));
+        $this->assertEquals($options['plugin']['myplugin']['options'], $plugin->getOptions());
+
+    }
+
+    public function testConfigModeWithoutKeys()
+    {
+        $options = array(
+            'adapter' => 'MyAdapter',
+            'adapteroptions' => array(
+                'host' => 'myhost',
+                'port' => 8080,
+            ),
+            'querytype' => array(
+                array(
+                    'type'           => 'myquerytype',
+                    'query'          => 'MyQuery',
+                    'requestbuilder' => 'MyRequestBuilder',
+                    'responseparser' => 'MyResponseParser',
+                )
+            ),
+            'plugin' => array(
+                 array(
+                    'key'     => 'myplugin',
+                    'plugin'  => 'MyClientPlugin',
+                    'options' => array(
+                        'option1' => 'value1',
+                        'option2' => 'value2',
+                    )
+                )
+            ),
+        );
+
+        $this->_client->setOptions($options);
+
+        $adapter = $this->_client->getAdapter();
+
+        $this->assertThat($adapter, $this->isInstanceOf('MyAdapter'));
+        $this->assertEquals(8080, $adapter->getPort());
+
+        $queryTypes = $this->_client->getQueryTypes();
+        $this->assertEquals(
+            array(
+                'requestbuilder' => 'MyRequestBuilder',
+                'responseparser' => 'MyResponseParser',
+                'query'          => 'MyQuery',
+            ),
+            $queryTypes['myquerytype']
+        );
+
+        $plugin = $this->_client->getPlugin('myplugin');
+        $this->assertThat($plugin, $this->isInstanceOf('MyClientPlugin'));
+        $this->assertEquals($options['plugin'][0]['options'], $plugin->getOptions());
+    }
+
+    public function testSetAndGetAdapterWithDefaultAdapter()
+    {
+        $defaultAdapter = $this->_client->getOption('adapter');
+        $adapter = $this->_client->getAdapter();
+        $this->assertThat($adapter, $this->isInstanceOf($defaultAdapter));
+    }
+
+    public function testSetAndGetAdapterWithString()
+    {
+        $adapterClass = 'MyAdapter';
+        $this->_client->setAdapter($adapterClass);
+        $this->assertThat($this->_client->getAdapter(), $this->isInstanceOf($adapterClass));
+    }
+
+    public function testSetAndGetAdapterWithObject()
+    {
+        $adapterClass = 'MyAdapter';
+        $this->_client->setAdapter(new $adapterClass);
+        $this->assertThat($this->_client->getAdapter(), $this->isInstanceOf($adapterClass));
+    }
+
+    public function testRegisterQueryTypeAndGetQueryTypes()
+    {
+        $queryTypes = $this->_client->getQueryTypes();
+
+        $this->_client->registerQueryType('myquerytype','myquery','mybuilder','myparser');
+
+        $queryTypes['myquerytype'] = array(
+            'query' => 'myquery',
+            'requestbuilder' => 'mybuilder',
+            'responseparser' => 'myparser',
+        );
+
+        $this->assertEquals(
+            $queryTypes,
+            $this->_client->getQueryTypes()
+        );
+    }
+
+    public function testRegisterAndGetPlugin()
+    {
+        $options = array('option1' => 1);
+        $this->_client->registerPlugin('testplugin','MyClientPlugin',$options);
+
+        $plugin = $this->_client->getPlugin('testplugin');
+
+        $this->assertThat(
+            $plugin,
+            $this->isInstanceOf('MyClientPlugin')
+        );
+
+        $this->assertEquals(
+            $options,
+            $plugin->getOptions()
+        );
+    }
+
+    public function testRegisterInvalidPlugin()
+    {
+        $this->setExpectedException('Solarium_Exception');
+        $this->_client->registerPlugin('testplugin','StdClass');
+    }
+
+    public function testGetInvalidPlugin()
+    {
+        $this->assertEquals(
+            null,
+            $this->_client->getPlugin('invalidplugin', false)
+        );
+    }
+
+    public function testAutoloadPlugin()
+    {
+        $loadbalancer = $this->_client->getPlugin('loadbalancer');
+        $this->assertThat(
+            $loadbalancer,
+            $this->isInstanceOf('Solarium_Plugin_Loadbalancer')
+        );
+    }
+
+    public function testAutoloadInvalidPlugin()
+    {
+        $this->setExpectedException('Solarium_Exception');
+        $this->_client->getPlugin('invalidpluginname');
+    }
+
+    public function testRemoveAndGetPlugins()
+    {
+        $options = array('option1' => 1);
+        $this->_client->registerPlugin('testplugin','MyClientPlugin',$options);
+
+        $plugin = $this->_client->getPlugin('testplugin');
+        $plugins = $this->_client->getPlugins();
+
+        $this->assertEquals(
+            array('testplugin' => $plugin),
+            $plugins
+        );
+
+        $this->_client->removePlugin('testplugin');
+        $plugins = $this->_client->getPlugins();
+
+        $this->assertEquals(
+            array(),
+            $plugins
+        );
+    }
+
+    public function testRemovePluginAndGetPluginsWithObjectInput()
+    {
+        $options = array('option1' => 1);
+        $this->_client->registerPlugin('testplugin','MyClientPlugin',$options);
+
+        $plugin = $this->_client->getPlugin('testplugin');
+        $plugins = $this->_client->getPlugins();
+
+        $this->assertEquals(
+            array('testplugin' => $plugin),
+            $plugins
+        );
+
+        $this->_client->removePlugin($plugin);
+        $plugins = $this->_client->getPlugins();
+
+        $this->assertEquals(
+            array(),
+            $plugins
+        );
+    }
+
+    public function testCreateRequest()
+    {
+        $queryStub = $this->getMock('Solarium_Query_Select');
+        $queryStub->expects($this->any())
+             ->method('getType')
+             ->will($this->returnValue('testquerytype'));
+
+        $observer = $this->getMock('Solarium_Client_RequestBuilder', array('build'));
+        $observer->expects($this->once())
+                 ->method('build')
+                 ->with($this->equalTo($queryStub));
+
+        $this->_client->registerQueryType('testquerytype', 'Solarium_Query_Select', $observer, '');
+        $this->_client->createRequest($queryStub);
+    }
+
+    public function testCreateRequestInvalidQueryType()
+    {
+        $queryStub = $this->getMock('Solarium_Query_Select');
+        $queryStub->expects($this->any())
+             ->method('getType')
+             ->will($this->returnValue('testquerytype'));
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_client->createRequest($queryStub);
+    }
+
+    public function testCreateRequestPrePlugin()
+    {
+        $query = new Solarium_Query_Select();
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('preCreateRequest')
+                 ->with($this->equalTo($query));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $this->_client->createRequest($query);
+    }
+
+    public function testCreateRequestPostPlugin()
+    {
+        $query = new Solarium_Query_Select();
+        $request = $this->_client->createRequest($query);
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('postCreateRequest')
+                 ->with($this->equalTo($query),$this->equalTo($request));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $this->_client->createRequest($query);
+    }
+
+    public function testCreateRequestWithOverridingPlugin()
+    {
+        $overrideValue =  'dummyvalue';
+        $query = new Solarium_Query_Select();
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('preCreateRequest')
+                 ->with($this->equalTo($query))
+                 ->will($this->returnValue($overrideValue));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $request = $this->_client->createRequest($query);
+
+        $this->assertEquals(
+            $overrideValue,
+            $request
+        );
+    }
+
+    public function testCreateResult()
+    {
+        $query = new Solarium_Query_Select();
+        $response = new Solarium_Client_Response('',array('HTTP 1.0 200 OK'));
+        $result = $this->_client->createResult($query, $response);
+
+        $this->assertThat(
+            $result,
+            $this->isInstanceOf($query->getResultClass())
+        );
+    }
+
+    public function testCreateResultPrePlugin()
+    {
+        $query = new Solarium_Query_Select();
+        $response = new Solarium_Client_Response('',array('HTTP 1.0 200 OK'));
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('preCreateResult')
+                 ->with($this->equalTo($query),$this->equalTo($response));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $this->_client->createResult($query, $response);
+    }
+
+    public function testCreateResultPostPlugin()
+    {
+        $query = new Solarium_Query_Select();
+        $response = new Solarium_Client_Response('',array('HTTP 1.0 200 OK'));
+        $result = $this->_client->createResult($query, $response);
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('postCreateResult')
+                 ->with($this->equalTo($query), $this->equalTo($response), $this->equalTo($result));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $this->_client->createResult($query, $response);
+    }
+
+    public function testCreateResultWithOverridingPlugin()
+    {
+        $overrideValue =  'dummyvalue';
+        $query = new Solarium_Query_Select();
+        $response = new Solarium_Client_Response('',array('HTTP 1.0 200 OK'));
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('preCreateResult')
+                 ->with($this->equalTo($query), $this->equalTo($response))
+                 ->will($this->returnValue($overrideValue));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $result = $this->_client->createResult($query, $response);
+
+        $this->assertEquals(
+            $overrideValue,
+            $result
+        );
+    }
+
+    public function testExecute()
+    {
+        $query = new Solarium_Query_Ping();
+
+        $observer = $this->getMock('Solarium_Client', array('createRequest','executeRequest','createResult'));
+
+        $observer->expects($this->once())
+                 ->method('createRequest')
+                 ->with($this->equalTo($query))
+                 ->will($this->returnValue('dummyrequest'));
+
+        $observer->expects($this->once())
+                 ->method('executeRequest')
+                 ->with($this->equalTo('dummyrequest'))
+                 ->will($this->returnValue('dummyresponse'));
+
+        $observer->expects($this->once())
+                 ->method('createResult')
+                 ->with($this->equalTo($query),$this->equalTo('dummyresponse'));
+
+        $observer->execute($query);
+    }
+
+    public function testExecutePrePlugin()
+    {
+        $query = new Solarium_Query_Ping();
+
+        $mock = $this->getMock('Solarium_Client', array('createRequest','executeRequest','createResult'));
+
+        $mock->expects($this->once())
+             ->method('createRequest')
+             ->will($this->returnValue('dummyrequest'));
+
+        $mock->expects($this->once())
+             ->method('executeRequest')
+             ->will($this->returnValue('dummyresponse'));
+
+        $mock->expects($this->once())
+             ->method('createResult')
+             ->will($this->returnValue('dummyresult'));
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('preExecute')
+                 ->with($this->equalTo($query));
+
+        $mock->registerPlugin('testplugin', $observer);
+        $mock->execute($query);
+    }
+
+    public function testExecutePostPlugin()
+    {
+        $query = new Solarium_Query_Ping();
+
+        $mock = $this->getMock('Solarium_Client', array('createRequest','executeRequest','createResult'));
+
+        $mock->expects($this->once())
+             ->method('createRequest')
+             ->will($this->returnValue('dummyrequest'));
+
+        $mock->expects($this->once())
+             ->method('executeRequest')
+             ->will($this->returnValue('dummyresponse'));
+
+        $mock->expects($this->once())
+             ->method('createResult')
+             ->will($this->returnValue('dummyresult'));
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('postExecute')
+                 ->with($this->equalTo($query), $this->equalTo('dummyresult'));
+
+        $mock->registerPlugin('testplugin', $observer);
+        $mock->execute($query);
+    }
+
+    public function testExecuteWithOverridingPlugin()
+    {
+        $query = new Solarium_Query_Ping();
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('preExecute')
+                 ->with($this->equalTo($query))
+                 ->will($this->returnValue('dummyoverride'));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $result = $this->_client->execute($query);
+
+        $this->assertEquals(
+            'dummyoverride',
+            $result
+        );
+    }
+
+    public function testExecuteRequest()
+    {
+        $request = new Solarium_Client_Request();
+        $dummyResponse = 'dummyresponse';
+
+        $observer = $this->getMock('Solarium_Client_Adapter', array('execute'));
+        $observer->expects($this->once())
+                 ->method('execute')
+                 ->with($this->equalTo($request))
+                 ->will($this->returnValue($dummyResponse));
+
+        $this->_client->setAdapter($observer);
+        $response = $this->_client->executeRequest($request);
+
+        $this->assertEquals(
+            $dummyResponse,
+            $response
+        );
+    }
+
+    public function testExecuteRequestPrePlugin()
+    {
+        $request = new Solarium_Client_Request();
+        $dummyResponse = 'dummyresponse';
+
+        $mockAdapter = $this->getMock('Solarium_Client_Adapter', array('execute'));
+        $mockAdapter->expects($this->once())
+                 ->method('execute')
+                 ->with($this->equalTo($request))
+                 ->will($this->returnValue($dummyResponse));
+        $this->_client->setAdapter($mockAdapter);
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('preExecuteRequest')
+                 ->with($this->equalTo($request));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $this->_client->executeRequest($request);
+    }
+
+    public function testExecuteRequestPostPlugin()
+    {
+        $request = new Solarium_Client_Request();
+        $dummyResponse = 'dummyresponse';
+
+        $mockAdapter = $this->getMock('Solarium_Client_Adapter', array('execute'));
+        $mockAdapter->expects($this->any())
+                 ->method('execute')
+                 ->with($this->equalTo($request))
+                 ->will($this->returnValue($dummyResponse));
+        $this->_client->setAdapter($mockAdapter);
+
+        $response = $this->_client->executeRequest($request);
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('postExecuteRequest')
+                 ->with($this->equalTo($request), $this->equalTo($response));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $this->_client->executeRequest($request);
+    }
+
+    public function testExecuteRequestWithOverridingPlugin()
+    {
+        $request = new Solarium_Client_Request();
+        $dummyOverride = 'dummyoverride';
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('preExecuteRequest')
+                 ->with($this->equalTo($request))
+                    ->will($this->returnValue($dummyOverride));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $response = $this->_client->executeRequest($request);
+
+        $this->assertEquals(
+            $dummyOverride,
+            $response
+        );
+    }
+
+    public function testPing()
+    {
+        $query = new Solarium_Query_Ping();
+
+        $observer = $this->getMock('Solarium_Client', array('execute'));
+        $observer->expects($this->once())
+                 ->method('execute')
+                 ->with($this->equalTo($query));
+
+        $observer->ping($query);
+    }
+
+    public function testSelect()
+    {
+        $query = new Solarium_Query_Select();
+
+        $observer = $this->getMock('Solarium_Client', array('execute'));
+        $observer->expects($this->once())
+                 ->method('execute')
+                 ->with($this->equalTo($query));
+
+        $observer->select($query);
+    }
+
+    public function testUpdate()
+    {
+        $query = new Solarium_Query_Update();
+
+        $observer = $this->getMock('Solarium_Client', array('execute'));
+        $observer->expects($this->once())
+                 ->method('execute')
+                 ->with($this->equalTo($query));
+
+        $observer->update($query);
+    }
+
+    public function testMoreLikeThis()
+    {
+        $query = new Solarium_Query_MoreLikeThis();
+
+        $observer = $this->getMock('Solarium_Client', array('execute'));
+        $observer->expects($this->once())
+                 ->method('execute')
+                 ->with($this->equalTo($query));
+
+        $observer->moreLikeThis($query);
+    }
+
+    public function testAnalyze()
+    {
+        $query = new Solarium_Query_Analysis_Field();
+
+        $observer = $this->getMock('Solarium_Client', array('execute'));
+        $observer->expects($this->once())
+                 ->method('execute')
+                 ->with($this->equalTo($query));
+
+        $observer->analyze($query);
+    }
+
+    public function testTerms()
+    {
+        $query = new Solarium_Query_Terms();
+
+        $observer = $this->getMock('Solarium_Client', array('execute'));
+        $observer->expects($this->once())
+                 ->method('execute')
+                 ->with($this->equalTo($query));
+
+        $observer->terms($query);
+    }
+
+    public function testSuggester()
+    {
+        $query = new Solarium_Query_Suggester();
+
+        $observer = $this->getMock('Solarium_Client', array('execute'));
+        $observer->expects($this->once())
+                 ->method('execute')
+                 ->with($this->equalTo($query));
+
+        $observer->suggester($query);
+    }
+
+    public function testCreateQuery()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+        $query = $this->_client->createQuery(Solarium_Client::QUERYTYPE_SELECT, $options);
+
+        // check class mapping
+        $this->assertThat($query, $this->isInstanceOf('Solarium_Query_Select'));
+
+        // check option forwarding
+        $queryOptions = $query->getOptions();
+        $this->assertEquals(
+            $options['optionB'],
+            $queryOptions['optionB']
+        );
+    }
+
+    public function testCreateQueryWithInvalidQueryType()
+    {
+        $this->setExpectedException('Solarium_Exception');
+        $this->_client->createQuery('invalidtype');
+    }
+
+    public function testCreateQueryPrePlugin()
+    {
+        $type = Solarium_Client::QUERYTYPE_SELECT;
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('preCreateQuery')
+                 ->with($this->equalTo($type), $this->equalTo($options));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $this->_client->createQuery($type, $options);
+    }
+
+    public function testCreateQueryWithOverridingPlugin()
+    {
+        $type = Solarium_Client::QUERYTYPE_SELECT;
+        $options = array('optionA' => 1, 'optionB' => 2);
+        $dummyvalue = 'test123';
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('preCreateQuery')
+                 ->with($this->equalTo($type), $this->equalTo($options))
+                 ->will($this->returnValue($dummyvalue));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $query = $this->_client->createQuery($type, $options);
+
+        $this->assertEquals(
+            $dummyvalue,
+            $query
+        );
+    }
+
+    public function testCreateQueryPostPlugin()
+    {
+        $type = Solarium_Client::QUERYTYPE_SELECT;
+        $options = array('optionA' => 1, 'optionB' => 2);
+        $query = $this->_client->createQuery($type, $options);
+
+        $observer = $this->getMock('Solarium_Plugin_Abstract', array(), array($this->_client,array()));
+        $observer->expects($this->once())
+                 ->method('postCreateQuery')
+                 ->with($this->equalTo($type), $this->equalTo($options), $this->equalTo($query));
+
+        $this->_client->registerPlugin('testplugin', $observer);
+        $this->_client->createQuery($type, $options);
+    }
+
+    public function testCreateSelect()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Client', array('createQuery'));
+        $observer->expects($this->once())
+                 ->method('createQuery')
+                 ->with($this->equalTo(Solarium_Client::QUERYTYPE_SELECT), $this->equalTo($options));
+
+        $observer->createSelect($options);
+    }
+
+    public function testCreateUpdate()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Client', array('createQuery'));
+        $observer->expects($this->once())
+                 ->method('createQuery')
+                 ->with($this->equalTo(Solarium_Client::QUERYTYPE_UPDATE), $this->equalTo($options));
+
+        $observer->createUpdate($options);
+    }
+
+    public function testCreatePing()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Client', array('createQuery'));
+        $observer->expects($this->once())
+                 ->method('createQuery')
+                 ->with($this->equalTo(Solarium_Client::QUERYTYPE_PING), $this->equalTo($options));
+
+        $observer->createPing($options);
+    }
+
+    public function testCreateMoreLikeThis()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Client', array('createQuery'));
+        $observer->expects($this->once())
+                 ->method('createQuery')
+                 ->with($this->equalTo(Solarium_Client::QUERYTYPE_MORELIKETHIS), $this->equalTo($options));
+
+        $observer->createMoreLikeThis($options);
+    }
+
+    public function testCreateAnalysisField()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Client', array('createQuery'));
+        $observer->expects($this->once())
+                 ->method('createQuery')
+                 ->with($this->equalTo(Solarium_Client::QUERYTYPE_ANALYSIS_FIELD), $this->equalTo($options));
+
+        $observer->createAnalysisField($options);
+    }
+
+    public function testCreateAnalysisDocument()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Client', array('createQuery'));
+        $observer->expects($this->once())
+                 ->method('createQuery')
+                 ->with($this->equalTo(Solarium_Client::QUERYTYPE_ANALYSIS_DOCUMENT), $this->equalTo($options));
+
+        $observer->createAnalysisDocument($options);
+    }
+
+    public function testCreateTerms()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Client', array('createQuery'));
+        $observer->expects($this->once())
+                 ->method('createQuery')
+                 ->with($this->equalTo(Solarium_Client::QUERYTYPE_TERMS), $this->equalTo($options));
+
+        $observer->createTerms($options);
+    }
+
+    public function testCreateSuggester()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Client', array('createQuery'));
+        $observer->expects($this->once())
+                 ->method('createQuery')
+                 ->with($this->equalTo(Solarium_Client::QUERYTYPE_SUGGESTER), $this->equalTo($options));
+
+        $observer->createSuggester($options);
+    }
+
+    public function testTriggerEvent()
+    {
+        $eventName = 'Test';
+        $params = array('a', 'b');
+        $override = true;
+
+        $clientMock = $this->getMock('Solarium_Client', array('_callPlugins'));
+        $clientMock->expects($this->once())
+             ->method('_callPlugins')
+             ->with($this->equalTo('event'.$eventName), $this->equalTo($params), $override);
+
+        $clientMock->triggerEvent($eventName, $params, $override);
+    }
+
+}
+
+class MyAdapter extends Solarium_Client_Adapter_Http{
+
+    public function execute($request)
+    {
+        $response = new Solarium_Client_Response('{}', array('HTTP/1.1 200 OK'));
+        return $response;
+    }
+}
+
+class MyClientPlugin extends Solarium_Plugin_Abstract{
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/ResultTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/ResultTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/ResultTest.php	(revision 7576)
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_ResultTest extends PHPUnit_Framework_TestCase
+{
+    
+    protected $_client, $_query, $_response, $_result;
+
+    public function setUp()
+    {
+        $this->_client = new Solarium_Client();
+        $this->_query = new Solarium_Query_Select();
+        $this->_headers = array('HTTP/1.0 304 Not Modified');
+        $data = '{"responseHeader":{"status":0,"QTime":1,"params":{"wt":"json","q":"xyz"}},"response":{"numFound":0,"start":0,"docs":[]}}';
+        $this->_response = new Solarium_Client_Response($data, $this->_headers);
+        
+        $this->_result = new Solarium_Result($this->_client, $this->_query, $this->_response);
+    }
+
+    public function testResultWithErrorResponse()
+    {
+        $headers = array('HTTP/1.0 404 Not Found');
+        $response = new Solarium_Client_Response('', $headers);
+
+        $this->setExpectedException('Solarium_Exception');
+        new Solarium_Result($this->_client, $this->_query, $response);
+    }
+
+    public function testGetResponse()
+    {
+        $this->assertEquals($this->_response, $this->_result->getResponse());
+    }
+
+    public function testGetQuery()
+    {
+        $this->assertEquals($this->_query, $this->_result->getQuery());
+    }
+
+    public function testGetData()
+    {
+        $data = array(
+            'responseHeader' => array('status' => 0, 'QTime' => 1, 'params' => array('wt' => 'json', 'q' => 'xyz')),
+            'response' => array('numFound' => 0, 'start' => 0, 'docs' => array())
+        );
+
+        $this->assertEquals($data, $this->_result->getData());
+    }
+
+    public function testGetInvalidData()
+    {
+        $data = 'invalid';
+        $this->_response = new Solarium_Client_Response($data, $this->_headers);
+        $this->_result = new Solarium_Result($this->_client, $this->_query, $this->_response);
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_result->getData();
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/FilterQueryTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/FilterQueryTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/FilterQueryTest.php	(revision 7576)
@@ -0,0 +1,111 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_FilterQueryTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_filterQuery;
+
+    public function setUp()
+    {
+        $this->_filterQuery = new Solarium_Query_Select_FilterQuery;
+    }
+
+    public function testConfigMode()
+    {
+        $fq = new Solarium_Query_Select_FilterQuery(array('tag' => array('t1','t2'),'key' => 'k1','query'=> 'id:[10 TO 20]'));
+
+        $this->assertEquals(array('t1','t2'), $fq->getTags());
+        $this->assertEquals('k1', $fq->getKey());
+        $this->assertEquals('id:[10 TO 20]', $fq->getQuery());
+    }
+
+    public function testConfigModeWithSingleValueTag()
+    {
+        $fq = new Solarium_Query_Select_FilterQuery(array('tag' => 't1','key' => 'k1','query'=> 'id:[10 TO 20]'));
+
+        $this->assertEquals(array('t1'), $fq->getTags());
+        $this->assertEquals('k1', $fq->getKey());
+        $this->assertEquals('id:[10 TO 20]', $fq->getQuery());
+    }
+
+    public function testSetAndGetKey()
+    {
+        $this->_filterQuery->setKey('testkey');
+        $this->assertEquals('testkey', $this->_filterQuery->getKey());
+    }
+
+    public function testSetAndGetQuery()
+    {
+        $this->_filterQuery->setQuery('category:1');
+        $this->assertEquals('category:1', $this->_filterQuery->getQuery());
+    }
+
+    public function testSetAndGetQueryWithBind()
+    {
+        $this->_filterQuery->setQuery('id:%1%', array(678));
+        $this->assertEquals('id:678', $this->_filterQuery->getQuery());
+    }
+
+    public function testAddTag()
+    {
+        $this->_filterQuery->addTag('testtag');
+        $this->assertEquals(array('testtag'), $this->_filterQuery->getTags());
+    }
+
+    public function testAddTags()
+    {
+        $this->_filterQuery->addTags(array('t1','t2'));
+        $this->assertEquals(array('t1','t2'), $this->_filterQuery->getTags());
+    }
+
+    public function testRemoveTag()
+    {
+        $this->_filterQuery->addTags(array('t1','t2'));
+        $this->_filterQuery->removeTag('t1');
+        $this->assertEquals(array('t2'), $this->_filterQuery->getTags());
+    }
+
+    public function testClearTags()
+    {
+        $this->_filterQuery->addTags(array('t1','t2'));
+        $this->_filterQuery->clearTags();
+        $this->assertEquals(array(), $this->_filterQuery->getTags());
+    }
+
+    public function testSetTags()
+    {
+        $this->_filterQuery->addTags(array('t1','t2'));
+        $this->_filterQuery->setTags(array('t3','t4'));
+        $this->assertEquals(array('t3','t4'), $this->_filterQuery->getTags());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/GroupingTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/GroupingTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/GroupingTest.php	(revision 7576)
@@ -0,0 +1,212 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_GroupingTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_Grouping
+     */
+    protected $_grouping;
+
+    public function setUp()
+    {
+        $this->_grouping = new Solarium_Query_Select_Component_Grouping;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'fields' => array('fieldA','fieldB'),
+            'queries' => array('cat:3','cat:4'),
+            'limit' => 8,
+            'offset' => 1,
+            'sort' => 'score desc',
+            'mainresult' => false,
+            'numberofgroups' => true,
+            'cachepercentage' => 45,
+            'truncate' => true,
+        );
+
+        $this->_grouping->setOptions($options);
+
+        $this->assertEquals($options['fields'], $this->_grouping->getFields());
+        $this->assertEquals($options['queries'], $this->_grouping->getQueries());
+        $this->assertEquals($options['limit'], $this->_grouping->getLimit());
+        $this->assertEquals($options['offset'], $this->_grouping->getOffset());
+        $this->assertEquals($options['sort'], $this->_grouping->getSort());
+        $this->assertEquals($options['mainresult'], $this->_grouping->getMainResult());
+        $this->assertEquals($options['numberofgroups'], $this->_grouping->getNumberOfGroups());
+        $this->assertEquals($options['cachepercentage'], $this->_grouping->getCachePercentage());
+        $this->assertEquals($options['truncate'], $this->_grouping->getTruncate());
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Query_Select::COMPONENT_GROUPING, $this->_grouping->getType());
+    }
+
+    public function testSetAndGetFieldsSingle()
+    {
+        $value = 'fieldC';
+        $this->_grouping->setFields($value);
+
+        $this->assertEquals(
+            array($value),
+            $this->_grouping->getFields()
+        );
+    }
+
+    public function testSetAndGetFieldsCommaSeparated()
+    {
+        $value = 'fieldD, fieldE';
+        $this->_grouping->setFields($value);
+
+        $this->assertEquals(
+            array(
+                'fieldD',
+                'fieldE',
+            ),
+            $this->_grouping->getFields()
+        );
+    }
+
+    public function testSetAndGetFieldsArray()
+    {
+        $values = array('fieldD', 'fieldE');
+        $this->_grouping->setFields($values);
+
+        $this->assertEquals(
+            $values,
+            $this->_grouping->getFields()
+        );
+    }
+
+    public function testSetAndGetQueriesSingle()
+    {
+        $value = 'cat:3';
+        $this->_grouping->setQueries($value);
+
+        $this->assertEquals(
+            array($value),
+            $this->_grouping->getQueries()
+        );
+    }
+
+    public function testSetAndGetQueriesArray()
+    {
+        $values = array('cat:5', 'cat:6');
+        $this->_grouping->setQueries($values);
+
+        $this->assertEquals(
+            $values,
+            $this->_grouping->getQueries()
+        );
+    }
+
+    public function testSetAndGetLimit()
+    {
+        $value = '12';
+        $this->_grouping->setLimit($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_grouping->getLimit()
+        );
+    }
+
+    public function testSetAndGetOffset()
+    {
+        $value = '2';
+        $this->_grouping->setOffset($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_grouping->getOffset()
+        );
+    }
+
+    public function testSetAndGetSort()
+    {
+        $value = 'price desc';
+        $this->_grouping->setSort($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_grouping->getSort()
+        );
+    }
+
+    public function testSetAndGetMainResult()
+    {
+        $value = true;
+        $this->_grouping->setMainResult($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_grouping->getMainResult()
+        );
+    }
+
+    public function testSetAndGetNumberOfGroups()
+    {
+        $value = true;
+        $this->_grouping->setNumberOfGroups($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_grouping->getNumberOfGroups()
+        );
+    }
+
+    public function testSetAndGetCachePercentage()
+    {
+        $value = 40;
+        $this->_grouping->setCachePercentage($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_grouping->getCachePercentage()
+        );
+    }
+
+    public function testSetAndGetTruncate()
+    {
+        $value = true;
+        $this->_grouping->setTruncate($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_grouping->getTruncate()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Facet/RangeTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Facet/RangeTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Facet/RangeTest.php	(revision 7576)
@@ -0,0 +1,135 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_Facet_RangeTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_Facet_Range
+     */
+    protected $_facet;
+
+    public function setUp()
+    {
+        $this->_facet = new Solarium_Query_Select_Component_Facet_Range;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'key' => 'myKey',
+            'exclude' => array('e1','e2'),
+            'field' => 'content',
+            'start' => 1,
+            'end' => 100,
+            'gap' => 10,
+            'hardend' => true,
+            'other' => 'all',
+            'include' => 'lower',
+
+        );
+
+        $this->_facet->setOptions($options);
+
+        $this->assertEquals($options['key'], $this->_facet->getKey());
+        $this->assertEquals($options['exclude'], $this->_facet->getExcludes());
+        $this->assertEquals($options['field'], $this->_facet->getField());
+        $this->assertEquals($options['start'], $this->_facet->getStart());
+        $this->assertEquals($options['end'], $this->_facet->getEnd());
+        $this->assertEquals($options['gap'], $this->_facet->getGap());
+        $this->assertEquals($options['hardend'], $this->_facet->getHardend());
+        $this->assertEquals($options['other'], $this->_facet->getOther());
+        $this->assertEquals($options['include'], $this->_facet->getInclude());
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(
+            Solarium_Query_Select_Component_FacetSet::FACET_RANGE,
+            $this->_facet->getType()
+        );
+    }
+
+    public function testSetAndGetField()
+    {
+        $this->_facet->setField('price');
+        $this->assertEquals('price', $this->_facet->getField());
+    }
+
+    public function testSetAndGetStart()
+    {
+        $this->_facet->setStart(1);
+        $this->assertEquals(1, $this->_facet->getStart());
+    }
+
+    public function testSetAndGetEnd()
+    {
+        $this->_facet->setEnd(100);
+        $this->assertEquals(100, $this->_facet->getEnd());
+    }
+
+    public function testSetAndGetGap()
+    {
+        $this->_facet->setGap(10);
+        $this->assertEquals(10, $this->_facet->getGap());
+    }
+
+    public function testSetAndGetHardend()
+    {
+        $this->_facet->setHardend(true);
+        $this->assertEquals(true, $this->_facet->getHardend());
+    }
+
+    public function testSetAndGetOther()
+    {
+        $this->_facet->setOther('all');
+        $this->assertEquals('all', $this->_facet->getOther());
+    }
+
+    public function testSetAndGetOtherArray()
+    {
+        $this->_facet->setOther(array('before','after'));
+        $this->assertEquals('before,after', $this->_facet->getOther());
+    }
+
+    public function testSetAndGetInclude()
+    {
+        $this->_facet->setInclude('all');
+        $this->assertEquals('all', $this->_facet->getInclude());
+    }
+
+    public function testSetAndGetIncludeArray()
+    {
+        $this->_facet->setInclude(array('lower','upper'));
+        $this->assertEquals('lower,upper', $this->_facet->getInclude());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Facet/MultiQueryTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Facet/MultiQueryTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Facet/MultiQueryTest.php	(revision 7576)
@@ -0,0 +1,400 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_Facet_MultiQueryTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_Facet_MultiQuery
+     */
+    protected $_facet;
+
+    public function setUp()
+    {
+        $this->_facet = new Solarium_Query_Select_Component_Facet_MultiQuery;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'key' => 'myKey',
+            'exclude' => array('e1','e2'),
+            'query' => array(
+                array(
+                    'key' => 'k1',
+                    'query' => 'category:1',
+                    'exclude' => array('fq1','fq2')
+                ),
+                'k2' => array(
+                    'query' => 'category:2'
+                ),
+            )
+        );
+
+        $this->_facet->setOptions($options);
+
+        $this->assertEquals($options['key'], $this->_facet->getKey());
+        $this->assertEquals($options['exclude'], $this->_facet->getExcludes());
+
+        $query1 = $this->_facet->getQuery('k1');
+        $this->assertEquals('k1', $query1->getKey());
+        $this->assertEquals('category:1', $query1->getQuery());
+        $this->assertEquals(array('fq1','fq2', 'e1', 'e2'), $query1->getExcludes());
+
+        $query2 = $this->_facet->getQuery('k2');
+        $this->assertEquals('k2', $query2->getKey());
+        $this->assertEquals('category:2', $query2->getQuery());
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(
+            Solarium_Query_Select_Component_FacetSet::FACET_MULTIQUERY,
+            $this->_facet->getType()
+        );
+    }
+
+    public function testCreateAndGetQuery()
+    {
+        $key = 'k1';
+        $query = 'category:1';
+        $excludes = array('fq1','fq2');
+
+        $facetQuery = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery->setKey($key);
+        $facetQuery->setQuery($query);
+        $facetQuery->setExcludes($excludes);
+
+        $this->_facet->createQuery($key, $query, $excludes);
+
+        $this->assertEquals(
+            $facetQuery,
+            $this->_facet->getQuery($key)
+        );
+    }
+
+    public function testAddAndGetQuery()
+    {
+        $key = 'k1';
+        $query = 'category:1';
+        $excludes = array('fq1','fq2');
+
+        $facetQuery = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery->setKey($key);
+        $facetQuery->setQuery($query);
+        $facetQuery->setExcludes($excludes);
+
+        $this->_facet->addQuery($facetQuery);
+
+        $this->assertEquals(
+            $facetQuery,
+            $this->_facet->getQuery($key)
+        );
+    }
+
+    public function testAddQueryWithConfig()
+    {
+        $config = array(
+            'key' => 'k1',
+            'query' => 'category:1',
+            'excludes' => array('fq1','fq2')
+        );
+
+        $facetQuery = new Solarium_Query_Select_Component_Facet_Query($config);
+
+        $this->_facet->addQuery($config);
+
+        $this->assertEquals(
+            $facetQuery,
+            $this->_facet->getQuery($config['key'])
+        );
+    }
+
+    public function testAddQueryNoKey()
+    {
+        $query = 'category:1';
+        $excludes = array('fq1','fq2');
+        
+        $facetQuery = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery->setQuery($query);
+        $facetQuery->setExcludes($excludes);
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_facet->addQuery($facetQuery);
+    }
+
+    public function testAddQueryNoUniqueKey()
+    {
+        $facetQuery1 = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery1->setKey('k1');
+        $facetQuery1->setQuery('category:1');
+
+        $facetQuery2 = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery2->setKey('k1');
+        $facetQuery2->setQuery('category:2');
+
+        $this->_facet->addQuery($facetQuery1);
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_facet->addQuery($facetQuery2);
+    }
+
+
+    public function testAddQueryExcludeForwarding()
+    {
+        $this->_facet->addExclude('fq1');
+
+        $facetQuery = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery->setKey('k1');
+        $facetQuery->setQuery('category:1');
+
+        $this->_facet->addQuery($facetQuery);
+        
+        $this->assertEquals(
+            array('fq1'),
+            $facetQuery->getExcludes()
+        );
+    }
+
+    public function testAddAndGetQueries()
+    {
+        $facetQuery1 = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery1->setKey('k1');
+        $facetQuery1->setQuery('category:1');
+
+        $facetQuery2 = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery2->setKey('k2');
+        $facetQuery2->setQuery('category:2');
+
+        $this->_facet->addQueries(array($facetQuery1, $facetQuery2));
+
+        $this->assertEquals(
+            array('k1' => $facetQuery1, 'k2' => $facetQuery2),
+            $this->_facet->getQueries()
+        );
+    }
+
+    public function testAddQueriesWithConfig()
+    {
+        $facetQuery1 = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery1->setKey('k1');
+        $facetQuery1->setQuery('category:1');
+        $facetQuery1->addExcludes(array('fq1','fq2'));
+
+        $facetQuery2 = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery2->setKey('k2');
+        $facetQuery2->setQuery('category:2');
+
+        $facetQueries = array('k1' => $facetQuery1, 'k2' => $facetQuery2);
+
+        $config = array(
+            array(
+                'key' => 'k1',
+                'query' => 'category:1',
+                'exclude' => array('fq1','fq2')
+            ),
+            'k2' => array(
+                'query' => 'category:2'
+            ),
+        );
+        $this->_facet->addQueries($config);
+
+        $this->assertEquals(
+            $facetQueries,
+            $this->_facet->getQueries()
+        );
+    }
+
+    public function testGetInvalidQuery()
+    {
+        $this->assertEquals(
+            null,
+            $this->_facet->getQuery('invalidkey')
+        );
+    }
+
+    public function testRemoveQuery()
+    {
+        $facetQuery = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery->setKey('k1');
+        $facetQuery->setQuery('category:1');
+
+        $this->_facet->addQuery($facetQuery);
+        $this->assertEquals(
+            array('k1' => $facetQuery),
+            $this->_facet->getQueries()
+        );
+
+        $this->_facet->removeQuery('k1');
+        $this->assertEquals(
+            array(),
+            $this->_facet->getQueries()
+        );
+    }
+
+    public function testRemoveQueryWithObjectInput()
+    {
+        $facetQuery = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery->setKey('k1');
+        $facetQuery->setQuery('category:1');
+
+        $this->_facet->addQuery($facetQuery);
+        $this->assertEquals(
+            array('k1' => $facetQuery),
+            $this->_facet->getQueries()
+        );
+
+        $this->_facet->removeQuery($facetQuery);
+        $this->assertEquals(
+            array(),
+            $this->_facet->getQueries()
+        );
+    }
+
+    public function testRemoveInvalidQuery()
+    {
+        $facetQuery = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery->setKey('k1');
+        $facetQuery->setQuery('category:1');
+        $this->_facet->addQuery($facetQuery);
+
+        $before = $this->_facet->getQueries();
+        $this->_facet->removeQuery('invalidkey');
+        $after = $this->_facet->getQueries();
+
+        $this->assertEquals(
+            $before,
+            $after
+        );
+    }
+
+    public function testClearQueries()
+    {
+        $facetQuery1 = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery1->setKey('k1');
+        $facetQuery1->setQuery('category:1');
+
+        $facetQuery2 = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery2->setKey('k2');
+        $facetQuery2->setQuery('category:2');
+
+        $this->_facet->addQueries(array($facetQuery1, $facetQuery2));
+        $this->_facet->clearQueries();
+        $this->assertEquals(
+            array(),
+            $this->_facet->getQueries()
+        );
+    }
+
+    public function testSetQueries()
+    {
+        $facetQuery1 = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery1->setKey('k1');
+        $facetQuery1->setQuery('category:1');
+        $this->_facet->addQuery($facetQuery1);
+
+        $facetQuery2 = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery2->setKey('k2');
+        $facetQuery2->setQuery('category:2');
+
+        $facetQuery3 = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery3->setKey('k3');
+        $facetQuery3->setQuery('category:3');
+
+        $this->_facet->setQueries(array($facetQuery2, $facetQuery3));
+        $this->assertEquals(
+            array('k2' => $facetQuery2, 'k3' => $facetQuery3),
+            $this->_facet->getQueries()
+        );
+    }
+
+    public function testAddExcludeForwarding()
+    {
+        $facetQuery = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery->setKey('k1');
+        $facetQuery->setQuery('category:1');
+        $this->_facet->addQuery($facetQuery);
+
+        $this->_facet->addExclude('fq1');
+
+        $this->assertEquals(
+            array('fq1'),
+            $facetQuery->getExcludes()
+        );
+    }
+
+    public function testRemoveExcludeForwarding()
+    {
+        $this->_facet->addExclude('fq1');
+
+        $facetQuery = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery->setKey('k1');
+        $facetQuery->setQuery('category:1');
+        $this->_facet->addQuery($facetQuery);
+
+        $this->assertEquals(
+            array('fq1'),
+            $facetQuery->getExcludes()
+        );
+
+        $this->_facet->removeExclude('fq1');
+
+        $this->assertEquals(
+            array(),
+            $facetQuery->getExcludes()
+        );
+    }
+
+    public function testClearExcludesForwarding()
+    {
+        $this->_facet->addExclude('fq1');
+        $this->_facet->addExclude('fq2');
+
+        $facetQuery = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery->setKey('k1');
+        $facetQuery->setQuery('category:1');
+        $this->_facet->addQuery($facetQuery);
+
+        $this->assertEquals(
+            array('fq1','fq2'),
+            $facetQuery->getExcludes()
+        );
+
+        $this->_facet->clearExcludes();
+
+        $this->assertEquals(
+            array(),
+            $facetQuery->getExcludes()
+        );
+    }
+
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Facet/FieldTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Facet/FieldTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Facet/FieldTest.php	(revision 7576)
@@ -0,0 +1,127 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_Facet_FieldTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_Facet_Field
+     */
+    protected $_facet;
+
+    public function setUp()
+    {
+        $this->_facet = new Solarium_Query_Select_Component_Facet_Field;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'key' => 'myKey',
+            'exclude' => array('e1','e2'),
+            'field' => 'text',
+            'sort' => 'index',
+            'limit' => 10,
+            'offset' => 20,
+            'mincount' => 5,
+            'missing' => true,
+            'method' => 'enum',
+        );
+
+        $this->_facet->setOptions($options);
+        
+        $this->assertEquals($options['key'], $this->_facet->getKey());
+        $this->assertEquals($options['exclude'], $this->_facet->getExcludes());
+        $this->assertEquals($options['field'], $this->_facet->getField());
+        $this->assertEquals($options['sort'], $this->_facet->getSort());
+        $this->assertEquals($options['limit'], $this->_facet->getLimit());
+        $this->assertEquals($options['offset'], $this->_facet->getOffset());
+        $this->assertEquals($options['mincount'], $this->_facet->getMinCount());
+        $this->assertEquals($options['missing'], $this->_facet->getMissing());
+        $this->assertEquals($options['method'], $this->_facet->getMethod());
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(
+            Solarium_Query_Select_Component_FacetSet::FACET_FIELD,
+            $this->_facet->getType()
+        );
+    }
+
+    public function testSetAndGetField()
+    {
+        $this->_facet->setField('category');
+        $this->assertEquals('category', $this->_facet->getField());
+    }
+
+    public function testSetAndGetSort()
+    {
+        $this->_facet->setSort('index');
+        $this->assertEquals('index', $this->_facet->getSort());
+    }
+
+    public function testSetAndGetPrefix()
+    {
+        $this->_facet->setPrefix('xyz');
+        $this->assertEquals('xyz', $this->_facet->getPrefix());
+    }
+
+    public function testSetAndGetLimit()
+    {
+        $this->_facet->setLimit(12);
+        $this->assertEquals(12, $this->_facet->getLimit());
+    }
+
+    public function testSetAndGetOffset()
+    {
+        $this->_facet->setOffset(40);
+        $this->assertEquals(40, $this->_facet->getOffset());
+    }
+
+    public function testSetAndGetMinCount()
+    {
+        $this->_facet->setMincount(100);
+        $this->assertEquals(100, $this->_facet->getMincount());
+    }
+
+    public function testSetAndGetMissing()
+    {
+        $this->_facet->setMissing(true);
+        $this->assertEquals(true, $this->_facet->getMissing());
+    }
+
+    public function testSetAndGetMethod()
+    {
+        $this->_facet->setMethod('enum');
+        $this->assertEquals('enum', $this->_facet->getMethod());
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Facet/QueryTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Facet/QueryTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Facet/QueryTest.php	(revision 7576)
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_Facet_QueryTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_Facet_Query
+     */
+    protected $_facet;
+
+    public function setUp()
+    {
+        $this->_facet = new Solarium_Query_Select_Component_Facet_Query;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'key' => 'myKey',
+            'exclude' => array('e1','e2'),
+            'query' => 'category:1',
+        );
+
+        $this->_facet->setOptions($options);
+
+        $this->assertEquals($options['key'], $this->_facet->getKey());
+        $this->assertEquals($options['exclude'], $this->_facet->getExcludes());
+        $this->assertEquals($options['query'], $this->_facet->getQuery());
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(
+            Solarium_Query_Select_Component_FacetSet::FACET_QUERY,
+            $this->_facet->getType()
+        );
+    }
+
+    public function testSetAndGetQuery()
+    {
+        $this->_facet->setQuery('category:1');
+        $this->assertEquals('category:1', $this->_facet->getQuery());
+    }
+
+    public function testSetAndGetQueryWithBind()
+    {
+        $this->_facet->setQuery('id:%1%', array(678));
+        $this->assertEquals('id:678', $this->_facet->getQuery());
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/SpellcheckTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/SpellcheckTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/SpellcheckTest.php	(revision 7576)
@@ -0,0 +1,192 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_SpellcheckTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_Spellcheck
+     */
+    protected $_spellCheck;
+
+    public function setUp()
+    {
+        $this->_spellCheck = new Solarium_Query_Select_Component_Spellcheck;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Query_Select::COMPONENT_SPELLCHECK, $this->_spellCheck->getType());
+    }
+
+    public function testSetAndGetQuery()
+    {
+        $value = 'testquery';
+        $this->_spellCheck->setQuery($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getQuery()
+        );
+    }
+
+    public function testSetAndGetBuild()
+    {
+        $value = true;
+        $this->_spellCheck->setBuild($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getBuild()
+        );
+    }
+
+    public function testSetAndGetReload()
+    {
+        $value = false;
+        $this->_spellCheck->setReload($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getReload()
+        );
+    }
+
+    public function testSetAndGetDictionary()
+    {
+        $value = 'myDictionary';
+        $this->_spellCheck->setDictionary($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getDictionary()
+        );
+    }
+
+    public function testSetAndGetCount()
+    {
+        $value = 11;
+        $this->_spellCheck->setCount($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getCount()
+        );
+    }
+
+    public function testSetAndGetOnlyMorePopular()
+    {
+        $value = false;
+        $this->_spellCheck->setOnlyMorePopular($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getOnlyMorePopular()
+        );
+    }
+
+    public function testSetAndGetExtendedResults()
+    {
+        $value = false;
+        $this->_spellCheck->setExtendedResults($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getExtendedResults()
+        );
+    }
+
+    public function testSetAndGetCollate()
+    {
+        $value = false;
+        $this->_spellCheck->setCollate($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getCollate()
+        );
+    }
+
+    public function testSetAndGetMaxCollations()
+    {
+        $value = 23;
+        $this->_spellCheck->setMaxCollations($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getMaxCollations()
+        );
+    }
+
+    public function testSetAndGetMaxCollationTries()
+    {
+        $value = 10;
+        $this->_spellCheck->setMaxCollationTries($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getMaxCollationTries()
+        );
+    }
+
+    public function testSetAndGetMaxCollationEvaluations()
+    {
+        $value = 10;
+        $this->_spellCheck->setMaxCollationEvaluations($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getMaxCollationEvaluations()
+        );
+    }
+
+    public function testSetAndGetCollateExtendedResults()
+    {
+        $value = true;
+        $this->_spellCheck->setCollateExtendedResults($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getCollateExtendedResults()
+        );
+    }
+
+    public function testSetAndGetAccuracy()
+    {
+        $value = .1;
+        $this->_spellCheck->setAccuracy($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_spellCheck->getAccuracy()
+        );
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/FacetSetTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/FacetSetTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/FacetSetTest.php	(revision 7576)
@@ -0,0 +1,369 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_FacetSetTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_FacetSet
+     */
+    protected $_facetSet;
+
+    public function setUp()
+    {
+        $this->_facetSet = new Solarium_Query_Select_Component_FacetSet;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'facet' => array(
+                array('type' => 'query', 'key' => 'f1', 'query' => 'category:1'),
+                'f2' => array('type' => 'query', 'query' => 'category:2')
+            ),
+            'prefix' => 'pr',
+            'sort' => 'index',
+            'mincount' => 10,
+            'missing' => 5,
+        );
+
+        $this->_facetSet->setOptions($options);
+        $facets = $this->_facetSet->getFacets();
+
+        $this->assertEquals(2, count($facets));
+        $this->assertEquals($options['prefix'], $this->_facetSet->getPrefix());
+        $this->assertEquals($options['sort'], $this->_facetSet->getSort());
+        $this->assertEquals($options['mincount'], $this->_facetSet->getMincount());
+        $this->assertEquals($options['missing'], $this->_facetSet->getMissing());
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Query_Select::COMPONENT_FACETSET, $this->_facetSet->getType());
+    }
+
+    public function testSetAndGetSort()
+    {
+        $this->_facetSet->setSort('index');
+        $this->assertEquals('index', $this->_facetSet->getSort());
+    }
+
+    public function testSetAndGetPrefix()
+    {
+        $this->_facetSet->setPrefix('xyz');
+        $this->assertEquals('xyz', $this->_facetSet->getPrefix());
+    }
+
+    public function testSetAndGetLimit()
+    {
+        $this->_facetSet->setLimit(12);
+        $this->assertEquals(12, $this->_facetSet->getLimit());
+    }
+
+    public function testSetAndGetMinCount()
+    {
+        $this->_facetSet->setMincount(100);
+        $this->assertEquals(100, $this->_facetSet->getMincount());
+    }
+
+    public function testSetAndGetMissing()
+    {
+        $this->_facetSet->setMissing(true);
+        $this->assertEquals(true, $this->_facetSet->getMissing());
+    }
+
+    public function testAddAndGetFacet()
+    {
+        $fq = new Solarium_Query_Select_Component_Facet_Query;
+        $fq->setKey('f1')->setQuery('category:1');
+        $this->_facetSet->addFacet($fq);
+
+        $this->assertEquals(
+            $fq,
+            $this->_facetSet->getFacet('f1')
+        );
+    }
+
+    public function testAddFacetWithoutKey()
+    {
+        $fq = new Solarium_Query_Select_Component_Facet_Query;
+        $fq->setQuery('category:1');
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_facetSet->addFacet($fq);
+    }
+
+    public function testAddFacetWithUsedKey()
+    {
+        $fq1 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq1->setKey('f1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq2->setKey('f1')->setQuery('category:2');
+
+        $this->_facetSet->addFacet($fq1);
+        $this->setExpectedException('Solarium_Exception');
+        $this->_facetSet->addFacet($fq2);
+    }
+
+    public function testGetInvalidFacet()
+    {
+        $this->assertEquals(
+            null,
+            $this->_facetSet->getFacet('invalidtag')
+        );
+    }
+
+    public function testAddFacets()
+    {
+        $fq1 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq1->setKey('f1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq2->setKey('f2')->setQuery('category:2');
+
+        $facets = array('f1' => $fq1, 'f2' => $fq2);
+
+        $this->_facetSet->addFacets($facets);
+        $this->assertEquals(
+            $facets,
+            $this->_facetSet->getFacets()
+        );
+    }
+
+    public function testAddFacetsWithConfig()
+    {
+        $facets = array(
+            array('type' => 'query', 'key' => 'f1', 'query' => 'category:1'),
+            'f2' => array('type' => 'query', 'query' => 'category:2')
+        );
+
+        $this->_facetSet->addFacets($facets);
+
+        $this->assertEquals(
+            2,
+            count($this->_facetSet->getFacets())
+        );
+    }
+
+    public function testRemoveFacet()
+    {
+        $fq1 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq1->setKey('f1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq2->setKey('f2')->setQuery('category:2');
+
+        $facets = array('f1' => $fq1, 'f2' => $fq2);
+
+        $this->_facetSet->addFacets($facets);
+        $this->_facetSet->removeFacet('f1');
+        $this->assertEquals(
+            array('f2' => $fq2),
+            $this->_facetSet->getFacets()
+        );
+    }
+
+    public function testRemoveFacetWithObjectInput()
+    {
+        $fq1 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq1->setKey('f1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq2->setKey('f2')->setQuery('category:2');
+
+        $facets = array('f1' => $fq1, 'f2' => $fq2);
+
+        $this->_facetSet->addFacets($facets);
+        $this->_facetSet->removeFacet($fq1);
+        $this->assertEquals(
+            array('f2' => $fq2),
+            $this->_facetSet->getFacets()
+        );
+    }
+
+    public function testRemoveInvalidFacet()
+    {
+        $fq1 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq1->setKey('f1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq2->setKey('f2')->setQuery('category:2');
+
+        $facets = array('f1' => $fq1, 'f2' => $fq2);
+
+        $this->_facetSet->addFacets($facets);
+        $this->_facetSet->removeFacet('f3'); //continue silently
+        $this->assertEquals(
+            $facets,
+            $this->_facetSet->getFacets()
+        );
+    }
+
+    public function testClearFacets()
+    {
+        $fq1 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq1->setKey('f1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq2->setKey('f2')->setQuery('category:2');
+
+        $facets = array('f1' => $fq1, 'f2' => $fq2);
+
+        $this->_facetSet->addFacets($facets);
+        $this->_facetSet->clearFacets();
+        $this->assertEquals(
+            array(),
+            $this->_facetSet->getFacets()
+        );
+    }
+
+    public function testSetFacets()
+    {
+        $fq1 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq1->setKey('f1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq2->setKey('f2')->setQuery('category:2');
+
+        $facets = array('f1' => $fq1, 'f2' => $fq2);
+
+        $this->_facetSet->addFacets($facets);
+
+        $fq3 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq3->setKey('f3')->setQuery('category:3');
+
+        $fq4 = new Solarium_Query_Select_Component_Facet_Query;
+        $fq4->setKey('f4')->setQuery('category:4');
+
+        $facets = array('f3' => $fq3, 'f4' => $fq4);
+
+        $this->_facetSet->setFacets($facets);
+
+        $this->assertEquals(
+            $facets,
+            $this->_facetSet->getFacets()
+        );
+    }
+
+    public function testCreateFacet()
+    {
+        $type = Solarium_Query_Select_Component_FacetSet::FACET_FIELD;
+        $options = array('optionA' => 1, 'optionB' => 2);
+        $facet = $this->_facetSet->createFacet($type, $options);
+
+        // check class mapping
+        $this->assertEquals(
+            $type,
+            $facet->getType()
+        );
+
+        // check option forwarding
+        $facetOptions = $facet->getOptions();
+        $this->assertEquals(
+            $options['optionB'],
+            $facetOptions['optionB']
+        );
+    }
+
+    public function testCreateFacetAdd()
+    {
+        $type = Solarium_Query_Select_Component_FacetSet::FACET_FIELD;
+        $options = array('key' => 'mykey','optionA' => 1, 'optionB' => 2);
+        $facet = $this->_facetSet->createFacet($type, $options);
+
+        $this->assertEquals($facet, $this->_facetSet->getFacet('mykey'));
+    }
+
+    public function testCreateFacetAddWithString()
+    {
+        $type = Solarium_Query_Select_Component_FacetSet::FACET_FIELD;
+        $options = 'mykey';
+        $facet = $this->_facetSet->createFacet($type, $options);
+
+        $this->assertEquals($facet, $this->_facetSet->getFacet('mykey'));
+    }
+
+    public function testCreateFacetWithInvalidType()
+    {
+        $this->setExpectedException('Solarium_Exception');
+        $this->_facetSet->createFacet('invalidtype');
+    }
+
+    public function testCreateFacetField()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Query_Select_Component_FacetSet', array('createFacet'));
+        $observer->expects($this->once())
+                 ->method('createFacet')
+                 ->with($this->equalTo(Solarium_Query_Select_Component_FacetSet::FACET_FIELD), $this->equalTo($options));
+
+        $observer->createFacetField($options);
+    }
+
+    public function testCreateFacetQuery()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Query_Select_Component_FacetSet', array('createFacet'));
+        $observer->expects($this->once())
+                 ->method('createFacet')
+                 ->with($this->equalTo(Solarium_Query_Select_Component_FacetSet::FACET_QUERY), $this->equalTo($options));
+
+        $observer->createFacetQuery($options);
+    }
+
+    public function testCreateFacetMultiQuery()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Query_Select_Component_FacetSet', array('createFacet'));
+        $observer->expects($this->once())
+                 ->method('createFacet')
+                 ->with($this->equalTo(Solarium_Query_Select_Component_FacetSet::FACET_MULTIQUERY), $this->equalTo($options));
+
+        $observer->createFacetMultiQuery($options);
+    }
+
+    public function testCreateFacetRange()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+
+        $observer = $this->getMock('Solarium_Query_Select_Component_FacetSet', array('createFacet'));
+        $observer->expects($this->once())
+                 ->method('createFacet')
+                 ->with($this->equalTo(Solarium_Query_Select_Component_FacetSet::FACET_RANGE), $this->equalTo($options));
+
+        $observer->createFacetRange($options);
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/StatsTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/StatsTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/StatsTest.php	(revision 7576)
@@ -0,0 +1,340 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_StatsTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_Stats
+     */
+    protected $_stats;
+
+    public function setUp()
+    {
+        $this->_stats = new Solarium_Query_Select_Component_Stats;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Query_Select::COMPONENT_STATS, $this->_stats->getType());
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'facet' => 'field1, field2',
+            'field' => array(
+                'f1' => array(),
+                'f2' => array(),
+            )
+        );
+
+        $this->_stats->setOptions($options);
+
+        $this->assertEquals(array('field1','field2'), $this->_stats->getFacets());
+        $this->assertEquals(array('f1','f2'), array_keys($this->_stats->getFields()));
+    }
+
+    public function testCreateFieldWithKey()
+    {
+        $field = $this->_stats->createField('mykey');
+
+        // check class
+        $this->assertThat($field, $this->isInstanceOf('Solarium_Query_Select_Component_Stats_Field'));
+
+        $this->assertEquals(
+            'mykey',
+            $field->getKey()
+        );
+    }
+
+    public function testCreateFieldWithOptions()
+    {
+        $options = array('key' => 'testkey');
+        $field = $this->_stats->createField($options);
+
+        // check class
+       $this->assertThat($field, $this->isInstanceOf('Solarium_Query_Select_Component_Stats_Field'));
+
+        // check option forwarding
+        $fieldOptions = $field->getOptions();
+        $this->assertEquals(
+            $options['key'],
+            $field->getKey()
+        );
+    }
+
+    public function testAddAndGetField()
+    {
+        $field = new Solarium_Query_Select_Component_Stats_Field;
+        $field->setKey('f1');
+        $this->_stats->addField($field);
+
+        $this->assertEquals(
+            $field,
+            $this->_stats->getField('f1')
+        );
+    }
+
+    public function testAddFieldWithOptions()
+    {
+        $this->_stats->addField(array('key' => 'f1'));
+
+        $this->assertEquals(
+            'f1',
+            $this->_stats->getField('f1')->getKey()
+        );
+    }
+
+    public function testAddAndGetFieldWithKey()
+    {
+        $key = 'f1';
+
+        $fld = $this->_stats->createField($key, true);
+
+        $this->assertEquals(
+            $key,
+            $fld->getKey()
+        );
+
+        $this->assertEquals(
+            $fld,
+            $this->_stats->getField('f1')
+        );
+    }
+
+    public function testAddFieldWithoutKey()
+    {
+        $fld = new Solarium_Query_Select_Component_Stats_Field;
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_stats->addField($fld);
+    }
+
+    public function testAddFieldWithUsedKey()
+    {
+        $f1 = new Solarium_Query_Select_Component_Stats_Field;
+        $f1->setKey('f1');
+
+        $f2 = new Solarium_Query_Select_Component_Stats_Field;
+        $f2->setKey('f1');
+
+        $this->_stats->addField($f1);
+        $this->setExpectedException('Solarium_Exception');
+        $this->_stats->addField($f2);
+    }
+
+    public function testGetInvalidField()
+    {
+        $this->assertEquals(
+            null,
+            $this->_stats->getField('invalidkey')
+        );
+    }
+
+    public function testAddFields()
+    {
+        $f1 = new Solarium_Query_Select_Component_Stats_Field;
+        $f1->setKey('f1');
+
+        $f2 = new Solarium_Query_Select_Component_Stats_Field;
+        $f2->setKey('f2');
+
+        $fields = array('f1' => $f1, 'f2' => $f2);
+
+        $this->_stats->addFields($fields);
+        $this->assertEquals(
+            $fields,
+            $this->_stats->getFields()
+        );
+    }
+
+    public function testAddFieldsWithOptions()
+    {
+        $fields = array(
+            'f1' => array(''),
+            array('key' => 'f2')
+        );
+
+        $this->_stats->addFields($fields);
+        $fields = $this->_stats->getFields();
+
+        $this->assertEquals( array('f1', 'f2'), array_keys($fields));
+    }
+
+    public function testRemoveField()
+    {
+        $f1 = new Solarium_Query_Select_Component_Stats_Field;
+        $f1->setKey('f1');
+
+        $f2 = new Solarium_Query_Select_Component_Stats_Field;
+        $f2->setKey('f2');
+
+        $fields = array('f1' => $f1, 'f2' => $f2);
+
+        $this->_stats->addFields($fields);
+        $this->_stats->removeField('f1');
+        $this->assertEquals(
+            array('f2' => $f2),
+            $this->_stats->getFields()
+        );
+    }
+
+    public function testRemoveFieldWithObjectInput()
+    {
+        $f1 = new Solarium_Query_Select_Component_Stats_Field;
+        $f1->setKey('f1');
+
+        $f2 = new Solarium_Query_Select_Component_Stats_Field;
+        $f2->setKey('f2');
+
+        $fields = array($f1, $f2);
+
+        $this->_stats->addFields($fields);
+        $this->_stats->removeField($f1);
+        $this->assertEquals(
+            array('f2' => $f2),
+            $this->_stats->getFields()
+        );
+    }
+
+    public function testRemoveInvalidField()
+    {
+        $f1 = new Solarium_Query_Select_Component_Stats_Field;
+        $f1->setKey('f1');
+
+        $f2 = new Solarium_Query_Select_Component_Stats_Field;
+        $f2->setKey('f2');
+
+        $fields = array('f1' => $f1, 'f2' => $f2);
+
+        $this->_stats->addFields($fields);
+        $this->_stats->removeField('f3'); //continue silently
+        $this->assertEquals(
+            $fields,
+            $this->_stats->getFields()
+        );
+    }
+
+    public function testClearFields()
+    {
+        $f1 = new Solarium_Query_Select_Component_Stats_Field;
+        $f1->setKey('f1');
+
+        $f2 = new Solarium_Query_Select_Component_Stats_Field;
+        $f2->setKey('f2');
+
+        $fields = array($f1, $f2);
+
+        $this->_stats->addFields($fields);
+        $this->_stats->clearFields();
+        $this->assertEquals(
+            array(),
+            $this->_stats->getFields()
+        );
+    }
+
+    public function testSetFields()
+    {
+        $f1 = new Solarium_Query_Select_Component_Stats_Field;
+        $f1->setKey('f1');
+
+        $f2 = new Solarium_Query_Select_Component_Stats_Field;
+        $f2->setKey('f2');
+
+        $fields = array($f1, $f2);
+
+        $this->_stats->addFields($fields);
+
+        $f3 = new Solarium_Query_Select_Component_Stats_Field;
+        $f3->setKey('f3');
+
+        $f4 = new Solarium_Query_Select_Component_Stats_Field;
+        $f4->setKey('f4');
+
+        $fields2 = array('f3' => $f3, 'f4' => $f4);
+
+        $this->_stats->setFields($fields2);
+
+        $this->assertEquals(
+            $fields2,
+            $this->_stats->getFields()
+        );
+    }
+
+    public function testAddFacet()
+    {
+        $expectedFacets = $this->_stats->getFacets();
+        $expectedFacets[] = 'newfacet';
+        $this->_stats->addFacet('newfacet');
+        $this->assertEquals($expectedFacets, $this->_stats->getFacets());
+    }
+
+    public function testClearFacets()
+    {
+        $this->_stats->addFacet('newfacet');
+        $this->_stats->clearFacets();
+        $this->assertEquals(array(), $this->_stats->getFacets());
+    }
+
+    public function testAddFacets()
+    {
+        $facets = array('facet1','facet2');
+
+        $this->_stats->clearFacets();
+        $this->_stats->addFacets($facets);
+        $this->assertEquals($facets, $this->_stats->getFacets());
+    }
+
+    public function testAddFacetsAsStringWithTrim()
+    {
+        $this->_stats->clearFacets();
+        $this->_stats->addFacets('facet1, facet2');
+        $this->assertEquals(array('facet1','facet2'), $this->_stats->getFacets());
+    }
+
+    public function testRemoveFacet()
+    {
+        $this->_stats->clearFacets();
+        $this->_stats->addFacets(array('facet1','facet2'));
+        $this->_stats->removeFacet('facet1');
+        $this->assertEquals(array('facet2'), $this->_stats->getFacets());
+    }
+
+    public function testSetFacets()
+    {
+        $this->_stats->clearFacets();
+        $this->_stats->addFacets(array('facet1','facet2'));
+        $this->_stats->setFacets(array('facet3','facet4'));
+        $this->assertEquals(array('facet3','facet4'), $this->_stats->getFacets());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Highlighting/FieldTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Highlighting/FieldTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Highlighting/FieldTest.php	(revision 7576)
@@ -0,0 +1,181 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_FieldTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_Highlighting_Field
+     */
+    protected $_fld;
+
+    public function setUp()
+    {
+        $this->_fld = new Solarium_Query_Select_Component_Highlighting_Field;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'snippets' => 3,
+            'fragsize' => 25,
+            'mergecontiguous' => true,
+            'alternatefield' => 'text',
+            'formatter' => 'myFormatter',
+            'simpleprefix' => '<b>',
+            'simplepostfix' => '</b>',
+            'fragmenter' => 'myFragmenter',
+            'usefastvectorhighlighter' => true,
+        );
+
+        $this->_fld->setOptions($options);
+
+        $this->assertEquals(3, $this->_fld->getSnippets());
+        $this->assertEquals(25, $this->_fld->getFragSize());
+        $this->assertEquals(true, $this->_fld->getMergeContiguous());
+        $this->assertEquals('text', $this->_fld->getAlternateField());
+        $this->assertEquals('myFormatter', $this->_fld->getFormatter());
+        $this->assertEquals('<b>', $this->_fld->getSimplePrefix());
+        $this->assertEquals('</b>', $this->_fld->getSimplePostfix());
+        $this->assertEquals('myFragmenter', $this->_fld->getFragmenter());
+        $this->assertEquals(true, $this->_fld->getUseFastVectorHighlighter());
+    }
+
+    public function testSetAndGetName()
+    {
+        $value = 'testname';
+        $this->_fld->setName($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_fld->getName()
+        );
+    }
+
+    public function testSetAndGetSnippets()
+    {
+        $value = 2;
+        $this->_fld->setSnippets($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_fld->getSnippets()
+        );
+    }
+
+    public function testSetAndGetFragSize()
+    {
+        $value = 20;
+        $this->_fld->setFragsize($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_fld->getFragSize()
+        );
+    }
+
+    public function testSetAndGetMergeContiguous()
+    {
+        $value = true;
+        $this->_fld->setMergeContiguous($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_fld->getMergeContiguous()
+        );
+    }
+
+    public function testSetAndGetAlternateField()
+    {
+        $value = 'description';
+        $this->_fld->setAlternateField($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_fld->getAlternateField()
+        );
+    }
+
+    public function testSetAndGetFormatter()
+    {
+        $this->_fld->setFormatter();
+
+        $this->assertEquals(
+            'simple',
+            $this->_fld->getFormatter()
+        );
+    }
+
+    public function testSetAndGetSimplePrefix()
+    {
+        $value = '<em>';
+        $this->_fld->setSimplePrefix($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_fld->getSimplePrefix()
+        );
+    }
+
+    public function testSetAndGetSimplePostfix()
+    {
+        $value = '</em>';
+        $this->_fld->setSimplePostfix($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_fld->getSimplePostfix()
+        );
+    }
+
+    public function testSetAndGetFragmenter()
+    {
+        $value = Solarium_Query_Select_Component_Highlighting::FRAGMENTER_REGEX;
+        $this->_fld->setFragmenter($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_fld->getFragmenter()
+        );
+    }
+
+    public function testSetAndGetUseFastVectorHighlighter()
+    {
+        $value = true;
+        $this->_fld->setUseFastVectorHighlighter($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_fld->getUseFastVectorHighlighter()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/MoreLikeThisTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/MoreLikeThisTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/MoreLikeThisTest.php	(revision 7576)
@@ -0,0 +1,188 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_MoreLikeThisTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_MoreLikeThis
+     */
+    protected $_mlt;
+
+    public function setUp()
+    {
+        $this->_mlt = new Solarium_Query_Select_Component_MoreLikeThis;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'fields' => 'fieldA,fieldB',
+            'minimumtermfrequency' => 10,
+            'minimumdocumentfrequency' => 2,
+            'minimumwordlength' => 3,
+            'maximumwordlength' => 10,
+            'maximumqueryterms' => 4,
+            'maximumnumberoftokens' => 20,
+            'boost' => 1.5,
+            'queryfields' => 'fieldC,fieldD',
+            'count' => 5,
+        );
+
+        $this->_mlt->setOptions($options);
+
+        $this->assertEquals($options['fields'], $this->_mlt->getFields());
+        $this->assertEquals($options['minimumtermfrequency'], $this->_mlt->getMinimumTermFrequency());
+        $this->assertEquals($options['minimumdocumentfrequency'], $this->_mlt->getMinimumDocumentFrequency());
+        $this->assertEquals($options['minimumwordlength'], $this->_mlt->getMinimumWordLength());
+        $this->assertEquals($options['maximumwordlength'], $this->_mlt->getMaximumWordLength());
+        $this->assertEquals($options['maximumqueryterms'], $this->_mlt->getMaximumQueryTerms());
+        $this->assertEquals($options['boost'], $this->_mlt->getBoost());
+        $this->assertEquals($options['queryfields'], $this->_mlt->getQueryFields());
+        $this->assertEquals($options['count'], $this->_mlt->getCount());
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Query_Select::COMPONENT_MORELIKETHIS, $this->_mlt->getType());
+    }
+
+    public function testSetAndGetFields()
+    {
+        $value = 'name,description';
+        $this->_mlt->setFields($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_mlt->getFields()
+        );
+    }
+
+    public function testSetAndGetMinimumTermFrequency()
+    {
+        $value = 2;
+        $this->_mlt->setMinimumTermFrequency($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_mlt->getMinimumTermFrequency()
+        );
+    }
+
+    public function testMinimumDocumentFrequency()
+    {
+        $value = 4;
+        $this->_mlt->setMinimumDocumentFrequency($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_mlt->getMinimumDocumentFrequency()
+        );
+    }
+
+    public function testSetAndGetMinimumWordLength()
+    {
+        $value = 3;
+        $this->_mlt->setMinimumWordLength($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_mlt->getMinimumWordLength()
+        );
+    }
+
+    public function testSetAndGetMaximumWordLength()
+    {
+        $value = 15;
+        $this->_mlt->setMaximumWordLength($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_mlt->getMaximumWordLength()
+        );
+    }
+
+    public function testSetAndGetMaximumQueryTerms()
+    {
+        $value = 5;
+        $this->_mlt->setMaximumQueryTerms($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_mlt->getMaximumQueryTerms()
+        );
+    }
+
+    public function testSetAndGetMaximumNumberOfTokens()
+    {
+        $value = 5;
+        $this->_mlt->setMaximumNumberOfTokens($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_mlt->getMaximumNumberOfTokens()
+        );
+    }
+
+    public function testSetAndGetBoost()
+    {
+        $value = true;
+        $this->_mlt->setBoost($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_mlt->getBoost()
+        );
+    }
+
+    public function testSetAndGetQueryFields()
+    {
+        $value = 'content,name';
+        $this->_mlt->setQueryFields($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_mlt->getQueryFields()
+        );
+    }
+
+    public function testSetAndGetCount()
+    {
+        $value = 8;
+        $this->_mlt->setCount($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_mlt->getCount()
+        );
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/FacetTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/FacetTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/FacetTest.php	(revision 7576)
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_FacetTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_Facet
+     */
+    protected $_facet;
+
+    public function setUp()
+    {
+        $this->_facet = new TestFacet;
+    }
+
+    public function testConfigMode()
+    {
+        $this->_facet->setOptions(array('key' => 'myKey','exclude' => array('e1','e2')));
+        $this->assertEquals('myKey', $this->_facet->getKey());
+        $this->assertEquals(array('e1','e2'), $this->_facet->getExcludes());
+    }
+
+    public function testConfigModeWithSingleValueExclude()
+    {
+        $this->_facet->setOptions(array('exclude' => 'e1'));
+        $this->assertEquals(array('e1'), $this->_facet->getExcludes());
+    }
+
+    public function testSetAndGetKey()
+    {
+        $this->_facet->setKey('testkey');
+        $this->assertEquals('testkey', $this->_facet->getKey());
+    }
+
+    public function testAddExclude()
+    {
+        $this->_facet->addExclude('e1');
+        $this->assertEquals(array('e1'), $this->_facet->getExcludes());
+    }
+
+    public function testAddExcludes()
+    {
+        $this->_facet->addExcludes(array('e1','e2'));
+        $this->assertEquals(array('e1','e2'), $this->_facet->getExcludes());
+    }
+
+    public function testRemoveExclude()
+    {
+        $this->_facet->addExcludes(array('e1','e2'));
+        $this->_facet->removeExclude('e1');
+        $this->assertEquals(array('e2'), $this->_facet->getExcludes());
+    }
+
+    public function testClearExcludes()
+    {
+        $this->_facet->addExcludes(array('e1','e2'));
+        $this->_facet->clearExcludes();
+        $this->assertEquals(array(), $this->_facet->getExcludes());
+    }
+
+    public function testSetExcludes()
+    {
+        $this->_facet->addExcludes(array('e1','e2'));
+        $this->_facet->setExcludes(array('e3','e4'));
+        $this->assertEquals(array('e3','e4'), $this->_facet->getExcludes());
+    }
+}
+
+class TestFacet extends Solarium_Query_Select_Component_Facet{
+
+    public function getType()
+    {
+        return 'test';
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/DisMaxTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/DisMaxTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/DisMaxTest.php	(revision 7576)
@@ -0,0 +1,192 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_DisMaxTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_DisMax
+     */
+    protected $_disMax;
+
+    public function setUp()
+    {
+        $this->_disMax = new Solarium_Query_Select_Component_DisMax;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'queryparser' => 'edismax',
+            'queryalternative' => '*:*',
+            'queryfields' => 'title^2.0 description',
+            'minimummatch' => '2.0',
+            'phrasefields' => 'title^2.0 description^3.5',
+            'phraseslop' => 2,
+            'queryphraseslop' => 4,
+            'tie' => 2.1,
+            'boostquery' => 'cat:1^3',
+            'boostfunctions' => 'funcA(arg1,arg2)^1.2 funcB(arg3,arg4)^2.2',
+        );
+
+        $this->_disMax->setOptions($options);
+
+        $this->assertEquals($options['queryparser'], $this->_disMax->getQueryParser());
+        $this->assertEquals($options['queryalternative'], $this->_disMax->getQueryAlternative());
+        $this->assertEquals($options['queryfields'], $this->_disMax->getQueryFields());
+        $this->assertEquals($options['minimummatch'], $this->_disMax->getMinimumMatch());
+        $this->assertEquals($options['phrasefields'], $this->_disMax->getPhraseFields());
+        $this->assertEquals($options['phraseslop'], $this->_disMax->getPhraseSlop());
+        $this->assertEquals($options['queryphraseslop'], $this->_disMax->getQueryPhraseSlop());
+        $this->assertEquals($options['tie'], $this->_disMax->getTie());
+        $this->assertEquals($options['boostquery'], $this->_disMax->getBoostQuery());
+        $this->assertEquals($options['boostfunctions'], $this->_disMax->getBoostFunctions());
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(
+            Solarium_Query_Select::COMPONENT_DISMAX,
+            $this->_disMax->getType()
+        );
+    }
+
+    public function testSetAndGetQueryParser()
+    {
+        $value = 'dummyparser';
+        $this->_disMax->setQueryParser($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_disMax->getQueryParser()
+        );
+    }
+
+    public function testSetAndGetQueryAlternative()
+    {
+        $value = '*:*';
+        $this->_disMax->setQueryAlternative($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_disMax->getQueryAlternative()
+        );
+    }
+
+    public function testSetAndGetQueryFields()
+    {
+        $value = 'title^2.0 description';
+        $this->_disMax->setQueryFields($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_disMax->getQueryFields()
+        );
+    }
+
+    public function testSetAndGetMinimumMatch()
+    {
+        $value = '2.0';
+        $this->_disMax->setMinimumMatch($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_disMax->getMinimumMatch()
+        );
+    }
+
+    public function testSetAndGetPhraseFields()
+    {
+        $value = 'title^2.0 description^3.5';
+        $this->_disMax->setPhraseFields($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_disMax->getPhraseFields()
+        );
+    }
+
+    public function testSetAndGetPhraseSlop()
+    {
+        $value = '2';
+        $this->_disMax->setPhraseSlop($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_disMax->getPhraseSlop()
+        );
+    }
+
+    public function testSetAndGetQueryPhraseSlop()
+    {
+        $value = '3';
+        $this->_disMax->setQueryPhraseSlop($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_disMax->getQueryPhraseSlop()
+        );
+    }
+
+    public function testSetAndGetTie()
+    {
+        $value = 2.1;
+        $this->_disMax->setTie($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_disMax->getTie()
+        );
+    }
+
+    public function testSetAndGetBoostQuery()
+    {
+        $value = 'cat:1^3';
+        $this->_disMax->setBoostQuery($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_disMax->getBoostQuery()
+        );
+    }
+
+    public function testSetAndGetBoostFunctions()
+    {
+        $value = 'funcA(arg1,arg2)^1.2 funcB(arg3,arg4)^2.2';
+        $this->_disMax->setBoostFunctions($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_disMax->getBoostFunctions()
+        );
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/HighlightingTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/HighlightingTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/HighlightingTest.php	(revision 7576)
@@ -0,0 +1,476 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_HighlightingTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_Highlighting
+     */
+    protected $_hlt;
+
+    public function setUp()
+    {
+        $this->_hlt = new Solarium_Query_Select_Component_Highlighting;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'field' => array(
+                'fieldA' => array(
+                    'snippets' => 3,
+                    'fragsize' => 25,
+                ),
+                'fieldB'
+            ),
+            'snippets' => 2,
+            'fragsize' => 20,
+            'mergecontiguous' => true,
+            'requirefieldmatch' => false,
+            'maxanalyzedchars' => 40,
+            'alternatefield' => 'text',
+            'maxalternatefieldlength' => 50,
+            'formatter' => 'myFormatter',
+            'simpleprefix' => '<b>',
+            'simplepostfix' => '</b>',
+            'fragmenter' => 'myFragmenter',
+            'fraglistbuilder' => 'regex',
+            'fragmentsbuilder' => 'myBuilder',
+            'usefastvectorhighlighter' => true,
+            'usephrasehighlighter' => false,
+            'highlightmultiterm' => true,
+            'regexslop' => .8,
+            'regexpattern' => 'myPattern',
+            'regexmaxanalyzedchars' => 500,
+            'query' => 'text:myvalue',
+            'phraselimit' => 35,
+
+        );
+
+        $this->_hlt->setOptions($options);
+
+        $this->assertEquals(array('fieldA','fieldB'), array_keys($this->_hlt->getFields()));
+        $this->assertEquals($options['field']['fieldA']['snippets'], $this->_hlt->getField('fieldA')->getSnippets());
+        $this->assertEquals($options['field']['fieldA']['fragsize'], $this->_hlt->getField('fieldA')->getFragSize());
+        $this->assertEquals(null, $this->_hlt->getField('FieldB')->getSnippets());
+        $this->assertEquals($options['snippets'], $this->_hlt->getSnippets());
+        $this->assertEquals($options['fragsize'], $this->_hlt->getFragSize());
+        $this->assertEquals($options['mergecontiguous'], $this->_hlt->getMergeContiguous());
+        $this->assertEquals($options['maxanalyzedchars'], $this->_hlt->getMaxAnalyzedChars());
+        $this->assertEquals($options['alternatefield'], $this->_hlt->getAlternateField());
+        $this->assertEquals($options['maxalternatefieldlength'], $this->_hlt->getMaxAlternateFieldLength());
+        $this->assertEquals($options['formatter'], $this->_hlt->getFormatter());
+        $this->assertEquals($options['simpleprefix'], $this->_hlt->getSimplePrefix());
+        $this->assertEquals($options['simplepostfix'], $this->_hlt->getSimplePostfix());
+        $this->assertEquals($options['fragmenter'], $this->_hlt->getFragmenter());
+        $this->assertEquals($options['fraglistbuilder'], $this->_hlt->getFragListBuilder());
+        $this->assertEquals($options['fragmentsbuilder'], $this->_hlt->getFragmentsBuilder());
+        $this->assertEquals($options['usefastvectorhighlighter'], $this->_hlt->getUseFastVectorHighlighter());
+        $this->assertEquals($options['usephrasehighlighter'], $this->_hlt->getUsePhraseHighlighter());
+        $this->assertEquals($options['highlightmultiterm'], $this->_hlt->getHighlightMultiTerm());
+        $this->assertEquals($options['regexslop'], $this->_hlt->getRegexSlop());
+        $this->assertEquals($options['regexpattern'], $this->_hlt->getRegexPattern());
+        $this->assertEquals($options['regexmaxanalyzedchars'], $this->_hlt->getRegexMaxAnalyzedChars());
+        $this->assertEquals($options['query'], $this->_hlt->getQuery());
+        $this->assertEquals($options['phraselimit'], $this->_hlt->getPhraseLimit());
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Query_Select::COMPONENT_HIGHLIGHTING, $this->_hlt->getType());
+    }
+
+    public function testGetFieldAutocreate()
+    {
+        $name = 'test';
+        $field = $this->_hlt->getField($name);
+
+        $this->assertEquals($name, $field->getName());
+    }
+
+    public function testGetFieldNoAutocreate()
+    {
+        $name = 'test';
+        $field = $this->_hlt->getField($name, false);
+
+        $this->assertEquals(null, $field);
+    }
+
+    public function testAddFieldWithObject()
+    {
+        $field = new Solarium_Query_Select_Component_Highlighting_Field;
+        $field->setName('test');
+
+        $this->_hlt->addField($field);
+
+        $this->assertEquals($field, $this->_hlt->getField('test'));
+    }
+
+    public function testAddFieldWithString()
+    {
+        $name = 'test';
+        $this->_hlt->addField($name);
+
+        $this->assertEquals(array($name), array_keys($this->_hlt->getFields()));
+    }
+
+    public function testAddFieldWithArray()
+    {
+        $config = array(
+            'name' => 'fieldA',
+            'snippets' => 6
+        );
+        $this->_hlt->addField($config);
+
+        $this->assertEquals(6, $this->_hlt->getField('fieldA')->getSnippets());
+    }
+
+    public function testAddFieldWithObjectWithoutName()
+    {
+        $field = new Solarium_Query_Select_Component_Highlighting_Field;
+        $this->setExpectedException('Solarium_Exception');
+        $this->_hlt->addField($field);
+    }
+
+    public function testAddsFieldsWithString()
+    {
+        $fields = 'test1,test2';
+        $this->_hlt->addFields($fields);
+
+        $this->assertEquals(array('test1','test2'), array_keys($this->_hlt->getFields()));
+    }
+
+    public function testAddsFieldsWithArray()
+    {
+        $fields = array(
+            'test1' => array('snippets' => 2),
+            'test2' => array('snippets' => 5),
+        );
+        $this->_hlt->addFields($fields);
+
+        $this->assertEquals(2, $this->_hlt->getField('test1')->getSnippets());
+        $this->assertEquals(5, $this->_hlt->getField('test2')->getSnippets());
+    }
+
+    public function testRemoveField()
+    {
+        $fields = array(
+            'test1' => array('snippets' => 2),
+            'test2' => array('snippets' => 5),
+        );
+
+        $this->_hlt->addFields($fields);
+        $this->assertEquals(array('test1','test2'), array_keys($this->_hlt->getFields()));
+
+        $this->_hlt->removeField('test1');
+        $this->assertEquals(array('test2'), array_keys($this->_hlt->getFields()));
+    }
+
+    public function testRemoveFieldWithInvalidName()
+    {
+        $fields = array(
+            'test1' => array('snippets' => 2),
+            'test2' => array('snippets' => 5),
+        );
+
+        $this->_hlt->addFields($fields);
+        $this->assertEquals(array('test1','test2'), array_keys($this->_hlt->getFields()));
+
+        $this->_hlt->removeField('test1=3'); // should fail silently and do nothing
+        $this->assertEquals(array('test1','test2'), array_keys($this->_hlt->getFields()));
+    }
+
+    public function testClearFields()
+    {
+        $fields = array(
+            'test1' => array('snippets' => 2),
+            'test2' => array('snippets' => 5),
+        );
+
+        $this->_hlt->addFields($fields);
+        $this->assertEquals(array('test1','test2'), array_keys($this->_hlt->getFields()));
+
+        $this->_hlt->clearFields();
+        $this->assertEquals(array(), array_keys($this->_hlt->getFields()));
+    }
+
+    public function testSetFields()
+    {
+        $fields = array(
+            'test1' => array('snippets' => 2),
+            'test2' => array('snippets' => 5),
+        );
+
+        $this->_hlt->addFields($fields);
+        $this->assertEquals(array('test1','test2'), array_keys($this->_hlt->getFields()));
+
+        $newFields = array(
+            'test3' => array('snippets' => 4),
+            'test4' => array('snippets' => 6),
+        );
+
+        $this->_hlt->setFields($newFields);
+        $this->assertEquals(array('test3','test4'), array_keys($this->_hlt->getFields()));
+    }
+
+
+    public function testSetAndGetSnippets()
+    {
+        $value = 2;
+        $this->_hlt->setSnippets($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getSnippets()
+        );
+    }
+
+    public function testSetAndGetFragSize()
+    {
+        $value = 20;
+        $this->_hlt->setFragsize($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getFragSize()
+        );
+    }
+
+    public function testSetAndGetMergeContiguous()
+    {
+        $value = true;
+        $this->_hlt->setMergeContiguous($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getMergeContiguous()
+        );
+    }
+
+    public function testSetAndGetRequireFieldMatch()
+    {
+        $value = true;
+        $this->_hlt->setRequireFieldMatch($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getRequireFieldMatch()
+        );
+    }
+
+    public function testSetAndGetMaxAnalyzedChars()
+    {
+        $value = 200;
+        $this->_hlt->setMaxAnalyzedChars($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getMaxAnalyzedChars()
+        );
+    }
+
+    public function testSetAndGetAlternateField()
+    {
+        $value = 'description';
+        $this->_hlt->setAlternateField($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getAlternateField()
+        );
+    }
+
+    public function testSetAndGetMaxAlternateFieldLength()
+    {
+        $value = 150;
+        $this->_hlt->setMaxAlternateFieldLength($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getMaxAlternateFieldLength()
+        );
+    }
+
+    public function testSetAndGetFormatter()
+    {
+        $this->_hlt->setFormatter();
+
+        $this->assertEquals(
+            'simple',
+            $this->_hlt->getFormatter()
+        );
+    }
+
+    public function testSetAndGetSimplePrefix()
+    {
+        $value = '<em>';
+        $this->_hlt->setSimplePrefix($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getSimplePrefix()
+        );
+    }
+
+    public function testSetAndGetSimplePostfix()
+    {
+        $value = '</em>';
+        $this->_hlt->setSimplePostfix($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getSimplePostfix()
+        );
+    }
+
+    public function testSetAndGetFragmenter()
+    {
+        $value = Solarium_Query_Select_Component_Highlighting::FRAGMENTER_REGEX;
+        $this->_hlt->setFragmenter($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getFragmenter()
+        );
+    }
+
+    public function testSetAndGetFragListBuilder()
+    {
+        $value = 'myBuilder';
+        $this->_hlt->setFragListBuilder($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getFragListBuilder()
+        );
+    }
+
+    public function testSetAndGetFragmentsBuilder()
+    {
+        $value = 'myBuilder';
+        $this->_hlt->setFragmentsBuilder($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getFragmentsBuilder()
+        );
+    }
+
+    public function testSetAndGetUseFastVectorHighlighter()
+    {
+        $value = true;
+        $this->_hlt->setUseFastVectorHighlighter($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getUseFastVectorHighlighter()
+        );
+    }
+
+    public function testSetAndGetUsePhraseHighlighter()
+    {
+        $value = true;
+        $this->_hlt->setUsePhraseHighlighter($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getUsePhraseHighlighter()
+        );
+    }
+
+    public function testSetAndGetHighlightMultiTerm()
+    {
+        $value = true;
+        $this->_hlt->setHighlightMultiTerm($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getHighlightMultiTerm()
+        );
+    }
+
+    public function testSetAndGetRegexSlop()
+    {
+        $value = .8;
+        $this->_hlt->setRegexSlop($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getRegexSlop()
+        );
+    }
+
+    public function testSetAndGetRegexPattern()
+    {
+        $value = 'myPattern';
+        $this->_hlt->setRegexPattern($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getRegexPattern()
+        );
+    }
+
+    public function testSetAndGetRegexMaxAnalyzedChars()
+    {
+        $value = 500;
+        $this->_hlt->setRegexMaxAnalyzedChars($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getRegexMaxAnalyzedChars()
+        );
+    }
+
+    public function testSetAndGetQuery()
+    {
+        $value = 'text:myvalue';
+        $this->_hlt->setQuery($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getQuery()
+        );
+    }
+
+    public function testSetAndGetPhraseLimit()
+    {
+        $value = 20;
+        $this->_hlt->setPhraseLimit($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_hlt->getPhraseLimit()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/DebugTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/DebugTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/DebugTest.php	(revision 7576)
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_DebugTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_Debug
+     */
+    protected $_debug;
+
+    public function setUp()
+    {
+        $this->_debug = new Solarium_Query_Select_Component_Debug;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'explainother' => 'id:12',
+        );
+
+        $this->_debug->setOptions($options);
+
+        $this->assertEquals($options['explainother'], $this->_debug->getExplainOther());
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(
+            Solarium_Query_Select::COMPONENT_DEBUG,
+            $this->_debug->getType()
+        );
+    }
+
+    public function testSetAndGetExplainOther()
+    {
+        $value = 'id:24';
+        $this->_debug->setExplainOther($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_debug->getExplainOther()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/DistributedSearchTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/DistributedSearchTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/DistributedSearchTest.php	(revision 7576)
@@ -0,0 +1,138 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_DistributedSearchTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_DistributedSearch
+     */
+    protected $_distributedSearch;
+
+    public function setUp()
+    {
+        $this->_distributedSearch = new Solarium_Query_Select_Component_DistributedSearch;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'shardhandler' => 'dummyhandler',
+            'shards' => array(
+                'shard1' => 'localhost:8983/solr/shard1',
+                'shard2' => 'localhost:8983/solr/shard2',
+            )
+        );
+
+        $this->_distributedSearch->setOptions($options);
+
+        $this->assertEquals($options['shardhandler'], $this->_distributedSearch->getShardRequestHandler());
+        $this->assertEquals($options['shards'], $this->_distributedSearch->getShards());
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(
+            Solarium_Query_Select::COMPONENT_DISTRIBUTEDSEARCH,
+            $this->_distributedSearch->getType()
+        );
+    }
+
+    public function testAddShard()
+    {
+        $this->_distributedSearch->addShard('shard1', 'localhost:8983/solr/shard1');
+        $shards = $this->_distributedSearch->getShards();
+        $this->assertEquals(
+            'localhost:8983/solr/shard1',
+            $shards['shard1']
+        );
+    }
+
+    public function testRemoveShard()
+    {
+        $this->_distributedSearch->addShard('shard1', 'localhost:8983/solr/shard1');
+        $this->_distributedSearch->removeShard('shard1');
+        $shards = $this->_distributedSearch->getShards();
+        $this->assertFalse(isset($shards['shard1']));
+    }
+
+    public function testClearShards()
+    {
+        $this->_distributedSearch->addShards(array(
+            'shard1' => 'localhost:8983/solr/shard1',
+            'shard2' => 'localhost:8983/solr/shard2',
+        ));
+        $this->_distributedSearch->clearShards();
+        $shards = $this->_distributedSearch->getShards();
+        $this->assertTrue(is_array($shards));
+        $this->assertEquals(0, count($shards));
+    }
+
+    public function testAddShards()
+    {
+        $shards = array(
+            'shard1' => 'localhost:8983/solr/shard1',
+            'shard2' => 'localhost:8983/solr/shard2',
+        );
+        $this->_distributedSearch->addShards($shards);
+        $this->assertEquals($shards, $this->_distributedSearch->getShards());
+    }
+
+    public function testSetShards()
+    {
+        $this->_distributedSearch->addShards(array(
+            'shard1' => 'localhost:8983/solr/shard1',
+            'shard2' => 'localhost:8983/solr/shard2',
+        ));
+        $this->_distributedSearch->setShards(array(
+            'shard3' => 'localhost:8983/solr/shard3',
+            'shard4' => 'localhost:8983/solr/shard4',
+            'shard5' => 'localhost:8983/solr/shard5',
+        ));
+        $shards = $this->_distributedSearch->getShards();
+        $this->assertEquals(3, count($shards));
+        $this->assertEquals(array(
+            'shard3' => 'localhost:8983/solr/shard3',
+            'shard4' => 'localhost:8983/solr/shard4',
+            'shard5' => 'localhost:8983/solr/shard5',
+        ), $shards);
+    }
+
+    public function testSetShardRequestHandler()
+    {
+        $this->_distributedSearch->setShardRequestHandler('dummy');
+        $this->assertEquals(
+            'dummy',
+            $this->_distributedSearch->getShardRequestHandler()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Stats/FieldTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Stats/FieldTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/Component/Stats/FieldTest.php	(revision 7576)
@@ -0,0 +1,107 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_Component_Stats_FieldTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select_Component_Stats_Field
+     */
+    protected $_field;
+
+    public function setUp()
+    {
+        $this->_field = new Solarium_Query_Select_Component_Stats_Field;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'facet' => 'field1, field2',
+        );
+
+        $this->_field->setOptions($options);
+        $this->assertEquals(array('field1','field2'), $this->_field->getFacets());
+    }
+
+    public function testSetAndGetKey()
+    {
+        $this->_field->setKey('testkey');
+        $this->assertEquals('testkey', $this->_field->getKey());
+    }
+
+    public function testAddFacet()
+    {
+        $expectedFacets = $this->_field->getFacets();
+        $expectedFacets[] = 'newfacet';
+        $this->_field->addFacet('newfacet');
+        $this->assertEquals($expectedFacets, $this->_field->getFacets());
+    }
+
+    public function testClearFacets()
+    {
+        $this->_field->addFacet('newfacet');
+        $this->_field->clearFacets();
+        $this->assertEquals(array(), $this->_field->getFacets());
+    }
+
+    public function testAddFacets()
+    {
+        $facets = array('facet1','facet2');
+
+        $this->_field->clearFacets();
+        $this->_field->addFacets($facets);
+        $this->assertEquals($facets, $this->_field->getFacets());
+    }
+
+    public function testAddFacetsAsStringWithTrim()
+    {
+        $this->_field->clearFacets();
+        $this->_field->addFacets('facet1, facet2');
+        $this->assertEquals(array('facet1','facet2'), $this->_field->getFacets());
+    }
+
+    public function testRemoveFacet()
+    {
+        $this->_field->clearFacets();
+        $this->_field->addFacets(array('facet1','facet2'));
+        $this->_field->removeFacet('facet1');
+        $this->assertEquals(array('facet2'), $this->_field->getFacets());
+    }
+
+    public function testSetFacets()
+    {
+        $this->_field->clearFacets();
+        $this->_field->addFacets(array('facet1','facet2'));
+        $this->_field->setFacets(array('facet3','facet4'));
+        $this->assertEquals(array('facet3','facet4'), $this->_field->getFacets());
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/ComponentTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/ComponentTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Select/ComponentTest.php	(revision 7576)
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Select_ComponentTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testGetType()
+    {
+        $component = new TestComponent();
+        $this->assertEquals('testtype', $component->getType());
+    }
+
+}
+
+class TestComponent extends Solarium_Query_Select_Component{
+
+    protected $_type = 'testtype';
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/TermsTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/TermsTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/TermsTest.php	(revision 7576)
@@ -0,0 +1,128 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_TermsTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Terms
+     */
+    protected $_query;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Terms;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Client::QUERYTYPE_TERMS, $this->_query->getType());
+    }
+
+    public function testSetAndGetFields()
+    {
+        $this->_query->setFields('fieldA,fieldB');
+        $this->assertEquals('fieldA,fieldB', $this->_query->getFields());
+    }
+
+    public function testSetAndGetLowerbound()
+    {
+        $this->_query->setLowerbound('f');
+        $this->assertEquals('f', $this->_query->getLowerbound());
+    }
+
+    public function testSetAndGetLowerboundInclude()
+    {
+        $this->_query->setLowerboundInclude(true);
+        $this->assertEquals(true, $this->_query->getLowerboundInclude());
+    }
+
+    public function testSetAndGetMinCount()
+    {
+        $this->_query->setMinCount(3);
+        $this->assertEquals(3, $this->_query->getMinCount());
+    }
+
+    public function testSetAndGetMaxCount()
+    {
+        $this->_query->setMaxCount(25);
+        $this->assertEquals(25, $this->_query->getMaxCount());
+    }
+
+    public function testSetAndGetPrefix()
+    {
+        $this->_query->setPrefix('wat');
+        $this->assertEquals('wat', $this->_query->getPrefix());
+    }
+
+    public function testSetAndGetRegex()
+    {
+        $this->_query->setRegex('at.*');
+        $this->assertEquals('at.*', $this->_query->getRegex());
+    }
+
+    public function testSetAndGetRegexFlags()
+    {
+        $this->_query->setRegexFlags('case_insensitive,comments');
+        $this->assertEquals('case_insensitive,comments', $this->_query->getRegexFlags());
+    }
+
+    public function testSetAndGetLimit()
+    {
+        $this->_query->setLimit(15);
+        $this->assertEquals(15, $this->_query->getLimit());
+    }
+
+    public function testSetAndGetUpperbound()
+    {
+        $this->_query->setUpperbound('x');
+        $this->assertEquals('x', $this->_query->getUpperbound());
+    }
+
+    public function testSetAndGetUpperboundInclude()
+    {
+        $this->_query->setUpperboundInclude(true);
+        $this->assertEquals(true, $this->_query->getUpperboundInclude());
+    }
+
+    public function testSetAndGetRaw()
+    {
+        $this->_query->setRaw(false);
+        $this->assertEquals(false, $this->_query->getRaw());
+    }
+
+    public function testSetAndGetSort()
+    {
+        $this->_query->setSort('index');
+        $this->assertEquals('index', $this->_query->getSort());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/RollbackTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/RollbackTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/RollbackTest.php	(revision 7576)
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Update_Command_RollbackTest extends PHPUnit_Framework_TestCase
+{
+    public function testGetType()
+    {
+        $command = new Solarium_Query_Update_Command_Rollback;
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_ROLLBACK,
+            $command->getType()
+        );
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/OptimizeTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/OptimizeTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/OptimizeTest.php	(revision 7576)
@@ -0,0 +1,101 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Update_Command_OptimizeTest extends PHPUnit_Framework_TestCase
+{
+    protected $_command;
+
+    public function setUp()
+    {
+        $this->_command = new Solarium_Query_Update_Command_Optimize; 
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'waitflush' => true,
+            'waitsearcher' => false,
+            'maxsegments' => 6,
+        );
+
+        $command = new Solarium_Query_Update_Command_Optimize($options);
+
+        $this->assertEquals(
+            true,
+            $command->getWaitFlush()
+        );
+
+        $this->assertEquals(
+            false,
+            $command->getWaitSearcher()
+        );
+
+        $this->assertEquals(
+            6,
+            $command->getMaxSegments()
+        );
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_OPTIMIZE,
+            $this->_command->getType()
+        );
+    }
+
+    public function testGetAndSetWaitFlush()
+    {
+        $this->_command->setWaitFlush(false);
+        $this->assertEquals(
+            false,
+            $this->_command->getWaitFlush()
+        );
+    }
+
+    public function testGetAndSetWaitSearcher()
+    {
+        $this->_command->setWaitSearcher(false);
+        $this->assertEquals(
+            false,
+            $this->_command->getWaitSearcher()
+        );
+    }
+
+    public function testGetAndSetMaxSegments()
+    {
+        $this->_command->setMaxSegments(12);
+        $this->assertEquals(
+            12,
+            $this->_command->getMaxSegments()
+        );
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/DeleteTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/DeleteTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/DeleteTest.php	(revision 7576)
@@ -0,0 +1,127 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Update_Command_DeleteTest extends PHPUnit_Framework_TestCase
+{
+    protected $_command;
+
+    public function setUp()
+    {
+        $this->_command = new Solarium_Query_Update_Command_Delete;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_DELETE,
+            $this->_command->getType()
+        );
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'id' => 1,
+            'query' => '*:*',
+        );
+
+        $command = new Solarium_Query_Update_Command_Delete($options);
+
+        $this->assertEquals(
+            array(1),
+            $command->getIds()
+        );
+
+        $this->assertEquals(
+            array('*:*'),
+            $command->getQueries()
+        );
+    }
+
+    public function testConfigModeMultiValue()
+    {
+        $options = array(
+            'id' => array(1,2),
+            'query' => array('id:1','id:2'),
+        );
+
+        $command = new Solarium_Query_Update_Command_Delete($options);
+
+        $this->assertEquals(
+            array(1,2),
+            $command->getIds()
+        );
+
+        $this->assertEquals(
+            array('id:1','id:2'),
+            $command->getQueries()
+        );
+    }
+
+    public function testAddId()
+    {
+        $this->_command->addId(1);
+        $this->assertEquals(
+            array(1),
+            $this->_command->getIds()
+        );
+    }
+
+    public function testAddIds()
+    {
+        $this->_command->addId(1);
+        $this->_command->addIds(array(2,3));
+        $this->assertEquals(
+            array(1,2,3),
+            $this->_command->getIds()
+        );
+    }
+
+    public function testAddQuery()
+    {
+        $this->_command->addQuery('*:*');
+        $this->assertEquals(
+            array('*:*'),
+            $this->_command->getQueries()
+        );
+    }
+
+    public function testAddQueries()
+    {
+        $this->_command->addQuery('*:*');
+        $this->_command->addQueries(array('id:1','id:2'));
+        $this->assertEquals(
+            array('*:*','id:1','id:2'),
+            $this->_command->getQueries()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/AddTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/AddTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/AddTest.php	(revision 7576)
@@ -0,0 +1,171 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Update_Command_AddTest extends PHPUnit_Framework_TestCase
+{
+    protected $_command;
+
+    public function setUp()
+    {
+        $this->_command = new Solarium_Query_Update_Command_Add;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_ADD,
+            $this->_command->getType()
+        );
+    }
+
+    public function testAddDocument()
+    {
+        $doc = new Solarium_Document_ReadWrite(array('id' => 1));
+        $this->_command->addDocument($doc);
+        $this->assertEquals(
+            array($doc),
+            $this->_command->getDocuments()
+        );
+    }
+
+    public function testAddDocuments()
+    {
+        $doc1 = new Solarium_Document_ReadWrite(array('id' => 1));
+        $doc2 = new Solarium_Document_ReadWrite(array('id' => 2));
+        $this->_command->addDocuments(array($doc1, $doc2));
+        $this->assertEquals(
+            array($doc1, $doc2),
+            $this->_command->getDocuments()
+        );
+    }
+
+    public function testAddDocumentsMultipleTimes()
+    {
+        $doc1 = new Solarium_Document_ReadWrite(array('id' => 1));
+        $doc2 = new Solarium_Document_ReadWrite(array('id' => 2));
+        $this->_command->addDocuments(array($doc1, $doc2));
+
+        $doc3 = new Solarium_Document_ReadWrite(array('id' => 3));
+        $doc4 = new Solarium_Document_ReadWrite(array('id' => 4));
+        $this->_command->addDocuments(array($doc3, $doc4));
+
+        $this->assertEquals(
+            array($doc1, $doc2, $doc3, $doc4),
+            $this->_command->getDocuments()
+        );
+    }
+
+    public function testAddDocumentsIteration()
+    {
+        $doc1 = new Solarium_Document_ReadWrite(array('id' => 1));
+        $doc2 = new Solarium_Document_ReadWrite(array('id' => 2));
+
+        $it = new ArrayIterator(array($doc1, $doc2));
+
+        $this->_command->addDocuments($it);
+
+        if ($this->_command->getDocuments() instanceof Traversable) {
+            $command_documents = iterator_to_array($this->_command->getDocuments());
+        } else {
+            $command_documents = $this->_command->getDocuments();
+        }
+
+        $this->assertEquals(
+            array($doc1, $doc2),
+            $command_documents,
+            'checking first two documents are added correctly'
+        );
+
+        $doc3 = new Solarium_Document_ReadWrite(array('id' => 3));
+        $doc4 = new Solarium_Document_ReadWrite(array('id' => 4));
+        $doc5 = new Solarium_Document_ReadWrite(array('id' => 5));
+
+        $it2 = new ArrayIterator(array($doc3, $doc4, $doc5));
+
+        $this->_command->addDocuments($it2);
+
+        if ($this->_command->getDocuments() instanceof Traversable) {
+            $command_documents = iterator_to_array($this->_command->getDocuments());
+        } else {
+            $command_documents = $this->_command->getDocuments();
+        }
+
+        $this->assertEquals(
+            array($doc1, $doc2, $doc3, $doc4, $doc5),
+            $command_documents,
+            'checking second three documents are added correctly to first two'
+        );
+    }
+
+    /**
+     * @depends testAddDocumentsIteration
+     */
+    public function testAddDocumentToIteration()
+    {
+        $doc1 = new Solarium_Document_ReadWrite(array('id' => 1));
+        $doc2 = new Solarium_Document_ReadWrite(array('id' => 2));
+
+        $this->_command->addDocuments(new ArrayIterator(array($doc1, $doc2)));
+
+        $doc3 = new Solarium_Document_ReadWrite(array('id' => 3));
+
+        $this->_command->addDocument($doc3);
+
+        if ($this->_command->getDocuments() instanceof Traversable) {
+            $command_documents = iterator_to_array($this->_command->getDocuments());
+        } else {
+            $command_documents = $this->_command->getDocuments();
+        }
+
+        $this->assertEquals(
+            array($doc1, $doc2, $doc3),
+            $command_documents
+        );
+    }
+
+    public function testGetAndSetOverwrite()
+    {
+        $this->_command->setOverwrite(false);
+        $this->assertEquals(
+            false,
+            $this->_command->getOverwrite()
+        );
+    }
+
+    public function testGetAndSetCommitWithin()
+    {
+        $this->_command->setCommitWithin(100);
+        $this->assertEquals(
+            100,
+            $this->_command->getCommitWithin()
+        );
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/CommitTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/CommitTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Update/Command/CommitTest.php	(revision 7576)
@@ -0,0 +1,101 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Update_Command_CommitTest extends PHPUnit_Framework_TestCase
+{
+    protected $_command;
+
+    public function setUp()
+    {
+        $this->_command = new Solarium_Query_Update_Command_Commit;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_COMMIT,
+            $this->_command->getType()
+        );
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'waitflush' => true,
+            'waitsearcher' => false,
+            'expungedeletes' => true,
+        );
+
+        $command = new Solarium_Query_Update_Command_Commit($options);
+
+        $this->assertEquals(
+            true,
+            $command->getWaitFlush()
+        );
+
+        $this->assertEquals(
+            false,
+            $command->getWaitSearcher()
+        );
+
+        $this->assertEquals(
+            true,
+            $command->getExpungeDeletes()
+        );
+    }
+
+    public function testGetAndSetWaitFlush()
+    {
+        $this->_command->setWaitFlush(false);
+        $this->assertEquals(
+            false,
+            $this->_command->getWaitFlush()
+        );
+    }
+
+    public function testGetAndSetWaitSearcher()
+    {
+        $this->_command->setWaitSearcher(false);
+        $this->assertEquals(
+            false,
+            $this->_command->getWaitSearcher()
+        );
+    }
+
+    public function testGetAndSetExpungeDeletes()
+    {
+        $this->_command->setExpungeDeletes(true);
+        $this->assertEquals(
+            true,
+            $this->_command->getExpungeDeletes()
+        );
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Analysis/DocumentTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Analysis/DocumentTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Analysis/DocumentTest.php	(revision 7576)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Analysis_DocumentTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Analysis_Document
+     */
+    protected $_query;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Analysis_Document;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Client::QUERYTYPE_ANALYSIS_DOCUMENT, $this->_query->getType());
+    }
+
+    public function testAddAndGetDocument()
+    {
+        $doc = new Solarium_Document_ReadWrite(array('id' => 1));
+        $this->_query->addDocument($doc);
+        $this->assertEquals(
+            array($doc),
+            $this->_query->getDocuments()
+        );
+    }
+
+    public function testAddAndGetDocuments()
+    {
+        $doc1 = new Solarium_Document_ReadWrite(array('id' => 1));
+        $doc2 = new Solarium_Document_ReadWrite(array('id' => 2));
+        $this->_query->addDocuments(array($doc1, $doc2));
+        $this->assertEquals(
+            array($doc1, $doc2),
+            $this->_query->getDocuments()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Analysis/FieldTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Analysis/FieldTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/Analysis/FieldTest.php	(revision 7576)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_Analysis_FieldTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Analysis_Field
+     */
+    protected $_query;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Analysis_Field;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Client::QUERYTYPE_ANALYSIS_FIELD, $this->_query->getType());
+    }
+
+    public function testSetAndGetFieldValue()
+    {
+        $data = 'testdata';
+        $this->_query->setFieldValue($data);
+        $this->assertEquals($data, $this->_query->getFieldValue());
+    }
+
+    public function testSetAndGetFieldType()
+    {
+        $data = 'testdata';
+        $this->_query->setFieldType($data);
+        $this->assertEquals($data, $this->_query->getFieldType());
+    }
+
+    public function testSetAndGetFieldName()
+    {
+        $data = 'testdata';
+        $this->_query->setFieldName($data);
+        $this->assertEquals($data, $this->_query->getFieldName());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/PingTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/PingTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/PingTest.php	(revision 7576)
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_PingTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_query;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Ping;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Client::QUERYTYPE_PING, $this->_query->getType());
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'handler'  => 'myHandler',
+            'resultclass' => 'myResult',
+        );
+        $this->_query->setOptions($options);
+
+        $this->assertEquals(
+            $options['handler'],
+            $this->_query->getHandler()
+        );
+
+        $this->assertEquals(
+            $options['resultclass'],
+            $this->_query->getResultClass()
+        );
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/HelperTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/HelperTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/HelperTest.php	(revision 7576)
@@ -0,0 +1,339 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_HelperTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Solarium_Query_Helper
+     */
+    protected $_helper;
+
+    /**
+     * @var Solarium_Query_Select
+     */
+    protected $_query;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Select;
+        $this->_helper = new Solarium_Query_Helper($this->_query);
+    }
+
+    public function testRangeQueryInclusive()
+    {
+        $this->assertEquals(
+            'field:[1 TO 2]',
+            $this->_helper->rangeQuery('field',1,2)
+        );
+
+        $this->assertEquals(
+            'store:[45,-94 TO 46,-93]',
+            $this->_helper->rangeQuery('store', '45,-94', '46,-93')
+        );
+    }
+
+    public function testRangeQueryExclusive()
+    {
+        $this->assertEquals(
+            'field:{1 TO 2}',
+            $this->_helper->rangeQuery('field',1,2, false)
+        );
+
+        $this->assertEquals(
+            'store:{45,-94 TO 46,-93}',
+            $this->_helper->rangeQuery('store', '45,-94', '46,-93', false)
+        );
+    }
+
+    public function testGeofilt()
+    {
+        $this->assertEquals(
+            '{!geofilt pt=45.15,-93.85 sfield=store d=5}',
+            $this->_helper->geofilt(45.15, -93.85, 'store', 5)
+        );
+    }
+
+    public function testBbox()
+    {
+        $this->assertEquals(
+            '{!bbox pt=45.15,-93.85 sfield=store d=5}',
+            $this->_helper->bbox(45.15, -93.85, 'store', 5)
+        );
+    }
+
+    public function testGeodist()
+    {
+        $this->assertEquals(
+            'geodist(45.15,-93.85,store)',
+            $this->_helper->geodist(45.15, -93.85, 'store')
+        );
+    }
+
+    public function testQparserNoParams()
+    {
+        $this->assertEquals(
+            '{!parser}',
+            $this->_helper->qparser('parser')
+        );
+    }
+
+    public function testQparser()
+    {
+        $this->assertEquals(
+            '{!parser a=1 b=test}',
+            $this->_helper->qparser('parser', array('a' => 1, 'b' => 'test'))
+        );
+    }
+
+    public function testQparserDereferencedNoQuery()
+    {
+        $helper = new Solarium_Query_Helper();
+        $this->setExpectedException('Solarium_Exception');
+        $helper->qparser('join', array('from' => 'manu_id', 'to' => 'id'), true);
+    }
+
+    public function testQparserDereferenced()
+    {
+        $this->assertEquals(
+            '{!join from=$deref_1 to=$deref_2}',
+            $this->_helper->qparser('join', array('from' => 'manu_id', 'to' => 'id'), true)
+        );
+
+        $this->assertEquals(
+            array('deref_1' => 'manu_id', 'deref_2' => 'id'),
+            $this->_query->getParams()
+        );
+
+        // second call, params should have updated counts
+        $this->assertEquals(
+            '{!join from=$deref_3 to=$deref_4}',
+            $this->_helper->qparser('join', array('from' => 'cat_id', 'to' => 'prod_id'), true)
+        );
+
+        // previous params should also still be there
+        $this->assertEquals(
+            array('deref_1' => 'manu_id', 'deref_2' => 'id', 'deref_3' => 'cat_id', 'deref_4' => 'prod_id'),
+            $this->_query->getParams()
+        );
+    }
+
+    public function testFunctionCallNoParams()
+    {
+        $this->assertEquals(
+            'sum()',
+            $this->_helper->functionCall('sum')
+        );
+    }
+
+    public function testFunctionCall()
+    {
+        $this->assertEquals(
+            'sum(1,2)',
+            $this->_helper->functionCall('sum', array(1,2))
+        );
+    }
+
+    public function testEscapeTerm()
+    {
+        $this->assertEquals(
+            'a\\+b',
+            $this->_helper->escapeTerm('a+b')
+        );
+    }
+
+    public function testEscapeTermNoEscape()
+    {
+        $this->assertEquals(
+            'abc',
+            $this->_helper->escapeTerm('abc')
+        );
+    }
+
+    public function testEscapePhrase()
+    {
+        $this->assertEquals(
+            '"a+\\"b"',
+            $this->_helper->escapePhrase('a+"b')
+        );
+    }
+
+    public function testEscapePhraseNoEscape()
+    {
+        $this->assertEquals(
+            '"a+b"',
+            $this->_helper->escapePhrase('a+b')
+        );
+    }
+
+    public function testFormatDateInputTimestamp()
+    {
+        $this->assertFalse(
+            $this->_helper->formatDate(strtotime('2011---')),
+            'Expects invalid strtotime/timestamp input (false) not to be accepted'
+        );
+
+        //allow negative dates.
+        $this->assertNotEquals(
+            false,
+            $this->_helper->formatDate(strtotime('2011-10-01')),
+            'Expects negative timestamp input to be accepted'
+        );
+
+        //@todo find out if we need to any test for php versions / platforms which do not support negative timestamp
+
+        $this->assertFalse(
+            $this->_helper->formatDate(strtotime('2010-31-02')),
+            'Expects invalid timestamp input (not in calendar) not to be accepted'
+        );
+
+        $this->assertEquals(
+            $this->_mockFormatDateOutput(strtotime('2011-10-01')),
+            $this->_helper->formatDate(strtotime('2011-10-01')),
+            'Expects formatDate with Timstamp input to output ISO8601 with stripped timezone'
+        );
+    }
+
+    public function testFormatDateInputString()
+    {
+        $this->assertFalse(
+            $this->_helper->formatDate('2011-13-31'),
+            'Expects an invalid date string input not to be accepted'
+        );
+
+        $this->assertEquals(
+            $this->_mockFormatDateOutput(strtotime('2011-10-01')),
+            $this->_helper->formatDate('2011-10-01'),
+            'Expects formatDate with String input to output ISO8601 with stripped timezone'
+        );
+    }
+
+    public function testFormatDateInputDateTime()
+    {
+        date_default_timezone_set("UTC"); // prevent timezone differences
+
+        $this->assertFalse(
+            $this->_helper->formatDate(new stdClass()),
+            'Expect any other object not to be accepted'
+        );
+
+        $this->assertEquals(
+            $this->_mockFormatDateOutput(strtotime('2011-10-01')),
+            $this->_helper->formatDate(new DateTime('2011-10-01')),
+            'Expects formatDate with DateTime input to output ISO8601 with stripped timezone'
+        );
+    }
+
+    public function testFormatDate()
+    {
+        //check if timezone is stripped
+        $expected = strtoupper('Z');
+        $actual = substr($this->_helper->formatDate(time()), 19, 20);
+        $this->assertEquals($expected, $actual, 'Expects last charachter to be uppercased Z');
+
+        $this->assertEquals(
+            $this->_mockFormatDateOutput(time()),
+            $this->_helper->formatDate(time())
+        );
+    }
+
+    protected function _mockFormatDateOutput($timestamp)
+    {
+        $date = new DateTime('@'.$timestamp);
+        return strstr($date->format(DateTime::ISO8601), '+', true) . 'Z';
+    }
+
+    public function testAssemble()
+    {
+        // test single basic placeholder
+        $this->assertEquals(
+            'id:456 AND cat:2',
+            $this->_helper->assemble('id:%1% AND cat:2',array(456))
+        );
+
+        // test multiple basic placeholders and placeholder repeat
+        $this->assertEquals(
+            '(id:456 AND cat:2) OR (id:456 AND cat:1)',
+            $this->_helper->assemble('(id:%1% AND cat:%2%) OR (id:%1% AND cat:%3%)',array(456, 2, 1))
+        );
+
+        // test literal placeholder (same as basic)
+        $this->assertEquals(
+            'id:456 AND cat:2',
+            $this->_helper->assemble('id:%L1% AND cat:2',array(456))
+        );
+
+        // test term placeholder
+        $this->assertEquals(
+            'cat:2 AND content:a\\+b',
+            $this->_helper->assemble('cat:2 AND content:%T1%',array('a+b'))
+        );
+
+        // test term placeholder case-insensitive
+        $this->assertEquals(
+            'cat:2 AND content:a\\+b',
+            $this->_helper->assemble('cat:2 AND content:%t1%',array('a+b'))
+        );
+
+        // test phrase placeholder
+        $this->assertEquals(
+            'cat:2 AND content:"a+\\"b"',
+            $this->_helper->assemble('cat:2 AND content:%P1%',array('a+"b'))
+        );
+    }
+
+    public function testAssembleInvalidPartNumber()
+    {
+        $this->setExpectedException('Solarium_Exception');
+        $this->_helper->assemble('cat:%1% AND content:%2%',array('value1'));
+    }
+
+    public function testJoin()
+    {
+        $this->assertEquals(
+            '{!join from=manu_id to=id}',
+            $this->_helper->join('manu_id', 'id')
+        );
+    }
+
+    public function testJoinDereferenced()
+    {
+        $this->assertEquals(
+            '{!join from=$deref_1 to=$deref_2}',
+            $this->_helper->join('manu_id', 'id', true)
+        );
+
+        $this->assertEquals(
+            array('deref_1' => 'manu_id', 'deref_2' => 'id'),
+            $this->_query->getParams()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/MoreLikeThisTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/MoreLikeThisTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/MoreLikeThisTest.php	(revision 7576)
@@ -0,0 +1,180 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_MoreLikeThisTest extends Solarium_Query_SelectTest
+{
+
+    protected $_query;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_MoreLikeThis;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Client::QUERYTYPE_MORELIKETHIS, $this->_query->getType());
+    }
+
+    public function testSetAndGetMatchInclude()
+    {
+        $value = true;
+        $this->_query->setMatchInclude($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getMatchInclude()
+        );
+    }
+
+    public function testSetAndGetMltFields()
+    {
+        $value = 'name,description';
+        $this->_query->setMltFields($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getMltFields()
+        );
+    }
+
+    public function testSetAndGetInterestingTerms()
+    {
+        $value = 'test';
+        $this->_query->setInterestingTerms($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getInterestingTerms()
+        );
+    }
+
+    public function testSetAndGetQueryStream()
+    {
+        $value = true;
+        $this->_query->setQueryStream($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getQueryStream()
+        );
+    }
+
+    public function testSetAndGetMinimumTermFrequency()
+    {
+        $value = 2;
+        $this->_query->setMinimumTermFrequency($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getMinimumTermFrequency()
+        );
+    }
+
+    public function testMinimumDocumentFrequency()
+    {
+        $value = 4;
+        $this->_query->setMinimumDocumentFrequency($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getMinimumDocumentFrequency()
+        );
+    }
+
+    public function testSetAndGetMinimumWordLength()
+    {
+        $value = 3;
+        $this->_query->setMinimumWordLength($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getMinimumWordLength()
+        );
+    }
+
+    public function testSetAndGetMaximumWordLength()
+    {
+        $value = 15;
+        $this->_query->setMaximumWordLength($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getMaximumWordLength()
+        );
+    }
+
+    public function testSetAndGetMaximumQueryTerms()
+    {
+        $value = 5;
+        $this->_query->setMaximumQueryTerms($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getMaximumQueryTerms()
+        );
+    }
+
+    public function testSetAndGetMaximumNumberOfTokens()
+    {
+        $value = 5;
+        $this->_query->setMaximumNumberOfTokens($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getMaximumNumberOfTokens()
+        );
+    }
+
+    public function testSetAndGetBoost()
+    {
+        $value = true;
+        $this->_query->setBoost($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getBoost()
+        );
+    }
+
+    public function testSetAndGetQueryFields()
+    {
+        $value = 'content,name';
+        $this->_query->setQueryFields($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getQueryFields()
+        );
+    }
+
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/SelectTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/SelectTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/SelectTest.php	(revision 7576)
@@ -0,0 +1,643 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_SelectTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select
+     */
+    protected $_query;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Select;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Client::QUERYTYPE_SELECT, $this->_query->getType());
+    }
+
+    public function testSetAndGetStart()
+    {
+        $this->_query->setStart(234);
+        $this->assertEquals(234, $this->_query->getStart());
+    }
+
+    public function testSetAndGetQueryWithTrim()
+    {
+        $this->_query->setQuery(' *:* ');
+        $this->assertEquals('*:*', $this->_query->getQuery());
+    }
+
+    public function testSetAndGetQueryWithBind()
+    {
+        $this->_query->setQuery('id:%1%', array(678));
+        $this->assertEquals('id:678', $this->_query->getQuery());
+    }
+
+    public function testSetAndGetQueryDefaultOperator()
+    {
+        $value = Solarium_Query_Select::QUERY_OPERATOR_AND;
+
+        $this->_query->setQueryDefaultOperator($value);
+        $this->assertEquals($value, $this->_query->getQueryDefaultOperator());
+    }
+
+    public function testSetAndGetQueryDefaultField()
+    {
+        $value = 'mydefault';
+
+        $this->_query->setQueryDefaultField($value);
+        $this->assertEquals($value, $this->_query->getQueryDefaultField());
+    }
+
+    public function testSetAndGetResultClass()
+    {
+        $this->_query->setResultClass('MyResult');
+        $this->assertEquals('MyResult', $this->_query->getResultClass());
+    }
+
+    public function testSetAndGetDocumentClass()
+    {
+        $this->_query->setDocumentClass('MyDocument');
+        $this->assertEquals('MyDocument', $this->_query->getDocumentClass());
+    }
+
+    public function testSetAndGetRows()
+    {
+        $this->_query->setRows(100);
+        $this->assertEquals(100, $this->_query->getRows());
+    }
+
+    public function testAddField()
+    {
+        $expectedFields = $this->_query->getFields();
+        $expectedFields[] = 'newfield';
+        $this->_query->addField('newfield');
+        $this->assertEquals($expectedFields, $this->_query->getFields());
+    }
+
+    public function testClearFields()
+    {
+        $this->_query->addField('newfield');
+        $this->_query->clearFields();
+        $this->assertEquals(array(), $this->_query->getFields());
+    }
+
+    public function testAddFields()
+    {
+        $fields = array('field1','field2');
+
+        $this->_query->clearFields();
+        $this->_query->addFields($fields);
+        $this->assertEquals($fields, $this->_query->getFields());
+    }
+
+    public function testAddFieldsAsStringWithTrim()
+    {
+        $this->_query->clearFields();
+        $this->_query->addFields('field1, field2');
+        $this->assertEquals(array('field1','field2'), $this->_query->getFields());
+    }
+
+    public function testRemoveField()
+    {
+        $this->_query->clearFields();
+        $this->_query->addFields(array('field1','field2'));
+        $this->_query->removeField('field1');
+        $this->assertEquals(array('field2'), $this->_query->getFields());
+    }
+
+    public function testSetFields()
+    {
+        $this->_query->clearFields();
+        $this->_query->addFields(array('field1','field2'));
+        $this->_query->setFields(array('field3','field4'));
+        $this->assertEquals(array('field3','field4'), $this->_query->getFields());
+    }
+
+    public function testAddSort()
+    {
+        $this->_query->addSort('field1', Solarium_Query_Select::SORT_DESC);
+        $this->assertEquals(
+            array('field1' => Solarium_Query_Select::SORT_DESC),
+            $this->_query->getSorts()
+        );
+    }
+
+    public function testAddSorts()
+    {
+        $sorts = array(
+            'field1' => Solarium_Query_Select::SORT_DESC,
+            'field2' => Solarium_Query_Select::SORT_ASC
+        );
+
+        $this->_query->addSorts($sorts);
+        $this->assertEquals(
+            $sorts,
+            $this->_query->getSorts()
+        );
+    }
+
+    public function testRemoveSort()
+    {
+        $sorts = array(
+            'field1' => Solarium_Query_Select::SORT_DESC,
+            'field2' => Solarium_Query_Select::SORT_ASC
+        );
+
+        $this->_query->addSorts($sorts);
+        $this->_query->removeSort('field1');
+        $this->assertEquals(
+            array('field2' => Solarium_Query_Select::SORT_ASC),
+            $this->_query->getSorts()
+        );
+    }
+
+    public function testRemoveInvalidSort()
+    {
+        $sorts = array(
+            'field1' => Solarium_Query_Select::SORT_DESC,
+            'field2' => Solarium_Query_Select::SORT_ASC
+        );
+
+        $this->_query->addSorts($sorts);
+        $this->_query->removeSort('invalidfield'); //continue silently
+        $this->assertEquals(
+            $sorts,
+            $this->_query->getSorts()
+        );
+    }
+
+    public function testClearSorts()
+    {
+        $sorts = array(
+            'field1' => Solarium_Query_Select::SORT_DESC,
+            'field2' => Solarium_Query_Select::SORT_ASC
+        );
+
+        $this->_query->addSorts($sorts);
+        $this->_query->clearSorts();
+        $this->assertEquals(
+            array(),
+            $this->_query->getSorts()
+        );
+    }
+
+    public function testSetSorts()
+    {
+        $sorts = array(
+            'field1' => Solarium_Query_Select::SORT_DESC,
+            'field2' => Solarium_Query_Select::SORT_ASC
+        );
+
+        $this->_query->addSorts($sorts);
+        $this->_query->setSorts(array('field3' => Solarium_Query_Select::SORT_ASC));
+        $this->assertEquals(
+            array('field3' => Solarium_Query_Select::SORT_ASC),
+            $this->_query->getSorts()
+        );
+    }
+
+    public function testAddAndGetFilterQuery()
+    {
+        $fq = new Solarium_Query_Select_FilterQuery;
+        $fq->setKey('fq1')->setQuery('category:1');
+        $this->_query->addFilterQuery($fq);
+
+        $this->assertEquals(
+            $fq,
+            $this->_query->getFilterQuery('fq1')
+        );
+    }
+
+    public function testAddAndGetFilterQueryWithKey()
+    {
+        $key = 'fq1';
+
+        $fq = $this->_query->createFilterQuery($key, true);
+        $fq->setQuery('category:1');
+
+        $this->assertEquals(
+            $key,
+            $fq->getKey()
+        );
+
+        $this->assertEquals(
+            $fq,
+            $this->_query->getFilterQuery('fq1')
+        );
+    }
+
+    public function testAddFilterQueryWithoutKey()
+    {
+        $fq = new Solarium_Query_Select_FilterQuery;
+        $fq->setQuery('category:1');
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_query->addFilterQuery($fq);
+    }
+
+    public function testAddFilterQueryWithUsedKey()
+    {
+        $fq1 = new Solarium_Query_Select_FilterQuery;
+        $fq1->setKey('fq1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_FilterQuery;
+        $fq2->setKey('fq1')->setQuery('category:2');
+
+        $this->_query->addFilterQuery($fq1);
+        $this->setExpectedException('Solarium_Exception');
+        $this->_query->addFilterQuery($fq2);
+    }
+
+    public function testGetInvalidFilterQuery()
+    {
+        $this->assertEquals(
+            null,
+            $this->_query->getFilterQuery('invalidtag')
+        );
+    }
+
+    public function testAddFilterQueries()
+    {
+        $fq1 = new Solarium_Query_Select_FilterQuery;
+        $fq1->setKey('fq1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_FilterQuery;
+        $fq2->setKey('fq2')->setQuery('category:2');
+
+        $filterQueries = array('fq1' => $fq1, 'fq2' => $fq2);
+
+        $this->_query->addFilterQueries($filterQueries);
+        $this->assertEquals(
+            $filterQueries,
+            $this->_query->getFilterQueries()
+        );
+    }
+
+    public function testRemoveFilterQuery()
+    {
+        $fq1 = new Solarium_Query_Select_FilterQuery;
+        $fq1->setKey('fq1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_FilterQuery;
+        $fq2->setKey('fq2')->setQuery('category:2');
+
+        $filterQueries = array($fq1, $fq2);
+
+        $this->_query->addFilterQueries($filterQueries);
+        $this->_query->removeFilterQuery('fq1');
+        $this->assertEquals(
+            array('fq2' => $fq2),
+            $this->_query->getFilterQueries()
+        );
+    }
+
+    public function testRemoveFilterQueryWithObjectInput()
+    {
+        $fq1 = new Solarium_Query_Select_FilterQuery;
+        $fq1->setKey('fq1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_FilterQuery;
+        $fq2->setKey('fq2')->setQuery('category:2');
+
+        $filterQueries = array($fq1, $fq2);
+
+        $this->_query->addFilterQueries($filterQueries);
+        $this->_query->removeFilterQuery($fq1);
+        $this->assertEquals(
+            array('fq2' => $fq2),
+            $this->_query->getFilterQueries()
+        );
+    }
+
+    public function testRemoveInvalidFilterQuery()
+    {
+        $fq1 = new Solarium_Query_Select_FilterQuery;
+        $fq1->setKey('fq1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_FilterQuery;
+        $fq2->setKey('fq2')->setQuery('category:2');
+
+        $filterQueries = array('fq1' => $fq1, 'fq2' => $fq2);
+
+        $this->_query->addFilterQueries($filterQueries);
+        $this->_query->removeFilterQuery('fq3'); //continue silently
+        $this->assertEquals(
+            $filterQueries,
+            $this->_query->getFilterQueries()
+        );
+    }
+
+    public function testClearFilterQueries()
+    {
+        $fq1 = new Solarium_Query_Select_FilterQuery;
+        $fq1->setKey('fq1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_FilterQuery;
+        $fq2->setKey('fq2')->setQuery('category:2');
+
+        $filterQueries = array($fq1, $fq2);
+
+        $this->_query->addFilterQueries($filterQueries);
+        $this->_query->clearFilterQueries();
+        $this->assertEquals(
+            array(),
+            $this->_query->getFilterQueries()
+        );
+    }
+
+    public function testSetFilterQueries()
+    {
+        $fq1 = new Solarium_Query_Select_FilterQuery;
+        $fq1->setKey('fq1')->setQuery('category:1');
+
+        $fq2 = new Solarium_Query_Select_FilterQuery;
+        $fq2->setKey('fq2')->setQuery('category:2');
+
+        $filterQueries1 = array('fq1' => $fq1, 'fq2' => $fq2);
+
+        $this->_query->addFilterQueries($filterQueries1);
+
+        $fq3 = new Solarium_Query_Select_FilterQuery;
+        $fq3->setKey('fq3')->setQuery('category:3');
+
+        $fq4 = new Solarium_Query_Select_FilterQuery;
+        $fq4->setKey('fq4')->setQuery('category:4');
+
+        $filterQueries2 = array('fq3' => $fq3, 'fq4' => $fq4);
+
+        $this->_query->setFilterQueries($filterQueries2);
+
+        $this->assertEquals(
+            $filterQueries2,
+            $this->_query->getFilterQueries()
+        );
+    }
+
+    public function testConfigMode()
+    {
+        $config = array(
+            'query'  => 'text:mykeyword',
+            'sort'   => array('score' => 'asc'),
+            'fields' => array('id','title','category'),
+            'rows'   => 100,
+            'start'  => 200,
+            'filterquery' => array(
+                array('key' => 'pub', 'tag' => array('pub'),'query' => 'published:true'),
+                'online' => array('tag' => 'onl','query' => 'online:true')
+            ),
+            'component' => array(
+                'facetset' => array(
+                    'facet' => array(
+                        array('type' => 'field', 'key' => 'categories', 'field' => 'category'),
+                        'category13' => array('type' => 'query', 'query' => 'category:13')
+                    )
+                ),
+            ),
+            'resultclass' => 'MyResultClass',
+            'documentclass' => 'MyDocumentClass',
+        );
+        $query = new Solarium_Query_Select($config);
+
+        $this->assertEquals($config['query'], $query->getQuery());
+        $this->assertEquals($config['sort'], $query->getSorts());
+        $this->assertEquals($config['fields'], $query->getFields());
+        $this->assertEquals($config['rows'], $query->getRows());
+        $this->assertEquals($config['start'], $query->getStart());
+        $this->assertEquals($config['documentclass'], $query->getDocumentClass());
+        $this->assertEquals($config['resultclass'], $query->getResultClass());
+        $this->assertEquals('published:true', $query->getFilterQuery('pub')->getQuery());
+        $this->assertEquals('online:true', $query->getFilterQuery('online')->getQuery());
+
+        $facets = $query->getFacetSet()->getFacets();
+        $this->assertEquals(
+            'category',
+            $facets['categories']->getField()
+        );
+        $this->assertEquals(
+            'category:13',
+            $facets['category13']->getQuery()
+        );
+
+        $components = $query->getComponents();
+        $this->assertEquals(1, count($components));
+        $this->assertThat(array_pop($components), $this->isInstanceOf('Solarium_Query_Select_Component_FacetSet'));
+    }
+
+    public function testSetAndGetComponents()
+    {
+        $mlt = new Solarium_Query_Select_Component_MoreLikeThis;
+        $this->_query->setComponent('mlt',$mlt);
+
+        $this->assertEquals(
+            array('mlt' => $mlt),
+            $this->_query->getComponents()
+        );
+    }
+
+    public function testSetAndGetComponent()
+    {
+        $mlt = new Solarium_Query_Select_Component_MoreLikeThis;
+        $this->_query->setComponent('mlt',$mlt);
+
+        $this->assertEquals(
+            $mlt,
+            $this->_query->getComponent('mlt')
+        );
+    }
+
+    public function testGetInvalidComponent()
+    {
+        $this->assertEquals(
+            null,
+            $this->_query->getComponent('invalid')
+        );
+    }
+
+    public function testGetInvalidComponentAutoload()
+    {
+        $this->setExpectedException('Solarium_Exception');
+        $this->_query->getComponent('invalid', true);
+    }
+
+    public function testRemoveComponent()
+    {
+        $mlt = new Solarium_Query_Select_Component_MoreLikeThis;
+        $this->_query->setComponent('mlt',$mlt);
+
+        $this->assertEquals(
+            array('mlt' => $mlt),
+            $this->_query->getComponents()
+        );
+
+        $this->_query->removeComponent('mlt');
+
+        $this->assertEquals(
+            array(),
+            $this->_query->getComponents()
+        );
+    }
+
+    public function testRemoveComponentWithObjectInput()
+    {
+        $mlt = new Solarium_Query_Select_Component_MoreLikeThis;
+        $this->_query->setComponent('mlt',$mlt);
+
+        $this->assertEquals(
+            array('mlt' => $mlt),
+            $this->_query->getComponents()
+        );
+
+        $this->_query->removeComponent($mlt);
+
+        $this->assertEquals(
+            array(),
+            $this->_query->getComponents()
+        );
+    }
+
+    public function testGetMoreLikeThis()
+    {
+        $mlt = $this->_query->getMoreLikeThis();
+
+        $this->assertEquals(
+            'Solarium_Query_Select_Component_MoreLikeThis',
+            get_class($mlt)
+        );
+    }
+
+    public function testGetDisMax()
+    {
+        $dismax = $this->_query->getDisMax();
+
+        $this->assertEquals(
+            'Solarium_Query_Select_Component_DisMax',
+            get_class($dismax)
+        );
+    }
+
+    public function testGetHighlighting()
+    {
+        $hlt = $this->_query->getHighlighting();
+
+        $this->assertEquals(
+            'Solarium_Query_Select_Component_Highlighting',
+            get_class($hlt)
+        );
+    }
+
+    public function testGetGrouping()
+    {
+        $grouping = $this->_query->getGrouping();
+
+        $this->assertEquals(
+            'Solarium_Query_Select_Component_Grouping',
+            get_class($grouping)
+        );
+    }
+
+    public function testRegisterComponentType()
+    {
+        $components = $this->_query->getComponentTypes();
+        $components['mykey'] = array(
+            'component' => 'mycomponent',
+            'requestbuilder' => 'mybuilder',
+            'responseparser' => 'myparser',
+        );
+
+        $this->_query->registerComponentType('mykey','mycomponent','mybuilder','myparser');
+
+        $this->assertEquals(
+            $components,
+            $this->_query->getComponentTypes()
+        );
+    }
+
+    public function testCreateFilterQuery()
+    {
+        $options = array('optionA' => 1, 'optionB' => 2);
+        $fq = $this->_query->createFilterQuery($options);
+
+        // check class
+       $this->assertThat($fq, $this->isInstanceOf('Solarium_Query_Select_FilterQuery'));
+
+        // check option forwarding
+        $fqOptions = $fq->getOptions();
+        $this->assertEquals(
+            $options['optionB'],
+            $fqOptions['optionB']
+        );
+    }
+
+    public function testGetSpellcheck()
+    {
+        $spellcheck = $this->_query->getSpellcheck();
+
+        $this->assertEquals(
+            'Solarium_Query_Select_Component_Spellcheck',
+            get_class($spellcheck)
+        );
+    }
+
+    public function testGetDistributedSearch()
+    {
+        $spellcheck = $this->_query->getDistributedSearch();
+
+        $this->assertEquals(
+            'Solarium_Query_Select_Component_DistributedSearch',
+            get_class($spellcheck)
+        );
+    }
+
+    public function testGetStats()
+    {
+        $stats = $this->_query->getStats();
+
+        $this->assertEquals(
+            'Solarium_Query_Select_Component_Stats',
+            get_class($stats)
+        );
+    }
+
+    public function testGetDebug()
+    {
+        $stats = $this->_query->getDebug();
+
+        $this->assertEquals(
+            'Solarium_Query_Select_Component_Debug',
+            get_class($stats)
+        );
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/UpdateTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/UpdateTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/UpdateTest.php	(revision 7576)
@@ -0,0 +1,465 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_UpdateTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_query;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Update;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Client::QUERYTYPE_UPDATE, $this->_query->getType());
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'handler'  => 'myHandler',
+            'resultclass' => 'myResult',
+            'command' => array(
+                'key1' => array(
+                    'type' => 'delete',
+                    'query' => 'population:[* TO 1000]',
+                    'id' => array(1,2),
+                ),
+                'key2' => array(
+                    'type' => 'commit',
+                    'waitflush' => true,
+                    'waitsearcher' => false,
+                    'expungedeletes' => true,
+                ),
+                'key3' => array(
+                    'type' => 'optimize',
+                    'waitflush' => true,
+                    'waitsearcher' => false,
+                    'maxsegments' => 5,
+                ),
+                'key4' => array(
+                    'type' => 'rollback',
+                )
+            )
+        );
+        $this->_query->setOptions($options);
+        $commands = $this->_query->getCommands();
+
+        $this->assertEquals(
+            $options['handler'],
+            $this->_query->getHandler()
+        );
+
+        $this->assertEquals(
+            $options['resultclass'],
+            $this->_query->getResultClass()
+        );
+
+        $delete = $commands['key1'];
+        $this->assertEquals(
+            array(1,2),
+            $delete->getIds()
+        );
+        $this->assertEquals(
+            array('population:[* TO 1000]'),
+            $delete->getQueries()
+        );
+
+        $commit = $commands['key2'];
+        $this->assertEquals(
+            true,
+            $commit->getWaitFlush()
+        );
+        $this->assertEquals(
+            false,
+            $commit->getWaitSearcher()
+        );
+        $this->assertEquals(
+            true,
+            $commit->getExpungeDeletes()
+        );
+
+        $optimize = $commands['key3'];
+        $this->assertEquals(
+            true,
+            $optimize->getWaitFlush()
+        );
+        $this->assertEquals(
+            false,
+            $optimize->getWaitSearcher()
+        );
+        $this->assertEquals(
+            5,
+            $optimize->getMaxSegments()
+        );
+
+        $rollback = $commands['key4'];
+        $this->assertEquals(
+            'Solarium_Query_Update_Command_Rollback',
+            get_class($rollback)
+        );
+    }
+
+    public function testConstructorWithConfigAddCommand()
+    {
+        $config = array(
+            'command' => array(
+                'key1' => array(
+                    'type' => 'add',
+                ),
+            )
+        );
+
+        $this->setExpectedException('Solarium_Exception');
+        new Solarium_Query_Update($config);
+    }
+
+    public function testAddWithoutKey()
+    {
+        $command = new Solarium_Query_Update_Command_Rollback;
+        $this->_query->add(null, $command);
+
+        $this->assertEquals(
+            array($command),
+            $this->_query->getCommands()
+        );
+    }
+    
+    public function testAddWithKey()
+    {
+        $rollback = new Solarium_Query_Update_Command_Rollback;
+        $this->_query->add('rb', $rollback);
+
+        $commit = new Solarium_Query_Update_Command_Commit;
+        $this->_query->add('cm', $commit);
+
+        $this->assertEquals(
+            array('rb' => $rollback, 'cm' => $commit),
+            $this->_query->getCommands()
+        );
+    }
+
+    public function testRemove()
+    {
+        $rollback = new Solarium_Query_Update_Command_Rollback;
+        $this->_query->add('rb', $rollback);
+
+        $commit = new Solarium_Query_Update_Command_Commit;
+        $this->_query->add('cm', $commit);
+        
+        $this->_query->remove('rb');
+
+        $this->assertEquals(
+            array('cm' => $commit),
+            $this->_query->getCommands()
+        );
+    }
+
+    public function testRemoveWithObjectInput()
+    {
+        $rollback = new Solarium_Query_Update_Command_Rollback;
+        $this->_query->add('rb', $rollback);
+
+        $commit = new Solarium_Query_Update_Command_Commit;
+        $this->_query->add('cm', $commit);
+
+        $this->_query->remove($rollback);
+
+        $this->assertEquals(
+            array('cm' => $commit),
+            $this->_query->getCommands()
+        );
+    }
+
+    public function testRemoveInvalidKey()
+    {
+        $rollback = new Solarium_Query_Update_Command_Rollback;
+        $this->_query->add('rb', $rollback);
+
+        $commit = new Solarium_Query_Update_Command_Commit;
+        $this->_query->add('cm', $commit);
+
+        $this->_query->remove('invalidkey'); //should silently ignore
+
+        $this->assertEquals(
+            array('rb' => $rollback, 'cm' => $commit),
+            $this->_query->getCommands()
+        );
+    }
+
+    public function testAddRollback()
+    {
+        $this->_query->addRollback();
+        $commands = $this->_query->getCommands();
+
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_ROLLBACK,
+            $commands[0]->getType()
+        );
+    }
+
+    public function testAddDeleteQuery()
+    {
+        $this->_query->addDeleteQuery('*:*');
+        $commands = $this->_query->getCommands();
+
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_DELETE,
+            $commands[0]->getType()
+        );
+
+        $this->assertEquals(
+            array('*:*'),
+            $commands[0]->getQueries()
+        );
+    }
+
+    public function testAddDeleteQueries()
+    {
+        $this->_query->addDeleteQueries(array('id:1','id:2'));
+        $commands = $this->_query->getCommands();
+
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_DELETE,
+            $commands[0]->getType()
+        );
+
+        $this->assertEquals(
+            array('id:1','id:2'),
+            $commands[0]->getQueries()
+        );
+    }
+
+    public function testAddDeleteById()
+    {
+        $this->_query->addDeleteById(1);
+        $commands = $this->_query->getCommands();
+
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_DELETE,
+            $commands[0]->getType()
+        );
+
+        $this->assertEquals(
+            array(1),
+            $commands[0]->getIds()
+        );
+    }
+
+    public function testAddDeleteByIds()
+    {
+        $this->_query->addDeleteByIds(array(1,2));
+        $commands = $this->_query->getCommands();
+
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_DELETE,
+            $commands[0]->getType()
+        );
+
+        $this->assertEquals(
+            array(1,2),
+            $commands[0]->getIds()
+        );
+    }
+
+    public function testAddDocument()
+    {
+        $doc = new Solarium_Document_ReadWrite(array('id' => 1));
+
+        $this->_query->addDocument($doc);
+        $commands = $this->_query->getCommands();
+
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_ADD,
+            $commands[0]->getType()
+        );
+
+        $this->assertEquals(
+            array($doc),
+            $commands[0]->getDocuments()
+        );
+    }
+
+    public function testAddDocuments()
+    {
+        $doc1 = new Solarium_Document_ReadWrite(array('id' => 1));
+        $doc2 = new Solarium_Document_ReadWrite(array('id' => 1));
+
+        $this->_query->addDocuments(array($doc1,$doc2), true, 100);
+        $commands = $this->_query->getCommands();
+
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_ADD,
+            $commands[0]->getType()
+        );
+
+        $this->assertEquals(
+            array($doc1, $doc2),
+            $commands[0]->getDocuments()
+        );
+
+        $this->assertEquals(
+            true,
+            $commands[0]->getOverwrite()
+        );
+
+        $this->assertEquals(
+            100,
+            $commands[0]->getCommitWithin()
+        );
+    }
+
+    public function testAddCommit()
+    {
+        $this->_query->addCommit(true, false, true);
+        $commands = $this->_query->getCommands();
+
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_COMMIT,
+            $commands[0]->getType()
+        );
+
+        $this->assertEquals(
+            true,
+            $commands[0]->getWaitFlush()
+        );
+
+        $this->assertEquals(
+            false,
+            $commands[0]->getWaitSearcher()
+        );
+
+        $this->assertEquals(
+            true,
+            $commands[0]->getExpungeDeletes()
+        );
+    }
+
+    public function testAddOptimize()
+    {
+        $this->_query->addOptimize(true, false, 10);
+        $commands = $this->_query->getCommands();
+
+        $this->assertEquals(
+            Solarium_Query_Update::COMMAND_OPTIMIZE,
+            Solarium_Query_Update::COMMAND_OPTIMIZE,
+            $commands[0]->getType()
+        );
+
+        $this->assertEquals(
+            true,
+            $commands[0]->getWaitFlush()
+        );
+
+        $this->assertEquals(
+            false,
+            $commands[0]->getWaitSearcher()
+        );
+
+        $this->assertEquals(
+            10,
+            $commands[0]->getMaxSegments()
+        );
+    }
+
+    public function testCreateCommand()
+    {
+        $type = Solarium_Query_Update::COMMAND_ROLLBACK;
+        $options = array('optionA' => 1, 'optionB' => 2);
+        $command = $this->_query->createCommand($type, $options);
+
+        // check command type
+        $this->assertEquals(
+            $type,
+            $command->getType()
+        );
+
+        // check option forwarding
+        $commandOptions = $command->getOptions();
+        $this->assertEquals(
+            $options['optionB'],
+            $commandOptions['optionB']
+        );
+    }
+
+    public function testCreateCommandWithInvalidQueryType()
+    {
+        $this->setExpectedException('Solarium_Exception');
+        $this->_query->createCommand('invalidtype');
+    }
+
+    public function testSetAndGetDocumentClass()
+    {
+        $this->_query->setDocumentClass('MyDocument');
+        $this->assertEquals('MyDocument', $this->_query->getDocumentClass());
+    }
+
+    public function testCreateDocument()
+    {
+        $doc = $this->_query->createDocument();
+        $this->assertThat($doc, $this->isInstanceOf($this->_query->getDocumentClass()));
+    }
+
+    public function testCreateDocumentWithCustomClass()
+    {
+        $this->_query->setDocumentClass('MyCustomDoc');
+
+        $doc = $this->_query->createDocument();
+        $this->assertThat($doc, $this->isInstanceOf('MyCustomDoc'));
+    }
+
+    public function testCreateDocumentWithFieldsAndBoosts()
+    {
+        $fields = array('id' => 1, 'name' => 'testname');
+        $boosts = array('name' => 2.7);
+
+        $doc = $this->_query->createDocument($fields, $boosts);
+
+        $this->assertThat($doc, $this->isInstanceOf($this->_query->getDocumentClass()));
+
+        $this->assertEquals(
+            $fields,
+            $doc->getFields()
+        );
+
+        $this->assertEquals(
+            2.7,
+            $doc->getFieldBoost('name')
+        );
+    }
+
+}
+
+class MyCustomDoc extends Solarium_Document_ReadWrite{
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/AnalysisTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/AnalysisTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/AnalysisTest.php	(revision 7576)
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_AnalysisTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_query;
+
+    public function setUp()
+    {
+        $this->_query = new TestAnalysisQuery;
+    }
+
+    public function testSetAndGetQuery()
+    {
+        $querystring = 'test query values';
+
+        $this->_query->setQuery($querystring);
+        $this->assertEquals($querystring, $this->_query->getQuery());
+    }
+
+    public function testSetAndGetQueryWithBind()
+    {
+        $this->_query->setQuery('id:%1%', array(678));
+        $this->assertEquals('id:678', $this->_query->getQuery());
+    }
+
+    public function testSetAndGetShowMatch()
+    {
+        $show = true;
+
+        $this->_query->setShowMatch($show);
+        $this->assertEquals($show, $this->_query->getShowMatch());
+    }
+}
+
+class TestAnalysisQuery extends Solarium_Query_Analysis{
+
+    public function getType()
+    {
+        
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/SuggesterTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/SuggesterTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Query/SuggesterTest.php	(revision 7576)
@@ -0,0 +1,105 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Query_SuggesterTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Suggester
+     */
+    protected $_query;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Suggester;
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals(Solarium_Client::QUERYTYPE_SUGGESTER, $this->_query->getType());
+    }
+
+    public function testSetAndGetQuery()
+    {
+        $value = 'testquery';
+        $this->_query->setQuery($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getQuery()
+        );
+    }
+
+    public function testSetAndGetDictionary()
+    {
+        $value = 'myDictionary';
+        $this->_query->setDictionary($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getDictionary()
+        );
+    }
+
+    public function testSetAndGetCount()
+    {
+        $value = 11;
+        $this->_query->setCount($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getCount()
+        );
+    }
+
+    public function testSetAndGetOnlyMorePopular()
+    {
+        $value = false;
+        $this->_query->setOnlyMorePopular($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getOnlyMorePopular()
+        );
+    }
+
+    public function testSetAndGetCollate()
+    {
+        $value = false;
+        $this->_query->setCollate($value);
+
+        $this->assertEquals(
+            $value,
+            $this->_query->getCollate()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/ConfigurableTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/ConfigurableTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/ConfigurableTest.php	(revision 7576)
@@ -0,0 +1,151 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_ConfigurableTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testConstructorNoConfig()
+    {
+        $configTest = new ConfigTest;
+        $defaultOptions = array(
+            'option1' => 1,
+            'option2' => 'value 2',
+        );
+
+        $this->assertEquals($configTest->getOptions(), $defaultOptions);
+    }
+
+    public function testConstructorWithObject()
+    {
+        $configTest = new ConfigTest(new myConfigObject);
+
+        // the default options should be merged with the constructor values,
+        // overwriting any default values.
+        $expectedOptions = array(
+            'option1' => 1,
+            'option2' => 'newvalue2',
+            'option3' => 3,
+        );
+
+        $this->assertEquals($expectedOptions, $configTest->getOptions());
+    }
+
+    public function testConstructorWithArrayConfig()
+    {
+        $configTest = new ConfigTest(
+            array('option2' => 'newvalue2', 'option3' => 3)
+        );
+
+        // the default options should be merged with the constructor values,
+        // overwriting any default values.
+        $expectedOptions = array(
+            'option1' => 1,
+            'option2' => 'newvalue2',
+            'option3' => 3,
+        );
+
+        $this->assertEquals($expectedOptions, $configTest->getOptions());
+    }
+    
+    public function testConstructorWithInvalidConfig()
+    {
+        $this->setExpectedException('Solarium_Exception');
+        new Solarium_Client('invalid');
+    }
+
+    public function testGetOption()
+    {
+        $configTest = new ConfigTest;
+        $this->assertEquals(1, $configTest->getOption('option1'));
+    }
+
+    public function testGetOptionWIthInvalidName()
+    {
+        $configTest = new ConfigTest();
+        $this->assertEquals(null, $configTest->getOption('invalidoptionname'));
+    }
+
+    public function testInitialisation()
+    {
+        $this->setExpectedException('Solarium_Exception');
+        new ConfigTestInit;
+    }
+
+    public function testSetOptions()
+    {
+        $configTest = new ConfigTest();
+        $configTest->setOptions(array('option2' => 2, 'option3' => 3));
+
+        $this->assertEquals(
+            array('option1' => 1, 'option2' => 2, 'option3' => 3),
+            $configTest->getOptions()
+        );
+    }
+
+    public function testSetOptionsWithOverride()
+    {
+        $configTest = new ConfigTest();
+        $configTest->setOptions(array('option2' => 2, 'option3' => 3), true);
+
+        $this->assertEquals(
+            array('option2' => 2, 'option3' => 3),
+            $configTest->getOptions()
+        );
+    }
+}
+
+class ConfigTest extends Solarium_Configurable
+{
+
+    protected $_options = array(
+        'option1' => 1,
+        'option2' => 'value 2',
+    );
+
+}
+
+class ConfigTestInit extends ConfigTest
+{
+
+    protected function _init()
+    {
+        throw new Solarium_Exception('test init');
+    }
+
+}
+
+class myConfigObject
+{
+    public function toArray()
+    {
+        return array('option2' => 'newvalue2', 'option3' => 3);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/QueryTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/QueryTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/QueryTest.php	(revision 7576)
@@ -0,0 +1,82 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_QueryTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testSetAndGetHandler()
+    {
+        $query = new TestQuery;
+        $query->setHandler('myhandler');
+        $this->assertEquals('myhandler', $query->getHandler());
+    }
+
+    public function testSetAndGetResultClass()
+    {
+        $query = new TestQuery;
+        $query->setResultClass('myResultClass');
+        $this->assertEquals('myResultClass', $query->getResultClass());
+    }
+
+    public function testGetHelper()
+    {
+        $query = new TestQuery;
+        $helper = $query->getHelper();
+
+        $this->assertEquals(
+            'Solarium_Query_Helper',
+            get_class($helper)
+        );
+    }
+
+    public function testAddAndGetParams()
+    {
+        $query = new TestQuery;
+        $query->addParam('p1','v1');
+        $query->addParam('p2','v2');
+        $query->addParam('p2','v3'); //should overwrite previous value
+
+        $this->assertEquals(
+            array('p1' => 'v1', 'p2' => 'v3'),
+            $query->getParams()
+        );
+    }
+
+}
+
+class TestQuery extends Solarium_Query
+{
+
+    public function getType()
+    {
+        return 'testType';
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/VersionTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/VersionTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/VersionTest.php	(revision 7576)
@@ -0,0 +1,99 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_VersionTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testVersion()
+    {
+        $version = Solarium_Version::VERSION;
+        $this->assertNotNull($version);
+    }
+
+    public function testCheckExact()
+    {
+        $this->assertTrue(
+            Solarium_Version::checkExact(Solarium_Version::VERSION)
+        );
+    }
+
+    public function testCheckExactPartial()
+    {
+        $this->assertTrue(
+            Solarium_Version::checkExact(substr(Solarium_Version::VERSION,0,1))
+        );
+    }
+
+    public function testCheckExactLower()
+    {
+        $this->assertFalse(
+            Solarium_Version::checkExact('0.1')
+        );
+    }
+
+    public function testCheckExactHigher()
+    {
+        $this->assertFalse(
+            Solarium_Version::checkExact('99.0')
+        );
+    }
+
+    public function testCheckMinimal()
+    {
+        $this->assertTrue(
+            Solarium_Version::checkMinimal(Solarium_Version::VERSION)
+        );
+    }
+
+    public function testCheckMinimalPartial()
+    {
+        $version = substr(Solarium_Version::VERSION,0,1);
+        
+        $this->assertTrue(
+            Solarium_Version::checkMinimal($version)
+        );
+    }
+
+    public function testCheckMinimalLower()
+    {
+        $this->assertTrue(
+            Solarium_Version::checkMinimal('0.1.0')
+        );
+    }
+
+    public function testCheckMinimalHigher()
+    {
+        $this->assertFalse(
+            Solarium_Version::checkMinimal('99.0')
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/GroupingTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/GroupingTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/GroupingTest.php	(revision 7576)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_Select_Component_GroupingTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testBuildComponent()
+    {
+        $builder = new Solarium_Client_RequestBuilder_Select_Component_Grouping;
+        $request = new Solarium_Client_Request();
+
+        $component = new Solarium_Query_Select_Component_Grouping();
+        $component->setFields(array('fieldA','fieldB'));
+        $component->setQueries(array('cat:1','cat:2'));
+        $component->setLimit(12);
+        $component->setOffset(2);
+        $component->setSort('score desc');
+        $component->setMainResult(true);
+        $component->setNumberOfGroups(false);
+        $component->setCachePercentage(50);
+        $component->setTruncate(true);
+
+        $request = $builder->buildComponent($component, $request);
+
+        $this->assertEquals(
+            array(
+                'group' => 'true',
+                'group.field' => array('fieldA','fieldB'),
+                'group.query' => array('cat:1','cat:2'),
+                'group.limit' => 12,
+                'group.offset' => 2,
+                'group.sort' => 'score desc',
+                'group.main' => 'true',
+                'group.ngroups' => 'false',
+                'group.cache.percent' => 50,
+                'group.truncate' => 'true',
+            ),
+            $request->getParams()
+        );
+
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/SpellcheckTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/SpellcheckTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/SpellcheckTest.php	(revision 7576)
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_Select_Component_SpellcheckTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testBuildComponent()
+    {
+        $builder = new Solarium_Client_RequestBuilder_Select_Component_Spellcheck();
+        $request = new Solarium_Client_Request();
+
+        $component = new Solarium_Query_Select_Component_Spellcheck();
+        $component->setQuery('testquery');
+        $component->setBuild(false);
+        $component->setReload(true);
+        $component->setDictionary('testdict');
+        $component->setCount(3);
+        $component->setOnlyMorePopular(false);
+        $component->setExtendedResults(true);
+        $component->setCollate(true);
+        $component->setMaxCollations(2);
+        $component->setMaxCollationTries(4);
+        $component->setMaxCollationEvaluations(4);
+        $component->setCollateExtendedResults(true);
+        $component->setAccuracy(.2);
+
+        $request = $builder->buildComponent($component, $request);
+
+        $this->assertEquals(
+            array(
+                'spellcheck' => 'true',
+                'spellcheck.q' => 'testquery',
+                'spellcheck.build' => 'false',
+                'spellcheck.reload' => 'true',
+                'spellcheck.dictionary' => 'testdict',
+                'spellcheck.count' => 3,
+                'spellcheck.onlyMorePopular' => 'false',
+                'spellcheck.extendedResults' => 'true',
+                'spellcheck.collate' => 'true',
+                'spellcheck.maxCollations' => 2,
+                'spellcheck.maxCollationTries' => 4,
+                'spellcheck.maxCollationEvaluations' => 4,
+                'spellcheck.collateExtendedResults' => 'true',
+                'spellcheck.accuracy' => .2,
+            ),
+            $request->getParams()
+        );
+
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/FacetSetTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/FacetSetTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/FacetSetTest.php	(revision 7576)
@@ -0,0 +1,176 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_Select_Component_FacetSetTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Client_RequestBuilder_Select_Component_FacetSet
+     */
+    protected $_builder;
+
+    /**
+     * @var Solarium_Client_Request
+     */
+    protected $_request;
+
+    /**
+     * @var Solarium_Query_Select_Component_FacetSet();
+     */
+    protected $_component;
+
+
+    public function setUp()
+    {
+        $this->_builder = new Solarium_Client_RequestBuilder_Select_Component_FacetSet;
+        $this->_request = new Solarium_Client_Request();
+        $this->_component = new Solarium_Query_Select_Component_FacetSet();
+    }
+
+    public function testBuildEmptyFacetSet()
+    {
+        $request = $this->_builder->buildComponent($this->_component, $this->_request);
+
+        $this->assertEquals(
+            array(),
+            $request->getParams()
+        );
+
+    }
+
+    public function testBuildWithFacets()
+    {
+        $this->_component->addFacet(new Solarium_Query_Select_Component_Facet_Field(array('key' => 'f1', 'field' => 'owner')));
+        $this->_component->addFacet(new Solarium_Query_Select_Component_Facet_Query(array('key' => 'f2', 'query' => 'category:23')));
+        $this->_component->addFacet(new Solarium_Query_Select_Component_Facet_MultiQuery(array('key' => 'f3', 'query' => array('f4' => array('query' => 'category:40')))));
+        $request = $this->_builder->buildComponent($this->_component, $this->_request);
+
+        $this->assertEquals(
+            null,
+            $request->getRawData()
+        );
+
+        $this->assertEquals(
+            '?facet=true&facet.field={!key=f1}owner&facet.query={!key=f2}category:23&facet.query={!key=f4}category:40',
+            urldecode($request->getUri())
+        );
+    }
+
+    public function testBuildWithRangeFacet()
+    {
+        $this->_component->addFacet(new Solarium_Query_Select_Component_Facet_Range(
+            array(
+                'key' => 'f1',
+                'field' => 'price',
+                'start' => '1',
+                'end' => 100,
+                'gap' => 10,
+                'other' => 'all',
+                'include' => 'outer'
+            )
+        ));
+
+        $request = $this->_builder->buildComponent($this->_component, $this->_request);
+
+        $this->assertEquals(
+            null,
+            $request->getRawData()
+        );
+
+        $this->assertEquals(
+            '?facet=true&facet.range={!key=f1}price&f.price.facet.range.start=1&f.price.facet.range.end=100&f.price.facet.range.gap=10&f.price.facet.range.other=all&f.price.facet.range.include=outer',
+            urldecode($request->getUri())
+        );
+    }
+
+    public function testBuildWithRangeFacetExcludingOptionalParams()
+    {
+        $this->_component->addFacet(new Solarium_Query_Select_Component_Facet_Range(
+            array(
+                'key' => 'f1',
+                'field' => 'price',
+                'start' => '1',
+                'end' => 100,
+                'gap' => 10,
+            )
+        ));
+
+        $request = $this->_builder->buildComponent($this->_component, $this->_request);
+
+        $this->assertEquals(
+            null,
+            $request->getRawData()
+        );
+
+        $this->assertEquals(
+            '?facet=true&facet.range={!key=f1}price&f.price.facet.range.start=1&f.price.facet.range.end=100&f.price.facet.range.gap=10',
+            urldecode($request->getUri())
+        );
+    }
+
+    public function testBuildWithFacetsAndGlobalFacetSettings()
+    {
+        $this->_component->setMissing(true);
+        $this->_component->setLimit(10);
+        $this->_component->addFacet(new Solarium_Query_Select_Component_Facet_Field(array('key' => 'f1', 'field' => 'owner')));
+        $this->_component->addFacet(new Solarium_Query_Select_Component_Facet_Query(array('key' => 'f2', 'query' => 'category:23')));
+        $this->_component->addFacet(new Solarium_Query_Select_Component_Facet_MultiQuery(array('key' => 'f3', 'query' => array('f4' =>array('query' => 'category:40')))));
+        $request = $this->_builder->buildComponent($this->_component, $this->_request);
+
+        $this->assertEquals(
+            null,
+            $request->getRawData()
+        );
+
+        $this->assertEquals(
+            '?facet=true&facet.missing=true&facet.limit=10&facet.field={!key=f1}owner&facet.query={!key=f2}category:23&facet.query={!key=f4}category:40',
+            urldecode($request->getUri())
+        );
+    }
+
+    public function testBuildUnknownFacetType()
+    {
+        $this->_component->addFacet(new UnknownFacet(array('key' => 'f1', 'field' => 'owner')));
+        $this->setExpectedException('Solarium_Exception');
+        $request = $this->_builder->buildComponent($this->_component, $this->_request);
+        $request->getUri();
+    }
+
+}
+
+class UnknownFacet extends Solarium_Query_Select_Component_Facet_Field{
+
+    public function getType()
+    {
+        return 'unknown';
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/StatsTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/StatsTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/StatsTest.php	(revision 7576)
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_Select_Component_StatsTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testBuildComponent()
+    {
+        $builder = new Solarium_Client_RequestBuilder_Select_Component_Stats();
+        $request = new Solarium_Client_Request();
+
+        $component = new Solarium_Query_Select_Component_Stats();
+        $component->createField('fieldA')->addFacet('fieldFacetA');
+        $component->createField('fieldB');
+        $component->addFacets(array('facetA', 'facetB'));
+
+        $request = $builder->buildComponent($component, $request);
+
+        $this->assertEquals(
+            array(
+                'stats' => 'true',
+                'stats.facet' => array(
+                    'facetA',
+                    'facetB',
+                ),
+                'stats.field' => array(
+                    'fieldA',
+                    'fieldB',
+                ),
+                'f.fieldA.stats.facet' => 'fieldFacetA',
+            ),
+            $request->getParams()
+        );
+
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/MoreLikeThisTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/MoreLikeThisTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/MoreLikeThisTest.php	(revision 7576)
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_Select_Component_MoreLikeThisTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testBuildComponent()
+    {
+        $builder = new Solarium_Client_RequestBuilder_Select_Component_MoreLikeThis;
+        $request = new Solarium_Client_Request();
+
+        $component = new Solarium_Query_Select_Component_MoreLikeThis();
+        $component->setFields('description,name');
+        $component->setMinimumTermFrequency(1);
+        $component->setMinimumDocumentFrequency(3);
+        $component->setMinimumWordLength(2);
+        $component->setMaximumWordLength(15);
+        $component->setMaximumQueryTerms(4);
+        $component->setMaximumNumberOfTokens(5);
+        $component->setBoost(true);
+        $component->setQueryFields('description');
+        $component->setCount(6);
+
+        $request = $builder->buildComponent($component, $request);
+
+        $this->assertEquals(
+            array(
+                'mlt' => 'true',
+                'mlt.fl' => 'description,name',
+                'mlt.mintf' => 1,
+                'mlt.mindf' => 3,
+                'mlt.minwl' => 2,
+                'mlt.maxwl' => 15,
+                'mlt.maxqt' => 4,
+                'mlt.maxntp' => 5,
+                'mlt.boost' => 'true',
+                'mlt.qf' => 'description',
+                'mlt.count' => 6,
+            ),
+            $request->getParams()
+        );
+
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/DisMaxTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/DisMaxTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/DisMaxTest.php	(revision 7576)
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_Select_Component_DisMaxTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testBuildComponent()
+    {
+        $builder = new Solarium_Client_RequestBuilder_Select_Component_DisMax;
+        $request = new Solarium_Client_Request();
+
+        $component = new Solarium_Query_Select_Component_DisMax();
+        $component->setQueryParser('dummyparser');
+        $component->setQueryAlternative('test');
+        $component->setQueryFields('content,name');
+        $component->setMinimumMatch('75%');
+        $component->setPhraseFields('content,description');
+        $component->setPhraseSlop(1);
+        $component->setQueryPhraseSlop(2);
+        $component->setTie(0.5);
+        $component->setBoostQuery('cat:1');
+        $component->setBoostFunctions('functionX(price)');
+
+        $request = $builder->buildComponent($component, $request);
+
+        $this->assertEquals(
+            array(
+                'defType' => 'dummyparser',
+                'q.alt' => 'test',
+                'qf' => 'content,name',
+                'mm' => '75%',
+                'pf' => 'content,description',
+                'ps' => 1,
+                'qs' => 2,
+                'tie' => 0.5,
+                'bq' => 'cat:1',
+                'bf' => 'functionX(price)',
+            ),
+            $request->getParams()
+        );
+
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/HighlightingTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/HighlightingTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/HighlightingTest.php	(revision 7576)
@@ -0,0 +1,117 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_Select_Component_HighlightingTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testBuildComponent()
+    {
+        $builder = new Solarium_Client_RequestBuilder_Select_Component_Highlighting;
+        $request = new Solarium_Client_Request();
+
+        $component = new Solarium_Query_Select_Component_Highlighting();
+        $component->addField('fieldA');
+
+        $field = $component->getField('fieldB');
+        $field->setSnippets(3);
+        $field->setFragSize(25);
+        $field->setMergeContiguous(true);
+        $field->setAlternateField('text');
+        $field->setFormatter('myFormatter');
+        $field->setSimplePrefix('<b>');
+        $field->setSimplePostfix('</b>');
+        $field->setFragmenter('myFragmenter');
+        $field->setUseFastVectorHighlighter(true);
+
+        $component->setSnippets(2);
+        $component->setFragSize(3);
+        $component->setMergeContiguous(true);
+        $component->setRequireFieldMatch(false);
+        $component->setMaxAnalyzedChars(4);
+        $component->setAlternateField('fieldC');
+        $component->setMaxAlternateFieldLength(5);
+        $component->setFormatter('simple');
+        $component->setSimplePrefix('<b>');
+        $component->setSimplePostfix('</b>');
+        $component->setFragmenter('myFragmenter');
+        $component->setFragListBuilder('myFragListBuilder');
+        $component->setFragmentsBuilder('myFragmentsBuilder');
+        $component->setUsePhraseHighlighter(true);
+        $component->setUseFastVectorHighlighter(false);
+        $component->setHighlightMultiTerm(true);
+        $component->setRegexSlop(1.3);
+        $component->setRegexPattern('mypattern');
+        $component->setMaxAnalyzedChars(100);
+        $component->setQuery('text:myvalue');
+        $component->setPhraseLimit(40);
+
+        $request = $builder->buildComponent($component, $request);
+
+        $this->assertEquals(
+            array(
+                'hl' => 'true',
+                'hl.fl' => 'fieldA,fieldB',
+                'hl.snippets' => 2,
+                'hl.fragsize' => 3,
+                'hl.mergeContiguous' => 'true',
+                'hl.requireFieldMatch' => 'false',
+                'hl.maxAnalyzedChars' => 100,
+                'hl.alternateField' => 'fieldC',
+                'hl.maxAlternateFieldLength' => 5,
+                'hl.formatter' => 'simple',
+                'hl.simple.pre' => '<b>',
+                'hl.simple.post' => '</b>',
+                'hl.fragmenter' => 'myFragmenter',
+                'hl.fragListBuilder' => 'myFragListBuilder',
+                'hl.fragmentsBuilder' => 'myFragmentsBuilder',
+                'hl.useFastVectorHighlighter' => 'false',
+                'hl.usePhraseHighlighter' => 'true',
+                'hl.highlightMultiTerm' => 'true',
+                'hl.regex.slop' => 1.3,
+                'hl.regex.pattern' => 'mypattern',
+                'hl.q' => 'text:myvalue',
+                'hl.phraseLimit' => 40,
+                'f.fieldB.hl.snippets' => 3,
+                'f.fieldB.hl.fragsize' => 25,
+                'f.fieldB.hl.mergeContiguous' => 'true',
+                'f.fieldB.hl.alternateField' => 'text',
+                'f.fieldB.hl.formatter' => 'myFormatter',
+                'f.fieldB.hl.simple.pre' => '<b>',
+                'f.fieldB.hl.simple.post' => '</b>',
+                'f.fieldB.hl.fragmenter' => 'myFragmenter',
+                'f.fieldB.hl.useFastVectorHighlighter' => 'true',
+            ),
+            $request->getParams()
+        );
+
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/DebugTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/DebugTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/DebugTest.php	(revision 7576)
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_Select_Component_DebugTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testBuildComponent()
+    {
+        $builder = new Solarium_Client_RequestBuilder_Select_Component_Debug();
+        $request = new Solarium_Client_Request();
+
+        $component = new Solarium_Query_Select_Component_Debug();
+        $component->setExplainOther('id:45');
+
+        $request = $builder->buildComponent($component, $request);
+
+        $this->assertEquals(
+            array(
+                'debugQuery' => 'true',
+                'debug.explain.structured' => 'true',
+                'explainOther' => 'id:45',
+            ),
+            $request->getParams()
+        );
+
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/DistributedSearchTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/DistributedSearchTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Select/Component/DistributedSearchTest.php	(revision 7576)
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_Select_Component_DistributedSearchTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testBuildComponent()
+    {
+        $builder = new Solarium_Client_RequestBuilder_Select_Component_DistributedSearch;
+        $request = new Solarium_Client_Request();
+
+        $component = new Solarium_Query_Select_Component_DistributedSearch();
+        $component->addShard('shard1', 'localhost:8983/solr/shard1');
+        $component->addShards(array(
+            'shard2' => 'localhost:8983/solr/shard2',
+            'shard3' => 'localhost:8983/solr/shard3'
+        ));
+        $component->setShardRequestHandler('dummy');
+
+        $request = $builder->buildComponent($component, $request);
+
+        $this->assertEquals(
+            array(
+                'shards.qt' => 'dummy',
+                'shards' => 'localhost:8983/solr/shard1,localhost:8983/solr/shard2,localhost:8983/solr/shard3',
+            ),
+            $request->getParams()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/TermsTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/TermsTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/TermsTest.php	(revision 7576)
@@ -0,0 +1,102 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_TermsTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Terms
+     */
+    protected $_query;
+
+    /**
+     * @var Solarium_Client_RequestBuilder_Terms
+     */
+    protected $_builder;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Terms;
+        $this->_builder = new Solarium_Client_RequestBuilder_Terms;
+    }
+
+    public function testBuildParams()
+    {
+        $this->_query->setFields('fieldA, fieldB');
+        $this->_query->setLowerbound('d');
+        $this->_query->setLowerboundInclude(true);
+        $this->_query->setMinCount(3);
+        $this->_query->setMaxCount(100);
+        $this->_query->setPrefix('de');
+        $this->_query->setRegex('det.*');
+        $this->_query->setRegexFlags('case_insensitive,comments');
+        $this->_query->setLimit(50);
+        $this->_query->setUpperbound('x');
+        $this->_query->setUpperboundInclude(false);
+        $this->_query->setRaw(false);
+        $this->_query->setSort('index');
+
+        $request = $this->_builder->build($this->_query);
+
+        $this->assertEquals(
+            array(
+                'terms' => 'true',
+                'terms.fl' => array(
+                    'fieldA',
+                    'fieldB',
+                ),
+                'terms.limit' => 50,
+                'terms.lower' => 'd',
+                'terms.lower.incl' => 'true',
+                'terms.maxcount' => 100,
+                'terms.mincount' => 3,
+                'terms.prefix' => 'de',
+                'terms.raw' => 'false',
+                'terms.regex' => 'det.*',
+                'terms.regex.flag' => array(
+                    'case_insensitive',
+                    'comments',
+                ),
+                'terms.sort' => 'index',
+                'terms.upper' => 'x',
+                'terms.upper.incl' => 'false',
+                'wt' => 'json',
+            ),
+            $request->getParams()
+        );
+
+        $this->assertEquals(
+            Solarium_Client_Request::METHOD_GET,
+            $request->getMethod()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Analysis/DocumentTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Analysis/DocumentTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Analysis/DocumentTest.php	(revision 7576)
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_Analysis_DocumentTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Analysis_Document
+     */
+    protected $_query;
+
+    /**
+     * @var Solarium_Client_RequestBuilder_Analysis_Document
+     */
+    protected $_builder;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Analysis_Document();
+        $this->_builder = new Solarium_Client_RequestBuilder_Analysis_Document;
+    }
+
+    public function testBuild()
+    {
+        $request = $this->_builder->build($this->_query);
+
+        $this->assertEquals(Solarium_Client_Request::METHOD_POST, $request->getMethod());
+        $this->assertEquals($this->_builder->getRawData($this->_query), $request->getRawData());
+    }
+
+    public function testGetRawData()
+    {
+        // this doc tests data escaping
+        $doc1 = new Solarium_Document_ReadWrite(array('id' => 1, 'name' => 'doc1', 'cat' => 'my > cat'));
+
+        // this doc tests a multivalue field
+        $doc2 = new Solarium_Document_ReadWrite(array('id' => 2, 'name' => 'doc2', 'cat' => array(1,2,3)));
+
+        $this->_query->addDocuments(array($doc1, $doc2));
+
+        $this->assertEquals(
+            '<docs><doc><field name="id">1</field><field name="name">doc1</field><field name="cat">my &gt; cat</field></doc><doc><field name="id">2</field><field name="name">doc2</field><field name="cat">1</field><field name="cat">2</field><field name="cat">3</field></doc></docs>',
+            $this->_builder->getRawData($this->_query)
+        );
+    }
+
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Analysis/FieldTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Analysis/FieldTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/Analysis/FieldTest.php	(revision 7576)
@@ -0,0 +1,69 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_Analysis_FieldTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Analysis_Field
+     */
+    protected $_query;
+
+    /**
+     * @var Solarium_Client_RequestBuilder_Analysis_Field
+     */
+    protected $_builder;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Analysis_Field();
+        $this->_builder = new Solarium_Client_RequestBuilder_Analysis_Field;
+    }
+
+    public function testBuild()
+    {
+        $fieldValue = 'myvalue';
+        $fieldName = 'myfield';
+        $fieldType = 'text';
+        
+        $this->_query->setFieldValue($fieldValue)
+                     ->setFieldName($fieldName)
+                     ->setFieldType($fieldType);
+        
+        $request = $this->_builder->build($this->_query);
+
+        $this->assertEquals($fieldValue, $request->getParam('analysis.fieldvalue'));
+        $this->assertEquals($fieldName, $request->getParam('analysis.fieldname'));
+        $this->assertEquals($fieldType, $request->getParam('analysis.fieldtype'));
+    }
+
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/PingTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/PingTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/PingTest.php	(revision 7576)
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_PingTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testBuild()
+    {
+        $builder = new Solarium_Client_RequestBuilder_Ping;
+        $request = $builder->build(new Solarium_Query_Ping);
+
+        $this->assertEquals(
+            'admin/ping?wt=json',
+            $request->getUri()
+        );
+
+        $this->assertEquals(
+            Solarium_Client_Request::METHOD_GET,
+            $request->getMethod()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/MoreLikeThisTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/MoreLikeThisTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/MoreLikeThisTest.php	(revision 7576)
@@ -0,0 +1,111 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_MoreLikeThisTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_MoreLikeThis
+     */
+    protected $_query;
+
+    /**
+     * @var Solarium_Client_RequestBuilder_MoreLikeThis
+     */
+    protected $_builder;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_MoreLikeThis;
+        $this->_builder = new Solarium_Client_RequestBuilder_MoreLikeThis;
+    }
+
+    public function testBuildParams()
+    {
+        $this->_query->setInterestingTerms('test');
+        $this->_query->setMatchInclude(true);
+        $this->_query->setStart(12);
+        $this->_query->setMltFields('description,name');
+        $this->_query->setMinimumTermFrequency(1);
+        $this->_query->setMinimumDocumentFrequency(3);
+        $this->_query->setMinimumWordLength(2);
+        $this->_query->setMaximumWordLength(15);
+        $this->_query->setMaximumQueryTerms(4);
+        $this->_query->setMaximumNumberOfTokens(5);
+        $this->_query->setBoost(true);
+        $this->_query->setQueryFields('description');
+
+        $request = $this->_builder->build($this->_query);
+
+        $this->assertEquals(
+            array(
+                'mlt.interestingTerms' => 'test',
+                'mlt.match.include' => 'true',
+                'mlt.match.offset' => 12,
+                'mlt.fl' => 'description,name',
+                'mlt.mintf' => 1,
+                'mlt.mindf' => 3,
+                'mlt.minwl' => 2,
+                'mlt.maxwl' => 15,
+                'mlt.maxqt' => 4,
+                'mlt.maxntp' => 5,
+                'mlt.boost' => 'true',
+                'mlt.qf' => 'description',
+                'q' => '*:*',
+                'fl' => '*,score',
+                'rows' => 10,
+                'start' => 12,
+                'wt' => 'json'
+            ),
+            $request->getParams()
+        );
+
+        $this->assertEquals(
+            Solarium_Client_Request::METHOD_GET,
+            $request->getMethod()
+        );
+    }
+
+    public function testBuildWithQueryStream()
+    {
+        $content = 'test content';
+
+        $this->_query->setQuery($content);
+        $this->_query->setQueryStream(true);
+
+        $request = $this->_builder->build($this->_query);
+
+        $this->assertEquals(Solarium_Client_Request::METHOD_POST,$request->getMethod());
+        $this->assertEquals(null,$request->getParam('q'));
+        $this->assertEquals($content,$request->getRawData());
+        $this->assertTrue(in_array('Content-Type: text/plain; charset=utf-8', $request->getHeaders()));
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/SelectTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/SelectTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/SelectTest.php	(revision 7576)
@@ -0,0 +1,162 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_SelectTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Select
+     */
+    protected $_query;
+
+    /**
+     * @var Solarium_Client_RequestBuilder_Select
+     */
+    protected $_builder;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Select;
+        $this->_builder = new Solarium_Client_RequestBuilder_Select;
+    }
+
+    public function testGetMethod()
+    {
+        $request = $this->_builder->build($this->_query);
+        $this->assertEquals(
+            Solarium_Client_Request::METHOD_GET,
+            $request->getMethod()
+        );
+    }
+
+    public function testSelectUrlWithDefaultValues()
+    {
+        $request = $this->_builder->build($this->_query);
+
+        $this->assertEquals(
+            null,
+            $request->getRawData()
+        );
+
+        $this->assertEquals(
+            'select?wt=json&q=*:*&start=0&rows=10&fl=*,score',
+            urldecode($request->getUri())
+        );
+    }
+
+    public function testSelectUrlWithSort()
+    {
+        $this->_query->addSort('id', Solarium_Query_Select::SORT_ASC);
+        $this->_query->addSort('name', Solarium_Query_Select::SORT_DESC);
+        $request = $this->_builder->build($this->_query);
+
+        $this->assertEquals(
+            null,
+            $request->getRawData()
+        );
+
+        $this->assertEquals(
+            'select?wt=json&q=*:*&start=0&rows=10&fl=*,score&sort=id asc,name desc',
+            urldecode($request->getUri())
+        );
+    }
+
+    public function testSelectUrlWithQueryDefaultFieldAndOperator()
+    {
+        $this->_query->setQueryDefaultField('mydefault');
+        $this->_query->setQueryDefaultOperator(Solarium_Query_Select::QUERY_OPERATOR_AND);
+        $request = $this->_builder->build($this->_query);
+
+        $this->assertEquals(
+            null,
+            $request->getRawData()
+        );
+
+        $this->assertEquals(
+            'select?wt=json&q=*:*&start=0&rows=10&fl=*,score&q.op=AND&df=mydefault',
+            urldecode($request->getUri())
+        );
+    }
+
+    public function testSelectUrlWithSortAndFilters()
+    {
+        $this->_query->addSort('id', Solarium_Query_Select::SORT_ASC);
+        $this->_query->addSort('name', Solarium_Query_Select::SORT_DESC);
+        $this->_query->addFilterQuery(new Solarium_Query_Select_FilterQuery(array('key' => 'f1', 'query' => 'published:true')));
+        $this->_query->addFilterQuery(new Solarium_Query_Select_FilterQuery(array('key' => 'f2', 'tag' => array('t1','t2'), 'query' => 'category:23')));
+        $request = $this->_builder->build($this->_query);
+
+        $this->assertEquals(
+            null,
+            $request->getRawData()
+        );
+
+        $this->assertEquals(
+            'select?wt=json&q=*:*&start=0&rows=10&fl=*,score&sort=id asc,name desc&fq=published:true&fq={!tag=t1,t2}category:23',
+            urldecode($request->getUri())
+        );
+    }
+
+    public function testWithComponentNoBuilder()
+    {
+        $request = $this->_builder->build($this->_query);
+
+        $this->_query->registerComponentType('testcomponent','TestDummyComponent');
+        $this->_query->getComponent('testcomponent', true);
+
+        $requestWithNoBuilderComponent = $this->_builder->build($this->_query);
+
+        $this->assertEquals(
+            $request,
+            $requestWithNoBuilderComponent
+        );
+    }
+
+    public function testWithComponent()
+    {
+        $this->_query->getDisMax();
+        $request = $this->_builder->build($this->_query);
+
+        $this->assertEquals(
+            'dismax',
+            $request->getParam('defType')
+        );
+    }
+
+}
+
+class TestDummyComponent extends Solarium_Query_Select_Component{
+
+    public function getType()
+    {
+        return 'testcomponent';
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/UpdateTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/UpdateTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/UpdateTest.php	(revision 7576)
@@ -0,0 +1,321 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_UpdateTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Update
+     */
+    protected $_query;
+
+    /**
+     * @var Solarium_Client_RequestBuilder_Update
+     */
+    protected $_builder;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Update;
+        $this->_builder = new Solarium_Client_RequestBuilder_Update;
+    }
+
+    public function testGetMethod()
+    {
+        $request = $this->_builder->build($this->_query);
+        $this->assertEquals(
+            Solarium_Client_Request::METHOD_POST,
+            $request->getMethod()
+        );
+    }
+
+    public function testGetUri()
+    {
+        $request = $this->_builder->build($this->_query);
+        $this->assertEquals(
+            'update?wt=json',
+            $request->getUri()
+        );
+    }
+
+    public function testBuildAddXmlNoParamsSingleDocument()
+    {
+        $command = new Solarium_Query_Update_Command_Add;
+        $command->addDocument(new Solarium_Document_ReadWrite(array('id' => 1)));
+        
+        $this->assertEquals(
+            '<add><doc><field name="id">1</field></doc></add>',
+            $this->_builder->buildAddXml($command)
+        );
+    }
+
+    public function testBuildAddXmlWithParams()
+    {
+        $command = new Solarium_Query_Update_Command_Add(array('overwrite' => true,'commitwithin' => 100));
+        $command->addDocument(new Solarium_Document_ReadWrite(array('id' => 1)));
+
+        $this->assertEquals(
+            '<add overwrite="true" commitWithin="100"><doc><field name="id">1</field></doc></add>',
+            $this->_builder->buildAddXml($command)
+        );
+    }
+
+    public function testBuildAddXmlSpecialCharacters()
+    {
+        $command = new Solarium_Query_Update_Command_Add;
+        $command->addDocument(new Solarium_Document_ReadWrite(array('id' => 1, 'text' => 'test < 123 > test')));
+
+        $this->assertEquals(
+            '<add><doc><field name="id">1</field><field name="text">test &lt; 123 &gt; test</field></doc></add>',
+            $this->_builder->buildAddXml($command)
+        );
+    }
+
+    public function testBuildAddXmlMultivalueField()
+    {
+        $command = new Solarium_Query_Update_Command_Add;
+        $command->addDocument(new Solarium_Document_ReadWrite(array('id' => array(1,2,3), 'text' => 'test < 123 > test')));
+
+        $this->assertEquals(
+            '<add><doc><field name="id">1</field><field name="id">2</field><field name="id">3</field><field name="text">test &lt; 123 &gt; test</field></doc></add>',
+            $this->_builder->buildAddXml($command)
+        );
+    }
+
+    public function testBuildAddXmlSingleDocumentWithBoost()
+    {
+        $doc = new Solarium_Document_ReadWrite(array('id' => 1));
+        $doc->setBoost(2.5);
+        $command = new Solarium_Query_Update_Command_Add;
+        $command->addDocument($doc);
+
+        $this->assertEquals(
+            '<add><doc boost="2.5"><field name="id">1</field></doc></add>',
+            $this->_builder->buildAddXml($command)
+        );
+    }
+
+    public function testBuildAddXmlSingleDocumentWithFieldBoost()
+    {
+        $doc = new Solarium_Document_ReadWrite(array('id' => 1));
+        $doc->setFieldBoost('id',2.1);
+        $command = new Solarium_Query_Update_Command_Add;
+        $command->addDocument($doc);
+
+        $this->assertEquals(
+            '<add><doc><field name="id" boost="2.1">1</field></doc></add>',
+            $this->_builder->buildAddXml($command)
+        );
+    }
+
+    public function testBuildAddXmlMultipleDocuments()
+    {
+        $command = new Solarium_Query_Update_Command_Add;
+        $command->addDocument(new Solarium_Document_ReadWrite(array('id' => 1)));
+        $command->addDocument(new Solarium_Document_ReadWrite(array('id' => 2)));
+
+        $this->assertEquals(
+            '<add><doc><field name="id">1</field></doc><doc><field name="id">2</field></doc></add>',
+            $this->_builder->buildAddXml($command)
+        );
+    }
+
+    public function testBuildDeleteXml()
+    {
+        $command = new Solarium_Query_Update_Command_Delete;
+
+        $this->assertEquals(
+            '<delete></delete>',
+            $this->_builder->buildDeleteXml($command)
+        );
+    }
+
+    public function testBuildDeleteXmlSingleId()
+    {
+        $command = new Solarium_Query_Update_Command_Delete;
+        $command->addId(123);
+
+        $this->assertEquals(
+            '<delete><id>123</id></delete>',
+            $this->_builder->buildDeleteXml($command)
+        );
+    }
+
+    public function testBuildDeleteXmlMultipleIds()
+    {
+        $command = new Solarium_Query_Update_Command_Delete;
+        $command->addId(123);
+        $command->addId(456);
+
+        $this->assertEquals(
+            '<delete><id>123</id><id>456</id></delete>',
+            $this->_builder->buildDeleteXml($command)
+        );
+    }
+
+    public function testBuildDeleteXmlSingleQuery()
+    {
+        $command = new Solarium_Query_Update_Command_Delete;
+        $command->addQuery('*:*');
+
+        $this->assertEquals(
+            '<delete><query>*:*</query></delete>',
+            $this->_builder->buildDeleteXml($command)
+        );
+    }
+
+    public function testBuildDeleteXmlMultipleQueries()
+    {
+        $command = new Solarium_Query_Update_Command_Delete;
+        $command->addQuery('published:false');
+        $command->addQuery('id:[10 TO 20]');
+
+        $this->assertEquals(
+            '<delete><query>published:false</query><query>id:[10 TO 20]</query></delete>',
+            $this->_builder->buildDeleteXml($command)
+        );
+    }
+
+    public function testBuildDeleteXmlIdsAndQueries()
+    {
+        $command = new Solarium_Query_Update_Command_Delete;
+        $command->addId(123);
+        $command->addId(456);
+        $command->addQuery('published:false');
+        $command->addQuery('id:[10 TO 20]');
+
+        $this->assertEquals(
+            '<delete><id>123</id><id>456</id><query>published:false</query><query>id:[10 TO 20]</query></delete>',
+            $this->_builder->buildDeleteXml($command)
+        );
+    }
+
+    public function testBuildDeleteXmlIdAndQuerySpecialChars()
+    {
+        $command = new Solarium_Query_Update_Command_Delete;
+        $command->addId('special<char>id');
+        $command->addQuery('id:special<char>id');
+
+        $this->assertEquals(
+            '<delete><id>special&lt;char&gt;id</id><query>id:special&lt;char&gt;id</query></delete>',
+            $this->_builder->buildDeleteXml($command)
+        );
+    }
+
+    public function testBuildOptimizeXml()
+    {
+        $command = new Solarium_Query_Update_Command_Optimize;
+
+        $this->assertEquals(
+            '<optimize/>',
+            $this->_builder->buildOptimizeXml($command)
+        );
+    }
+
+    public function testBuildOptimizeXmlWithParams()
+    {
+        $command = new Solarium_Query_Update_Command_Optimize(array('waitflush'=>true,'waitsearcher'=>false,'maxsegments'=>10));
+
+        $this->assertEquals(
+            '<optimize waitFlush="true" waitSearcher="false" maxSegments="10"/>',
+            $this->_builder->buildOptimizeXml($command)
+        );
+    }
+
+    public function testBuildCommitXml()
+    {
+        $command = new Solarium_Query_Update_Command_Commit;
+
+        $this->assertEquals(
+            '<commit/>',
+            $this->_builder->buildCommitXml($command)
+        );
+    }
+
+    public function testBuildCommitXmlWithParams()
+    {
+        $command = new Solarium_Query_Update_Command_Commit(array('waitflush'=>true,'waitsearcher'=>false,'expungedeletes'=>true));
+
+        $this->assertEquals(
+            '<commit waitFlush="true" waitSearcher="false" expungeDeletes="true"/>',
+            $this->_builder->buildCommitXml($command)
+        );
+    }
+
+    public function testBuildRollbackXml()
+    {
+        $command = new Solarium_Query_Update_Command_Rollback;
+
+        $this->assertEquals(
+            '<rollback/>',
+            $this->_builder->buildRollbackXml($command)
+        );
+    }
+
+    public function testCompleteRequest()
+    {
+        $this->_query->addDeleteById(1);
+        $this->_query->addRollback();
+        $this->_query->addDeleteQuery('*:*');
+        $this->_query->addDocument(new Solarium_Document_ReadWrite(array('id' => 1)));
+        $this->_query->addCommit();
+        $this->_query->addOptimize();
+
+        $this->assertEquals(
+            '<update>'
+            . '<delete><id>1</id></delete>'
+            . '<rollback/>'
+            . '<delete><query>*:*</query></delete>'
+            . '<add><doc><field name="id">1</field></doc></add>'
+            . '<commit/>'
+            . '<optimize/>'
+            . '</update>',
+            $this->_builder->getRawData($this->_query)
+        );
+    }
+
+    public function testInvalidCommandInRequest()
+    {
+        $this->_query->add('invalidcommand',new InvalidCommand);
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_builder->build($this->_query);
+    }
+}
+
+
+class InvalidCommand extends StdClass
+{
+    public function getType()
+    {
+        return 'invalid';
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/AnalysisTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/AnalysisTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/AnalysisTest.php	(revision 7576)
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_AnalysisTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Analysis_Field
+     */
+    protected $_query;
+
+    /**
+     * @var Solarium_Client_RequestBuilder_Analysis
+     */
+    protected $_builder;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Analysis_Field();
+        $this->_builder = new Solarium_Client_RequestBuilder_Analysis;
+    }
+
+    public function testBuild()
+    {
+        $query = 'cat:1';
+        $showMatch = true;
+        $handler = 'myhandler';
+        
+        $this->_query->setQuery($query)
+                     ->setShowMatch($showMatch)
+                     ->setHandler($handler);
+        $request = $this->_builder->build($this->_query);
+
+        $this->assertEquals(
+            array(
+                'wt' => 'json',
+                'analysis.query' => $query,
+                'analysis.showmatch' => 'true',
+            ),
+            $request->getParams()
+        );
+
+        $this->assertEquals($handler, $request->getHandler());
+    }
+
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/SuggesterTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/SuggesterTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilder/SuggesterTest.php	(revision 7576)
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilder_SuggesterTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Query_Suggester
+     */
+    protected $_query;
+
+    /**
+     * @var Solarium_Client_RequestBuilder_Suggester
+     */
+    protected $_builder;
+
+    public function setUp()
+    {
+        $this->_query = new Solarium_Query_Suggester;
+        $this->_builder = new Solarium_Client_RequestBuilder_Suggester;
+    }
+
+    public function testBuildParams()
+    {
+        $this->_query->setCollate(true);
+        $this->_query->setCount(13);
+        $this->_query->setDictionary('suggest');
+        $this->_query->setQuery('ap ip');
+        $this->_query->setOnlyMorePopular(true);
+
+        $request = $this->_builder->build($this->_query);
+
+        $this->assertEquals(
+            array(
+                'spellcheck' => 'true',
+                'q' => 'ap ip',
+                'spellcheck.dictionary' => 'suggest',
+                'spellcheck.count' => 13,
+                'spellcheck.onlyMorePopular' => 'true',
+                'spellcheck.collate' => 'true',
+                'wt' => 'json',
+            ),
+            $request->getParams()
+        );
+
+        $this->assertEquals(
+            Solarium_Client_Request::METHOD_GET,
+            $request->getMethod()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/Adapter/HttpTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/Adapter/HttpTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/Adapter/HttpTest.php	(revision 7576)
@@ -0,0 +1,153 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_Adapter_HttpTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Solarium_Client_Adapter_Http
+     */
+    protected $_adapter;
+
+    public function setUp()
+    {
+        $this->_adapter = new Solarium_Client_Adapter_Http();
+    }
+
+    public function testExecute()
+    {
+        $data = 'test123';
+
+        $request = new Solarium_Client_Request();
+        $request->setMethod(Solarium_Client_Request::METHOD_GET);
+
+        $mock = $this->getMock('Solarium_Client_Adapter_Http', array('_getData','check'));
+        $mock->expects($this->once())
+             ->method('_getData')
+             ->with($this->equalTo('http://127.0.0.1:8983/solr/?'), $this->isType('resource'))
+             ->will($this->returnValue(array($data, array('HTTP 1.1 200 OK'))));
+
+        $mock->execute($request);
+    }
+
+    public function testExecuteErrorResponse()
+    {
+        $data = 'test123';
+
+        $request = new Solarium_Client_Request();
+
+        $mock = $this->getMock('Solarium_Client_Adapter_Http', array('_getData','check'));
+        $mock->expects($this->once())
+             ->method('_getData')
+             ->with($this->equalTo('http://127.0.0.1:8983/solr/?'), $this->isType('resource'))
+             ->will($this->returnValue(array($data, array('HTTP 1.1 200 OK'))));
+        $mock->expects($this->once())
+             ->method('check')
+             ->will($this->throwException(new Solarium_Client_HttpException("HTTP request failed")));
+
+        $this->setExpectedException('Solarium_Client_HttpException');
+        $mock->execute($request);
+    }
+
+    public function testCheckError()
+    {
+        $this->setExpectedException('Solarium_Client_HttpException');
+        $this->_adapter->check(false, array());
+
+    }
+
+    public function testCheckOk()
+    {
+        $value = $this->_adapter->check('dummydata',array('HTTP 1.1 200 OK'));
+
+        $this->assertEquals(
+            null,
+            $value
+        );
+    }
+
+    public function testCreateContextGetRequest()
+    {
+        $timeout = 13;
+        $method = Solarium_Client_Request::METHOD_HEAD;
+
+        $request = new Solarium_Client_Request();
+        $request->setMethod($method);
+        $this->_adapter->setTimeout($timeout);
+
+        $context = $this->_adapter->createContext($request);
+
+        $this->assertEquals(
+            array('http' => array('method' => $method, 'timeout' => $timeout)),
+            stream_context_get_options($context)
+        );
+    }
+
+    public function testCreateContextWithHeaders()
+    {
+        $timeout = 13;
+        $method = Solarium_Client_Request::METHOD_HEAD;
+        $header1 = 'Content-Type: text/xml; charset=UTF-8';
+        $header2 = 'X-MyHeader: dummyvalue';
+
+        $request = new Solarium_Client_Request();
+        $request->setMethod($method);
+        $request->addHeader($header1);
+        $request->addHeader($header2);
+        $this->_adapter->setTimeout($timeout);
+
+        $context = $this->_adapter->createContext($request);
+
+        $this->assertEquals(
+            array('http' => array('method' => $method, 'timeout' => $timeout, 'header' => $header1."\r\n".$header2)),
+            stream_context_get_options($context)
+        );
+    }
+
+    public function testCreateContextPostRequest()
+    {
+        $timeout = 13;
+        $method = Solarium_Client_Request::METHOD_POST;
+        $data = 'test123';
+
+        $request = new Solarium_Client_Request();
+        $request->setMethod($method);
+        $request->setRawData($data);
+        $this->_adapter->setTimeout($timeout);
+
+        $context = $this->_adapter->createContext($request);
+
+        $this->assertEquals(
+            array('http' => array('method' => $method, 'timeout' => $timeout, 'content' => $data, 'header' => 'Content-Type: text/xml; charset=UTF-8')),
+            stream_context_get_options($context)
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/Adapter/ZendHttpTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/Adapter/ZendHttpTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/Adapter/ZendHttpTest.php	(revision 7576)
@@ -0,0 +1,166 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_Adapter_ZendHttpTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Solarium_Client_Adapter_ZendHttp
+     */
+    protected $_adapter;
+
+    public function setUp()
+    {
+        if (!class_exists('Zend_Loader_Autoloader') && (@include_once 'Zend/Loader/Autoloader.php') !== 'OK') {
+            $this->markTestSkipped('ZF not in include_path, skipping ZendHttp adapter tests');
+        }
+
+        Zend_Loader_Autoloader::getInstance();
+
+        $this->_adapter = new Solarium_Client_Adapter_ZendHttp();
+    }
+
+    public function testForwardingToZendHttpInSetOptions()
+    {
+        $options = array('timeout' => 10, 'optionZ' => 123, 'options' => array('optionX' => 'Y'));
+        $adapterOptions = array('timeout' => 10, 'optionX' => 'Y');
+        
+        $mock = $this->getMock('Zend_Http_Client');
+        $mock->expects($this->once())
+                 ->method('setConfig')
+                 ->with($this->equalTo($adapterOptions));
+
+        $this->_adapter->setZendHttp($mock);
+        $this->_adapter->setOptions($options);
+    }
+
+    public function testSetAndGetZendHttp()
+    {
+        $dummy = new StdClass();
+
+        $this->_adapter->setZendHttp($dummy);
+
+        $this->assertEquals(
+            $dummy,
+            $this->_adapter->getZendHttp()
+        );
+    }
+
+    public function testGetZendHttpAutoload()
+    {
+        $options = array('timeout' => 10, 'optionZ' => 123, 'options' => array('adapter' => 'Zend_Http_Client_Adapter_Curl'));
+        $this->_adapter->setOptions($options);
+
+        $zendHttp = $this->_adapter->getZendHttp();
+        $this->assertThat($zendHttp, $this->isInstanceOf('Zend_Http_Client'));
+    }
+
+    public function testExecute()
+    {
+        $method = Solarium_Client_Request::METHOD_GET;
+        $rawData = 'xyz';
+        $responseData = 'abc';
+        $handler = 'myhandler';
+        $headers = array(
+            'Content-Type: application/x-www-form-urlencoded'
+        );
+
+        $request = new Solarium_Client_Request();
+        $request->setMethod($method);
+        $request->setHandler($handler);
+        $request->setHeaders($headers);
+        $request->setRawData($rawData);
+
+        $response = new Zend_Http_Response(200, array('status' => 'HTTP 1.1 200 OK'), $responseData);
+
+        $mock = $this->getMock('Zend_Http_Client');
+        $mock->expects($this->once())
+                 ->method('setMethod')
+                 ->with($this->equalTo($method));
+        $mock->expects($this->once())
+                 ->method('setUri')
+                 ->with($this->equalTo('http://127.0.0.1:8983/solr/myhandler?'));
+        $mock->expects($this->once())
+                 ->method('setHeaders')
+                 ->with($this->equalTo($headers));
+        $mock->expects($this->once())
+                 ->method('setRawData')
+                 ->with($this->equalTo($rawData));
+        $mock->expects($this->once())
+                 ->method('request')
+                 ->will($this->returnValue($response));
+
+        $this->_adapter->setZendHttp($mock);
+        $adapterResponse = $this->_adapter->execute($request);
+
+        $this->assertEquals(
+            $responseData,
+            $adapterResponse->getBody()
+        );
+    }
+
+    public function testExecuteErrorResponse()
+    {
+        $request = new Solarium_Client_Request();
+        $response = new Zend_Http_Response(404, array(), '');
+
+        $mock = $this->getMock('Zend_Http_Client');
+        $mock->expects($this->once())
+                 ->method('request')
+                 ->will($this->returnValue($response));
+
+        $this->_adapter->setZendHttp($mock);
+
+        $this->setExpectedException('Solarium_Client_HttpException');
+        $this->_adapter->execute($request);
+
+    }
+
+    public function testExecuteHeadRequestReturnsNoData()
+    {
+        $request = new Solarium_Client_Request();
+        $request->setMethod(Solarium_Client_Request::METHOD_HEAD);
+        $response = new Zend_Http_Response(200, array('status' => 'HTTP 1.1 200 OK'), 'data');
+
+        $mock = $this->getMock('Zend_Http_Client');
+        $mock->expects($this->once())
+                 ->method('request')
+                 ->will($this->returnValue($response));
+
+        $this->_adapter->setZendHttp($mock);
+        $response = $this->_adapter->execute($request);
+
+        $this->assertEquals(
+            '',
+            $response->getBody()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/Adapter/PeclHttpTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/Adapter/PeclHttpTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/Adapter/PeclHttpTest.php	(revision 7576)
@@ -0,0 +1,172 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_Adapter_PeclHttpTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Solarium_Client_Adapter_PeclHttp
+     */
+    protected $_adapter;
+
+    public function setUp()
+    {
+        if (!function_exists('http_get')) {
+            $this->markTestSkipped('Pecl_http not available, skipping PeclHttp adapter tests');
+        }
+
+        $this->_adapter = new Solarium_Client_Adapter_PeclHttp(array('timeout' => 10));
+    }
+
+    /**
+     * @dataProvider requestProvider
+     */
+    public function testToHttpRequestWithMethod($request, $method, $support)
+    {
+        try {
+            $httpRequest = $this->_adapter->toHttpRequest($request);
+            $this->assertEquals($httpRequest->getMethod(), $method);
+        } catch (Solarium_Exception $e) {
+            if ($support) {
+                $this->fail("Unsupport method: {$request->getMethod()}");
+            }
+        }
+    }
+
+    public function requestProvider()
+    {
+        // prevents undefined constants errors
+        if (function_exists('http_get')) {
+            $methods = array(
+                Solarium_Client_Request::METHOD_GET  => array(
+                    'method' => HTTP_METH_GET,
+                    'support' => true
+                ),
+                Solarium_Client_Request::METHOD_POST => array(
+                    'method' => HTTP_METH_POST,
+                    'support' => true
+                ),
+                Solarium_Client_Request::METHOD_HEAD => array(
+                    'method' => HTTP_METH_HEAD,
+                    'support' => true
+                ),
+                'PUT'                                => array(
+                    'method' => HTTP_METH_PUT,
+                    'support' => false
+                ),
+                'DELETE'                             => array(
+                    'method' => HTTP_METH_DELETE,
+                    'support' => false
+                ),
+            );
+
+            foreach ($methods as $method => $options) {
+                $request = new Solarium_Client_Request;
+                $request->setMethod($method);
+                $data[] = array_merge(array($request), $options);
+            }
+
+            return $data;
+        }
+    }
+
+    public function testToHttpRequestWithHeaders()
+    {
+        $request = new Solarium_Client_Request(array(
+            'header' => array(
+                'Content-Type: application/json',
+                'User-Agent: Foo'
+            )
+        ));
+
+        $httpRequest = $this->_adapter->toHttpRequest($request);
+        $this->assertEquals(array(
+            'timeout' => 10,
+            'headers' => array(
+                'Content-Type' => 'application/json',
+                'User-Agent' => 'Foo'
+            )
+        ), $httpRequest->getOptions());
+    }
+
+    public function testToHttpRequestWithDefaultContentType()
+    {
+        $request = new Solarium_Client_Request;
+        $request->setMethod(Solarium_Client_Request::METHOD_POST);
+
+        $httpRequest = $this->_adapter->toHttpRequest($request);
+        $this->assertEquals(array(
+            'timeout' => 10,
+            'headers' => array(
+                'Content-Type' => 'text/xml; charset=utf-8',
+            )
+        ), $httpRequest->getOptions());
+    }
+
+    public function testExecute()
+    {
+        $statusCode = 200;
+        $statusMessage = 'OK';
+        $body = 'data';
+        $data = <<<EOF
+HTTP/1.1 $statusCode $statusMessage
+X-Foo: test
+
+$body
+EOF;
+        $request = new Solarium_Client_Request();
+
+        $mockHttpRequest = $this->getMock('HttpRequest');
+        $mockHttpRequest->expects($this->once())
+                        ->method('send')
+                        ->will($this->returnValue(HttpMessage::factory($data)));
+        $mock = $this->getMock('Solarium_Client_Adapter_PeclHttp', array('toHttpRequest'));
+        $mock->expects($this->once())
+             ->method('toHttpRequest')
+             ->with($request)
+             ->will($this->returnValue($mockHttpRequest));
+
+        $response = $mock->execute($request);
+        $this->assertEquals($body, $response->getBody());
+        $this->assertEquals($statusCode, $response->getStatusCode());
+        $this->assertEquals($statusMessage, $response->getStatusMessage());
+    }
+
+    /**
+     * @expectedException Solarium_Client_HttpException
+     */
+    public function testExecuteWithException()
+    {
+        $this->_adapter->setPort(-1); // this forces an error
+        $request = new Solarium_Client_Request();
+        $this->_adapter->execute($request);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/Adapter/CurlTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/Adapter/CurlTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/Adapter/CurlTest.php	(revision 7576)
@@ -0,0 +1,82 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_Adapter_CurlTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Solarium_Client_Adapter_Curl
+     */
+    protected $_adapter;
+
+    public function setUp()
+    {
+        if (!function_exists('curl_init')) {
+            $this->markTestSkipped('Curl not available, skipping Curl adapter tests');
+        }
+
+        $this->_adapter = new Solarium_Client_Adapter_Curl();
+    }
+
+    public function testCheck()
+    {
+        $data = 'data';
+        $headers = array('X-dummy: data');
+
+        // this should be ok, no exception
+        $this->_adapter->check($data, $headers);
+
+        $data = '';
+        $headers = array();
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_adapter->check($data, $headers);
+    }
+
+    public function testExecute()
+    {
+        $headers = array('HTTP/1.0 200 OK');
+        $body = 'data';
+        $data = array($body, $headers);
+
+        $request = new Solarium_Client_Request();
+
+        $mock = $this->getMock('Solarium_Client_Adapter_Curl', array('_getData'));
+        $mock->expects($this->once())
+                 ->method('_getData')
+                 ->with($request)
+                 ->will($this->returnValue($data));
+
+        $response = $mock->execute($request);
+
+        $this->assertEquals($data, $response);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/HttpExceptionTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/HttpExceptionTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/HttpExceptionTest.php	(revision 7576)
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_HttpExceptionTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testConstructor()
+    {
+        $exception = new Solarium_Client_HttpException('message text', 123);
+
+        $this->assertEquals(
+            'Solr HTTP error: message text (123)',
+            $exception->getMessage()
+        );
+    }
+
+    public function testGetMessage()
+    {
+        $exception = new Solarium_Client_HttpException('message text', 123);
+
+        $this->assertEquals(
+            'message text',
+            $exception->getStatusMessage()
+        );
+    }
+
+    public function testConstructorNoCode()
+    {
+        $exception = new Solarium_Client_HttpException('message text');
+
+        $this->assertEquals(
+            'Solr HTTP error: message text',
+            $exception->getMessage()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseTest.php	(revision 7576)
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_headers, $_data;
+
+    /**
+     * @var Solarium_Client_Response
+     */
+    protected $_response;
+
+    public function setUp()
+    {
+        $this->_headers = array('HTTP/1.0 304 Not Modified');
+        $this->_data = '{"responseHeader":{"status":0,"QTime":1,"params":{"wt":"json","q":"mdsfgdsfgdf"}},"response":{"numFound":0,"start":0,"docs":[]}}';
+        $this->_response = new Solarium_Client_Response($this->_data, $this->_headers);
+    }
+
+    public function testGetStatusCode()
+    {
+        $this->assertEquals(304, $this->_response->getStatusCode());
+    }
+
+    public function testGetStatusMessage()
+    {
+        $this->assertEquals('Not Modified', $this->_response->getStatusMessage());
+    }
+
+    public function testGetHeaders()
+    {
+        $this->assertEquals($this->_headers, $this->_response->getHeaders());
+    }
+
+    public function testGetBody()
+    {
+        $this->assertEquals($this->_data, $this->_response->getBody());
+    }
+
+    public function testMissingHeader()
+    {
+        $headers = array();
+
+        $this->setExpectedException('Solarium_Exception');
+        new Solarium_Client_Response($this->_data, $headers);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilderTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilderTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestBuilderTest.php	(revision 7576)
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestBuilderTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var TestRequestBuilder
+     */
+    protected $_builder;
+
+    public function setup()
+    {
+        $this->_builder = new TestRequestBuilder;
+    }
+
+    public function testBuild()
+    {
+        $query = new Solarium_Query_Select;
+        $query->addParam('p1','v1');
+        $query->addParam('p2','v2');
+        $request = $this->_builder->build($query);
+
+        $this->assertEquals(
+            'select?p1=v1&p2=v2&wt=json',
+             urldecode($request->getUri())
+        );
+    }
+
+    public function testRenderLocalParams()
+    {
+        $myParams = array('tag' => 'mytag', 'ex' => array('exclude1','exclude2'));
+
+        $this->assertEquals(
+            '{!tag=mytag ex=exclude1,exclude2}myValue',
+            $this->_builder->renderLocalParams('myValue', $myParams)
+        );
+    }
+
+    public function testRenderLocalParamsWithoutParams()
+    {
+        $this->assertEquals(
+            'myValue',
+            $this->_builder->renderLocalParams('myValue')
+        );
+    }
+
+}
+
+class TestRequestBuilder extends Solarium_Client_RequestBuilder{
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/AdapterTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/AdapterTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/AdapterTest.php	(revision 7576)
@@ -0,0 +1,120 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_AdapterTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var TestAdapter
+     */
+    protected $_adapter;
+
+    public function setUp()
+    {
+        $this->_adapter = new TestAdapter();
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'host'    => '192.168.0.1',
+            'port'    => 123,
+            'path'    => '/mysolr/',
+            'core'    => 'mycore',
+            'timeout' => 3,
+        );
+        $this->_adapter->setOptions($options);
+
+        $options['path'] = '/mysolr'; //expected trimming of trailing slash
+
+        $this->assertEquals($options, $this->_adapter->getOptions());
+    }
+
+    public function testSetAndGetHost()
+    {
+        $this->_adapter->setHost('myhost');
+        $this->assertEquals('myhost', $this->_adapter->getHost());
+    }
+
+    public function testSetAndGetPort()
+    {
+        $this->_adapter->setPort(8080);
+        $this->assertEquals(8080, $this->_adapter->getPort());
+    }
+
+    public function testSetAndGetPath()
+    {
+        $this->_adapter->setPath('/mysolr');
+        $this->assertEquals('/mysolr', $this->_adapter->getPath());
+    }
+
+    public function testSetAndGetPathWithTrailingSlash()
+    {
+        $this->_adapter->setPath('/mysolr/');
+        $this->assertEquals('/mysolr', $this->_adapter->getPath());
+    }
+
+    public function testSetAndGetCore()
+    {
+        $this->_adapter->setCore('core1');
+        $this->assertEquals('core1', $this->_adapter->getCore());
+    }
+
+    public function testSetAndGetTimeout()
+    {
+        $this->_adapter->setTimeout(7);
+        $this->assertEquals(7, $this->_adapter->getTimeout());
+    }
+
+    public function testGetBaseUri()
+    {
+        $this->_adapter->setHost('myserver')->setPath('/mypath')->setPort(123);
+
+        $this->assertEquals('http://myserver:123/mypath/', $this->_adapter->getBaseUri());
+    }
+
+    public function testGetBaseUriWithCore()
+    {
+        $this->_adapter->setHost('myserver')->setPath('/mypath')->setPort(123)->setCore('mycore');
+
+        $this->assertEquals('http://myserver:123/mypath/mycore/', $this->_adapter->getBaseUri());
+    }
+
+}
+
+class TestAdapter extends Solarium_Client_Adapter
+{
+    
+    public function execute($request)
+    {
+
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/GroupingTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/GroupingTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/GroupingTest.php	(revision 7576)
@@ -0,0 +1,139 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_Select_Component_GroupingTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Client_ResponseParser_Select_Component_Grouping
+     */
+    protected $_parser;
+
+    /**
+     * @var Solarium_Query_Select
+     */
+    protected $_query;
+
+    /**
+     * @var Solarium_Query_Select_Component_Grouping
+     */
+    protected $_grouping;
+
+    /**
+     * @var Solarium_Result_Select_Grouping
+     */
+    protected $_result;
+
+    public function setUp()
+    {
+        $this->_parser = new Solarium_Client_ResponseParser_Select_Component_Grouping;
+        $this->_query = new Solarium_Query_Select();
+        $this->_grouping = $this->_query->getGrouping();
+        $this->_grouping->addField('fieldA');
+        $this->_grouping->addQuery('cat:1');
+
+        $data = array(
+            'grouped' => array(
+                'fieldA' => array(
+                    'matches' =>  25,
+                    'ngroups' => 12,
+                    'groups' => array(
+                        array(
+                            'groupValue' => 'test value',
+                            'doclist' => array(
+                                'numFound' => 13,
+                                'docs' => array(
+                                    array('id' => 1, 'name' => 'test')
+                                )
+                            )
+                        )
+                    )
+                ),
+                'cat:1' => array(
+                    'matches' =>  40,
+                    'doclist' => array(
+                        'numFound' => 22,
+                        'docs' => array(
+                            array('id' => 2, 'name' => 'dummy2'),
+                            array('id' => 5, 'name' => 'dummy5')
+                        )
+                    )
+                )
+            )
+        );
+
+        $this->_result = $this->_parser->parse($this->_query, $this->_grouping, $data);
+    }
+
+    public function testGroupParsing()
+    {
+        $this->assertEquals(2, count($this->_result->getGroups()));
+
+        $fieldGroup = $this->_result->getGroup('fieldA');
+        $queryGroup = $this->_result->getGroup('cat:1');
+
+        $this->assertEquals('Solarium_Result_Select_Grouping_FieldGroup', get_class($fieldGroup));
+        $this->assertEquals('Solarium_Result_Select_Grouping_QueryGroup', get_class($queryGroup));
+    }
+
+    public function testFieldGroupParsing()
+    {
+        $fieldGroup = $this->_result->getGroup('fieldA');
+        $valueGroups = $fieldGroup->getValueGroups();
+        
+        $this->assertEquals(25, $fieldGroup->getMatches());
+        $this->assertEquals(12, $fieldGroup->getNumberOfGroups());
+        $this->assertEquals(1, count($valueGroups));
+
+        $valueGroup = $valueGroups[0];
+        $this->assertEquals(13, $valueGroup->getNumFound());
+
+        $docs = $valueGroup->getDocuments();
+        $this->assertEquals('test', $docs[0]->name);
+    }
+
+    public function testQueryGroupParsing()
+    {
+        $queryGroup = $this->_result->getGroup('cat:1');
+
+        $this->assertEquals(40, $queryGroup->getMatches());
+        $this->assertEquals(22, $queryGroup->getNumFound());
+
+        $docs = $queryGroup->getDocuments();
+        $this->assertEquals('dummy5', $docs[1]->name);
+    }
+
+    public function testParseNoData()
+    {
+        $result = $this->_parser->parse($this->_query, $this->_grouping, array());
+        $this->assertEquals(array(), $result->getGroups());
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/SpellcheckTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/SpellcheckTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/SpellcheckTest.php	(revision 7576)
@@ -0,0 +1,151 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_Select_Component_SpellcheckTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_parser;
+
+    public function setUp()
+    {
+        $this->_parser = new Solarium_Client_ResponseParser_Select_Component_Spellcheck();
+    }
+
+    public function testParseExtended()
+    {
+        $data = array(
+            'spellcheck' => array(
+                'suggestions' => array(
+                    0 => 'delll',
+                    1 => array (
+                        'numFound' => 1,
+                        'startOffset' => 0,
+                        'endOffset' => 5,
+                        'origFreq' => 0,
+                        'suggestion' => array (
+                            0 => array (
+                                'word' => 'dell', 'freq' => 1
+                            ),
+                        ),
+                    ),
+                    2 => 'ultrashar',
+                    3 => array (
+                        'numFound' => 1,
+                        'startOffset' => 6,
+                        'endOffset' => 15,
+                        'origFreq' => 0,
+                        'suggestion' => array (
+                            0 => array (
+                                'word' => 'ultrasharp',
+                                'freq' => 1
+                            ),
+                        ),
+                    ),
+                    4 => 'correctlySpelled',
+                    5 => false,
+                    6 => 'collation',
+                    7 => array (
+                        0 => 'collationQuery',
+                        1 => 'dell ultrasharp',
+                        2 => 'hits',
+                        3 => 0,
+                        4 => 'misspellingsAndCorrections',
+                        5 => array (
+                            0 => 'delll',
+                            1 => 'dell',
+                            2 => 'ultrashar',
+                            3 => 'ultrasharp'
+                        ),
+                    ),
+                )
+            )
+        );
+
+        $result = $this->_parser->parse(null, null, $data);
+
+        $suggestions = $result->getSuggestions();
+        $this->assertEquals(false, $result->getCorrectlySpelled());
+        $this->assertEquals('dell', $suggestions[0]->getWord());
+        $this->assertEquals('dell ultrasharp', $result->getCollation()->getQuery());
+    }
+
+    public function testParse()
+    {
+        $data = array(
+            'spellcheck' => array(
+                'suggestions' => array(
+                    0 => 'delll',
+                    1 => array (
+                        'numFound' => 1,
+                        'startOffset' => 0,
+                        'endOffset' => 5,
+                        'origFreq' => 0,
+                        'suggestion' => array (
+                            0 => 'dell',
+                        ),
+                    ),
+                    2 => 'ultrashar',
+                    3 => array (
+                        'numFound' => 1,
+                        'startOffset' => 6,
+                        'endOffset' => 15,
+                        'origFreq' => 0,
+                        'suggestion' => array (
+                            0 => array (
+                                'word' => 'ultrasharp',
+                                'freq' => 1
+                            ),
+                        ),
+                    ),
+                    4 => 'correctlySpelled',
+                    5 => false,
+                    6 => 'collation',
+                    7 => 'dell ultrasharp',
+                )
+            )
+        );
+
+        $result = $this->_parser->parse(null, null, $data);
+
+        $suggestions = $result->getSuggestions();
+        $this->assertEquals(false, $result->getCorrectlySpelled());
+        $this->assertEquals('dell', $suggestions[0]->getWord());
+        $this->assertEquals('dell ultrasharp', $result->getCollation()->getQuery());
+    }
+
+    public function testParseNoData()
+    {
+        $result = $this->_parser->parse(null, null, array());
+
+        $this->assertEquals(null, $result);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/FacetSetTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/FacetSetTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/FacetSetTest.php	(revision 7576)
@@ -0,0 +1,146 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_Select_Component_FacetSetTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_parser, $_facetSet;
+
+    public function setUp()
+    {
+        $this->_parser = new Solarium_Client_ResponseParser_Select_Component_FacetSet;
+
+        $this->_facetSet = new Solarium_Query_Select_Component_FacetSet();
+        $this->_facetSet->createFacet('field', array('key' => 'keyA', 'field' => 'fieldA'));
+        $this->_facetSet->createFacet('query', array('key' => 'keyB'));
+        $this->_facetSet->createFacet('multiquery', array('key' => 'keyC', 'query' => array('keyC_A' => array('query' => 'id:1'), 'keyC_B' => array('query' => 'id:2'))));
+        $this->_facetSet->createFacet('range', array('key' => 'keyD'));
+    }
+
+    public function testParse()
+    {
+        $data = array(
+            'facet_counts' =>  array(
+                'facet_fields' => array(
+                    'keyA' => array(
+                        'value1',
+                        12,
+                        'value2',
+                        3,
+                    ),
+                ),
+                'facet_queries' => array(
+                    'keyB' => 23,
+                    'keyC_A' => 25,
+                    'keyC_B' => 16,
+                ),
+                'facet_ranges' => array(
+                    'keyD' => array(
+                        'before' => 3,
+                        'after' => 5,
+                        'between' => 4,
+                        'counts' => array(
+                            '1.0',
+                            1,
+                            '101.0',
+                            2,
+                            '201.0',
+                            1,
+                        )
+                    )
+                )
+            )
+        );
+
+        $result = $this->_parser->parse(null, $this->_facetSet, $data);
+        $facets = $result->getFacets();
+
+        $this->assertEquals(array('keyA','keyB','keyC','keyD'), array_keys($facets));
+
+        $this->assertEquals(
+            array('value1' => 12, 'value2' => 3),
+            $facets['keyA']->getValues()
+        );
+
+        $this->assertEquals(
+            23,
+            $facets['keyB']->getValue()
+        );
+
+        $this->assertEquals(
+            array('keyC_A' => 25, 'keyC_B' => 16),
+            $facets['keyC']->getValues()
+        );
+
+        $this->assertEquals(
+            array('1.0' => 1, '101.0' => 2, '201.0' => 1),
+            $facets['keyD']->getValues()
+        );
+
+        $this->assertEquals(
+            3,
+            $facets['keyD']->getBefore()
+        );
+
+        $this->assertEquals(
+            4,
+            $facets['keyD']->getBetween()
+        );
+
+        $this->assertEquals(
+            5,
+            $facets['keyD']->getAfter()
+        );
+    }
+
+    public function testParseNoData()
+    {
+        $result = $this->_parser->parse(null, $this->_facetSet, array());
+        $this->assertEquals(array(), $result->getFacets());
+    }
+
+    public function testInvalidFacetType()
+    {
+        $facetStub = $this->getMock('Solarium_Query_Select_Component_Facet_Field');
+        $facetStub->expects($this->once())
+             ->method('getType')
+             ->will($this->returnValue('invalidfacettype'));
+        $facetStub->expects($this->any())
+             ->method('getKey')
+             ->will($this->returnValue('facetkey'));
+
+        $this->_facetSet->addFacet($facetStub);
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_parser->parse(null, $this->_facetSet, array());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/StatsTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/StatsTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/StatsTest.php	(revision 7576)
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_Select_Component_StatsTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_parser;
+
+    public function setUp()
+    {
+        $this->_parser = new Solarium_Client_ResponseParser_Select_Component_Stats();
+    }
+
+    public function testParse()
+    {
+        $data = array(
+            'stats' => array(
+                'stats_fields' => array(
+                    'fieldA' => array(
+                        'min' => 3,
+                    ),
+                    'fieldB' => array(
+                        'min' => 4,
+                        'facets' => array(
+                            'fieldC' => array(
+                                'value1' => array(
+                                    'min' => 5,
+                                )
+                            )
+                        )
+                    )
+                )
+            )
+        );
+
+        $result = $this->_parser->parse(null, null, $data);
+
+        $this->assertEquals(3, $result->getResult('fieldA')->getMin());
+        $this->assertEquals(4, $result->getResult('fieldB')->getMin());
+
+        $facets = $result->getResult('fieldB')->getFacets();
+        $this->assertEquals(5, $facets['fieldC']['value1']->getMin());
+    }
+
+    public function testParseNoData()
+    {
+        $result = $this->_parser->parse(null, null, array());
+        $this->assertEquals(0, count($result));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/MoreLikeThisTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/MoreLikeThisTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/MoreLikeThisTest.php	(revision 7576)
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_Select_Component_MoreLikeThisTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_parser;
+
+    public function setUp()
+    {
+        $this->_parser = new Solarium_Client_ResponseParser_Select_Component_MoreLikeThis();
+    }
+
+    public function testParse()
+    {
+        $query = new Solarium_Query_Select();
+        $data = array(
+            'moreLikeThis' => array(
+                'id1' => array(
+                    'numFound' => 12,
+                    'maxScore' => 1.75,
+                    'docs' => array(
+                        array('field1' => 'value1')
+                    )
+                )
+            )
+        );
+
+        $docs = array(new Solarium_Document_ReadOnly(array('field1' => 'value1')));
+        $expected = array(
+            'id1' => new Solarium_Result_Select_MoreLikeThis_Result(12, 1.75, $docs)
+        );
+
+        $result = $this->_parser->parse($query, null, $data);
+
+        $this->assertEquals($expected, $result->getResults());
+    }
+
+    public function testParseNoData()
+    {
+        $result = $this->_parser->parse(null, null, array());
+
+        $this->assertEquals(array(), $result->getResults());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/HighlightingTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/HighlightingTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/HighlightingTest.php	(revision 7576)
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_Select_Component_HighlightingTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_parser;
+
+    public function setUp()
+    {
+        $this->_parser = new Solarium_Client_ResponseParser_Select_Component_Highlighting;
+    }
+
+    public function testParse()
+    {
+        $highlights = array('key1' => 'dummy1', 'key2' => 'dummy2');
+        $data = array('highlighting' => $highlights);
+        $expected = array(
+            'key1' => new Solarium_Result_Select_Highlighting_Result('dummy1'),
+            'key2' => new Solarium_Result_Select_Highlighting_Result('dummy2'),
+        );
+
+        $result = $this->_parser->parse(null, null, $data);
+
+        $this->assertEquals($expected, $result->getResults());
+    }
+
+    public function testParseNoData()
+    {
+        $result = $this->_parser->parse(null, null, array());
+
+        $this->assertEquals(array(), $result->getResults());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/DebugTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/DebugTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Select/Component/DebugTest.php	(revision 7576)
@@ -0,0 +1,168 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_Select_Component_DebugTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Client_ResponseParser_Select_Component_Debug
+     */
+    protected $_parser;
+
+    public function setUp()
+    {
+        $this->_parser = new Solarium_Client_ResponseParser_Select_Component_Debug();
+    }
+
+    public function testParse()
+    {
+        $data = array(
+            'debug' => array(
+                'querystring' => 'dummy-qs',
+                'parsedquery' => 'dummy-pq',
+                'QParser' => 'dummy-qp',
+                'otherQuery' => 'dummy-oq',
+                'explain' => array(
+                    'MA147LL/A' => array(
+                        'match' => true,
+                        'value' => 0.5,
+                        'description' => 'fieldWeight(text:ipod in 5), product of:',
+                        'details' => array(
+                            array(
+                                'match' => true,
+                                'value' => 0.5,
+                                'description' => 'tf(termFreq(text:ipod)=1)',
+                            )
+                        ),
+                    ),
+                ),
+                'explainOther' => array(
+                    'IW-02' => array(
+                        'match' => true,
+                        'value' => 0.6,
+                        'description' => 'fieldWeight(text:ipod in 6), product of:',
+                        'details' => array(
+                            array(
+                                'match' => true,
+                                'value' => 0.7,
+                                'description' => 'tf(termFreq(text:ipod)=1)',
+                            )
+                        ),
+                    ),
+                ),
+                'timing' => array(
+                    'time' => 36,
+                    'prepare' => array(
+                        'time' => 12,
+                        'org.apache.solr.handler.component.QueryComponent' => array(
+                            'time' => 1,
+                        ),
+                        'org.apache.solr.handler.component.FacetComponent' => array(
+                            'time' => 11,
+                        ),
+                    ),
+                    'process' => array(
+                        'time' => 8,
+                        'org.apache.solr.handler.component.QueryComponent' => array(
+                            'time' => 5,
+                        ),
+                        'org.apache.solr.handler.component.MoreLikeThisComponent' => array(
+                            'time' => 3,
+                        ),
+                    )
+                )
+            )
+        );
+
+        $result = $this->_parser->parse(null, null, $data);
+        $this->assertEquals('dummy-qs', $result->getQueryString());
+        $this->assertEquals('dummy-pq', $result->getParsedQuery());
+        $this->assertEquals('dummy-qp', $result->getQueryParser());
+        $this->assertEquals('dummy-oq', $result->getOtherQuery());
+
+        $this->assertEquals(1, count($result->getExplain()));
+        $doc = $result->getExplain()->getDocument('MA147LL/A');
+        $this->assertEquals(0.5, $doc->getValue());
+        $this->assertEquals(true, $doc->getMatch());
+        $this->assertEquals('fieldWeight(text:ipod in 5), product of:', $doc->getDescription());
+        $this->assertEquals(
+            array(new Solarium_Result_Select_Debug_Detail(true, 0.5, 'tf(termFreq(text:ipod)=1)')),
+            $doc->getDetails()
+        );
+
+        $this->assertEquals(1, count($result->getExplainOther()));
+        $doc = $result->getExplainOther()->getDocument('IW-02');
+        $this->assertEquals(0.6, $doc->getValue());
+        $this->assertEquals(true, $doc->getMatch());
+        $this->assertEquals('fieldWeight(text:ipod in 6), product of:', $doc->getDescription());
+        $this->assertEquals(
+            array(new Solarium_Result_Select_Debug_Detail(true, 0.7, 'tf(termFreq(text:ipod)=1)')),
+            $doc->getDetails()
+        );
+
+        $timing = $result->getTiming();
+        $this->assertEquals(36, $timing->getTime());
+        $this->assertEquals(2, count($timing->getPhases()));
+        $phase = $timing->getPhase('process');
+        $this->assertEquals(8, $phase->getTime());
+        $this->assertEquals(2, count($phase->getTimings()));
+        $this->assertEquals(5, $phase->getTiming('org.apache.solr.handler.component.QueryComponent'));
+        $this->assertEquals(3, $phase->getTiming('org.apache.solr.handler.component.MoreLikeThisComponent'));
+    }
+
+    public function testParseNoExplainData()
+    {
+        $data = array(
+            'debug' => array(
+                'querystring' => 'dummy-qs',
+                'parsedquery' => 'dummy-pq',
+                'QParser' => 'dummy-qp',
+                'otherQuery' => 'dummy-oq',
+            )
+        );
+
+        $result = $this->_parser->parse(null, null, $data);
+        $this->assertEquals('dummy-qs', $result->getQueryString());
+        $this->assertEquals('dummy-pq', $result->getParsedQuery());
+        $this->assertEquals('dummy-qp', $result->getQueryParser());
+        $this->assertEquals('dummy-oq', $result->getOtherQuery());
+
+        $this->assertEquals(0, count($result->getExplain()));
+        $this->assertEquals(0, count($result->getExplainOther()));
+    }
+
+    public function testParseNoData()
+    {
+        $result = $this->_parser->parse(null, null, array());
+        $this->assertEquals(null, $result);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/TermsTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/TermsTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/TermsTest.php	(revision 7576)
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_TermsTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testParse()
+    {
+        $data = array(
+            'responseHeader' => array(
+                'status' => 1,
+                'QTime' => 13,
+            ),
+            'terms' => array(
+                'fieldA' => array(
+                    'term1',
+                    5,
+                    'term2',
+                    3
+                ),
+                'fieldB' => array(
+                    'term3',
+                    6,
+                    'term4',
+                    2
+                )
+            ),
+        );
+
+        $query = new Solarium_Query_Terms();
+        $query->setFields('fieldA, fieldB');
+
+        $resultStub = $this->getMock('Solarium_Result_Terms', array(), array(), '', false);
+        $resultStub->expects($this->any())
+             ->method('getData')
+             ->will($this->returnValue($data));
+        $resultStub->expects($this->any())
+             ->method('getQuery')
+             ->will($this->returnValue($query));
+
+        $parser = new Solarium_Client_ResponseParser_Terms;
+        $result = $parser->parse($resultStub);
+
+        $expected = array(
+            'fieldA' => array(
+                'term1' => 5,
+                'term2' => 3,
+            ),
+            'fieldB' => array(
+                'term3' => 6,
+                'term4' => 2,
+            )
+        );
+
+        $this->assertEquals($expected, $result['results']);
+        $this->assertEquals(2, count($result['results']));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Analysis/DocumentTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Analysis/DocumentTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Analysis/DocumentTest.php	(revision 7576)
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_Analysis_DocumentTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testParse()
+    {
+        $data = array(
+            'analysis' => array(
+                'key1' => 'data1',
+                'key2' => 'data2',
+            ),
+            'responseHeader' => array(
+                'status' => 1,
+                'QTime' => 5
+            )
+        );
+
+        $resultStub = $this->getMock('Solarium_Result', array(), array(), '', false);
+        $resultStub->expects($this->once())
+             ->method('getData')
+             ->will($this->returnValue($data));
+
+        $parserStub = $this->getMock('Solarium_Client_ResponseParser_Analysis_Document',array('_parseTypes'));
+        $parserStub->expects($this->exactly(2))
+             ->method('_parseTypes')
+             ->will($this->returnValue('dummy'));
+
+        $result = $parserStub->parse($resultStub);
+
+
+        $this->assertEquals(count($data['analysis']), count($result['items']));
+        $this->assertEquals('key2', $result['items'][1]->getName());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Analysis/FieldTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Analysis/FieldTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/Analysis/FieldTest.php	(revision 7576)
@@ -0,0 +1,120 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_Analysis_FieldTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testParse()
+    {
+        $data = array(
+            'analysis' => array(
+                'doc1' => array(
+                    'field1' => array(
+                        'type1' => array(
+                            array(
+                                'org.apache.solr.analysis.PatternReplaceCharFilter',
+                                'string value',
+                                'analysisClass',
+                                array(
+                                    array(
+                                        'text' => 'test',
+                                        'start' => 1,
+                                        'end' => 23,
+                                        'position' => 4,
+                                        'positionHistory' => 'test',
+                                        'type' => 'test',
+                                    ),
+                                    array(
+                                        'text' => 'test2',
+                                        'start' => 1,
+                                        'end' => 23,
+                                        'position' => 4,
+                                        'positionHistory' => 'test',
+                                        'type' => 'test',
+                                    )
+                                )
+                            )
+                        )
+                    )
+                )
+            ),
+            'responseHeader' => array(
+                'status' => 1,
+                'QTime' => 5
+            )
+        );
+
+        $resultStub = $this->getMock('Solarium_Result', array(), array(), '', false);
+        $resultStub->expects($this->once())
+             ->method('getData')
+             ->will($this->returnValue($data));
+
+        $parser = new Solarium_Client_ResponseParser_Analysis_Field();
+        $result = $parser->parse($resultStub);
+
+        $docs = $result['items'][0]->getItems();
+        $fields = $docs[0]->getItems();
+        $types = $fields[0]->getItems();
+        $class1items = $types[0]->getItems();
+        $class2items = $types[1]->getItems();
+
+        $this->assertEquals('string value', $class1items[0]->getText());
+        $this->assertEquals('test2', $class2items[1]->getText());
+    }
+
+    public function testParseNoData()
+    {
+        $data = array(
+            'responseHeader' => array(
+                'status' => 1,
+                'QTime' => 5
+            )
+        );
+
+        $resultStub = $this->getMock('Solarium_Result', array(), array(), '', false);
+        $resultStub->expects($this->once())
+             ->method('getData')
+             ->will($this->returnValue($data));
+
+        $parser = new Solarium_Client_ResponseParser_Analysis_Field();
+        $result = $parser->parse($resultStub);
+
+        $this->assertEquals(
+            array(
+                'status' => 1,
+                'queryTime' => 5,
+                'items' => array()
+            ),
+            $result
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/MoreLikeThisTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/MoreLikeThisTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/MoreLikeThisTest.php	(revision 7576)
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_MoreLikeThisTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testParse()
+    {
+        $data = array(
+            'response' => array(
+                'docs' => array(
+                    array('fieldA' => 1, 'fieldB' => 'Test'),
+                    array('fieldA' => 2, 'fieldB' => 'Test2')
+                ),
+                'numFound' => 503
+            ),
+            'responseHeader' => array(
+                'status' => 1,
+                'QTime' => 13,
+            ),
+            'interestingTerms' => array(
+                'key1', 'value1', 'key2', 'value2'
+            ),
+            'match' => array(
+                'docs' => array(
+                    array('fieldA' => 5, 'fieldB' => 'Test5'),
+                ),
+            ),
+        );
+
+        $query = new Solarium_Query_MoreLikeThis();
+        $query->setInterestingTerms('details');
+        $query->setMatchInclude(true);
+
+        $resultStub = $this->getMock('Solarium_Result_MoreLikeThis', array(), array(), '', false);
+        $resultStub->expects($this->any())
+             ->method('getData')
+             ->will($this->returnValue($data));
+        $resultStub->expects($this->any())
+             ->method('getQuery')
+             ->will($this->returnValue($query));
+
+        $parser = new Solarium_Client_ResponseParser_MoreLikeThis;
+        $result = $parser->parse($resultStub);
+
+        $this->assertEquals(array('key1' => 'value1', 'key2' => 'value2'), $result['interestingTerms']);
+        $this->assertEquals(5, $result['match']->fieldA);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/SelectTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/SelectTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/SelectTest.php	(revision 7576)
@@ -0,0 +1,115 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_SelectTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testParse()
+    {
+        $data = array(
+            'response' => array(
+                'docs' => array(
+                    array('fieldA' => 1, 'fieldB' => 'Test'),
+                    array('fieldA' => 2, 'fieldB' => 'Test2')
+                ),
+                'numFound' => 503
+            ),
+            'responseHeader' => array(
+                'status' => 1,
+                'QTime' => 13,
+            )
+        );
+
+        $query = new Solarium_Query_Select(array('documentclass' => 'Solarium_Document_ReadWrite'));
+        $query->getFacetSet();
+
+        $resultStub = $this->getMock('Solarium_Result_Select', array(), array(), '', false);
+        $resultStub->expects($this->once())
+             ->method('getData')
+             ->will($this->returnValue($data));
+        $resultStub->expects($this->once())
+             ->method('getQuery')
+             ->will($this->returnValue($query));
+
+        $parser = new Solarium_Client_ResponseParser_Select;
+        $result = $parser->parse($resultStub);
+
+        $this->assertEquals(1, $result['status']);
+        $this->assertEquals(13, $result['queryTime']);
+        $this->assertEquals(503, $result['numfound']);
+
+        $docs = array(
+            new Solarium_Document_ReadWrite(array('fieldA' => 1, 'fieldB' => 'Test')),
+            new Solarium_Document_ReadWrite(array('fieldA' => 2, 'fieldB' => 'Test2')) 
+        );
+        $this->assertEquals($docs, $result['documents']);
+
+        $components = array(
+            Solarium_Query_Select::COMPONENT_FACETSET => new Solarium_Result_Select_FacetSet(array())
+        );
+        $this->assertEquals($components, $result['components']);
+    }
+
+    public function testParseWithoutNumFound()
+    {
+        $data = array(
+            'response' => array(
+                'docs' => array(
+                    array('fieldA' => 1, 'fieldB' => 'Test'),
+                    array('fieldA' => 2, 'fieldB' => 'Test2')
+                ),
+            ),
+            'responseHeader' => array(
+                'status' => 1,
+                'QTime' => 13,
+            )
+        );
+
+        $query = new Solarium_Query_Select(array('documentclass' => 'Solarium_Document_ReadWrite'));
+        $query->getFacetSet();
+
+        $resultStub = $this->getMock('Solarium_Result_Select', array(), array(), '', false);
+        $resultStub->expects($this->once())
+             ->method('getData')
+             ->will($this->returnValue($data));
+        $resultStub->expects($this->once())
+             ->method('getQuery')
+             ->will($this->returnValue($query));
+
+        $parser = new Solarium_Client_ResponseParser_Select;
+        $result = $parser->parse($resultStub);
+
+        $this->assertEquals(1, $result['status']);
+        $this->assertEquals(13, $result['queryTime']);
+        $this->assertEquals(null, $result['numfound']);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/UpdateTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/UpdateTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/UpdateTest.php	(revision 7576)
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_UpdateTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testParse()
+    {
+        $data = '{"responseHeader" : {"status":1,"QTime":15}}';
+
+        $response = new Solarium_Client_Response($data, array('HTTP 1.1 200 OK'));
+        $result = new Solarium_Result_Update(null,null,$response);
+        $parser = new Solarium_Client_ResponseParser_Update;
+        $parsed = $parser->parse($result);
+
+        $this->assertEquals(1, $parsed['status']);
+        $this->assertEquals(15, $parsed['queryTime']);
+    }    
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/SuggesterTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/SuggesterTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/ResponseParser/SuggesterTest.php	(revision 7576)
@@ -0,0 +1,91 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_ResponseParser_SuggesterTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testParse()
+    {
+        $data = array(
+            'responseHeader' => array(
+                'status' => 1,
+                'QTime' => 13,
+            ),
+            'spellcheck' => array(
+                'suggestions' => array(
+                    'd',
+                    array(
+                        'numFound' => 2,
+                        'startOffset' => 3,
+                        'endOffset' => 7,
+                        'suggestion' => array(
+                            'disk',
+                            'ddr'
+                        )
+                    ),
+                    'vid',
+                    array(
+                        'numFound' => 1,
+                        'startOffset' => 2,
+                        'endOffset' => 5,
+                        'suggestion' => array(
+                            'video',
+                        )
+                    ),
+                    'collation',
+                    'disk video'
+                ),
+            ),
+        );
+
+        $query = new Solarium_Query_Suggester();
+
+        $resultStub = $this->getMock('Solarium_Result_Suggester', array(), array(), '', false);
+        $resultStub->expects($this->any())
+             ->method('getData')
+             ->will($this->returnValue($data));
+        $resultStub->expects($this->any())
+             ->method('getQuery')
+             ->will($this->returnValue($query));
+
+        $parser = new Solarium_Client_ResponseParser_Suggester;
+        $result = $parser->parse($resultStub);
+
+        $expected = array(
+            'd' => new Solarium_Result_Suggester_Term(2,3,7,array('disk','ddr')),
+            'vid' => new Solarium_Result_Suggester_Term(1,2,5,array('video'))
+        );
+
+        $this->assertEquals($expected, $result['results']);
+        $this->assertEquals('disk video', $result['collation']);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Client/RequestTest.php	(revision 7576)
@@ -0,0 +1,475 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Client_RequestTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Client_Request
+     */
+    protected $_request;
+
+    public function setup()
+    {
+        $this->_request = new Solarium_Client_Request;
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'method'   => Solarium_Client_Request::METHOD_POST,
+            'handler'  => 'myHandler',
+            'param'    => array(
+                'param1' => 1,
+                'param2' => 'test',
+            ),
+            'rawdata'  => 'raw post data here',
+            'header'   => array(
+                'myHeader1' => 'X-myHeader1: value1',
+                'myHeader2' => 'X-myHeader2: value2',
+            ),
+        );
+        $this->_request->setOptions($options);
+
+        $this->assertEquals(
+            $options['method'],
+            $this->_request->getMethod()
+        );
+
+        $this->assertEquals(
+            $options['handler'],
+            $this->_request->getHandler()
+        );
+
+        $this->assertEquals(
+            $options['rawdata'],
+            $this->_request->getRawData()
+        );
+
+        $this->assertEquals(
+            $options['param'],
+            $this->_request->getParams()
+        );
+
+        $this->assertEquals(
+            array(
+                $options['header']['myHeader1'],
+                $options['header']['myHeader2']
+            ),
+            $this->_request->getHeaders()
+        );
+    }
+
+    public function testGetDefaultMethod()
+    {
+        $this->assertEquals(
+            Solarium_Client_Request::METHOD_GET,
+            $this->_request->getMethod()
+        );
+    }
+
+    public function testSetAndGetMethod()
+    {
+        $this->_request->setMethod(Solarium_Client_Request::METHOD_POST);
+
+        $this->assertEquals(
+            Solarium_Client_Request::METHOD_POST,
+            $this->_request->getMethod()
+        );
+    }
+
+    public function testSetAndGetHandler()
+    {
+        $this->_request->setHandler('myhandler');
+
+        $this->assertEquals(
+            'myhandler',
+            $this->_request->getHandler()
+        );
+    }
+
+    public function testSetAndGetParams()
+    {
+        $params = array(
+            'param1' => 1,
+            'param2' => 2,
+        );
+
+        $this->_request->setParams($params);
+
+        $this->assertEquals(
+            $params,
+            $this->_request->getParams()
+        );
+    }
+
+    public function testSetAndGetParam()
+    {
+        $params = array(
+            'param1' => 1,
+            'param2' => 2,
+        );
+
+        $this->_request->setParams($params);
+
+        $this->assertEquals(
+            2,
+            $this->_request->getParam('param2')
+        );
+    }
+
+    public function testGetInvalidParam()
+    {
+        $this->assertEquals(
+            null,
+            $this->_request->getParam('invalidname')
+        );
+    }
+
+    public function testAddParam()
+    {
+        $params = array(
+            'param1' => 1,
+            'param2' => 2,
+        );
+
+        $this->_request->setParams($params);
+        $this->_request->addParam('param3', 3);
+
+        $params['param3'] = 3;
+
+        $this->assertEquals(
+            $params,
+            $this->_request->getParams()
+        );
+    }
+
+    public function testAddParamBoolean()
+    {
+        $params = array(
+            'param1' => true,
+            'param2' => false,
+        );
+
+        $this->_request->addParams($params);
+
+        $this->assertEquals(
+            array(
+                'param1' => 'true',
+                'param2' => 'false',
+            ),
+            $this->_request->getParams()
+        );
+    }
+
+    public function testAddParamMultivalue()
+    {
+        $params = array(
+            'param1' => 1,
+        );
+
+        $this->_request->setParams($params);
+        $this->_request->addParam('param2', 2);
+        $this->_request->addParam('param2', 3);
+
+        $params['param2'] = array(2, 3);
+
+        $this->assertEquals(
+            $params,
+            $this->_request->getParams()
+        );
+    }
+
+    public function testAddParamNoValue()
+    {
+        $params = array(
+            'param1' => 1,
+            'param2' => 2,
+            'param3' => 3,
+        );
+
+        $this->_request->setParams($params);
+        $this->_request->addParam('param2', ''); // this should add an empty value to param2
+        $this->_request->addParam('param3', '' , true); // this should overwrite param2 with an empty value
+        $this->_request->addParam('param4', ''); // this should add an empty param (for instance "q=" in dismax)
+        $this->_request->addParam('param5', null); // this param should be ignored
+
+        $this->assertEquals(
+            array(
+                'param1' => 1,
+                'param2' => array(2,''),
+                'param3' => '',
+                'param4' => '',
+            ),
+            $this->_request->getParams()
+        );
+    }
+
+    public function testAddParamOverwrite()
+    {
+        $params = array(
+            'param1' => 1,
+        );
+
+        $this->_request->setParams($params);
+        $this->_request->addParam('param1', 2, true);
+
+
+        $this->assertEquals(
+            array('param1' => 2),
+            $this->_request->getParams()
+        );
+    }
+
+    public function testAddParams()
+    {
+        $params = array(
+            'param1' => 1,
+        );
+
+        $extraParams = array(
+            'param1' => 2,
+            'param2' => 3,
+        );
+
+        $this->_request->setParams($params);
+        $this->_request->addParams($extraParams);
+
+
+        $this->assertEquals(
+            array(
+                'param1' => array(1,2),
+                'param2' => 3,
+            ),
+            $this->_request->getParams()
+        );
+    }
+
+    public function testAddParamsOverwrite()
+    {
+        $params = array(
+            'param1' => 1,
+        );
+
+        $extraParams = array(
+            'param1' => 2,
+            'param2' => 3,
+        );
+
+        $this->_request->setParams($params);
+        $this->_request->addParams($extraParams, true);
+
+
+        $this->assertEquals(
+            array(
+                'param1' => 2,
+                'param2' => 3,
+            ),
+            $this->_request->getParams()
+        );
+    }
+
+    public function testRemoveParam()
+    {
+        $params = array(
+            'param1' => 1,
+            'param2' => 2,
+        );
+
+        $this->_request->setParams($params);
+        $this->_request->removeParam('param2');
+
+        $this->assertEquals(
+            array('param1' => 1),
+            $this->_request->getParams()
+        );
+    }
+
+    public function testClearParams()
+    {
+        $params = array(
+            'param1' => 1,
+            'param2' => 2,
+        );
+
+        $this->_request->setParams($params);
+        $this->_request->clearParams();
+
+        $this->assertEquals(
+            array(),
+            $this->_request->getParams()
+        );
+    }
+
+    public function testGetAndSetRawData()
+    {
+        $data = '1234567890';
+        $this->_request->setRawData($data);
+
+        $this->assertEquals(
+            $data,
+            $this->_request->getRawData()
+        );
+    }
+
+    public function testSetAndGetHeaders()
+    {
+        $headers = array(
+            'User-Agent: My Agent',
+            'Cache-Control: no-cache'
+        );
+        $this->_request->setHeaders($headers);
+
+        $this->assertEquals(
+            $headers,
+            $this->_request->getHeaders()
+        );
+    }
+
+    public function testAddHeader()
+    {
+        $headers = array(
+            'User-Agent: My Agent',
+
+        );
+
+        $this->_request->setHeaders($headers);
+        $this->_request->addHeader('Cache-Control: no-cache');
+
+        $headers[] = 'Cache-Control: no-cache';
+
+        $this->assertEquals(
+            $headers,
+            $this->_request->getHeaders()
+        );
+    }
+
+    public function testAddHeaders()
+    {
+        $headers = array(
+            'User-Agent: My Agent',
+
+        );
+
+        $extraHeaders = array(
+            'Cache-Control: no-cache',
+            'X-custom: 123',
+        );
+
+        $this->_request->setHeaders($headers);
+        $this->_request->addHeaders($extraHeaders);
+
+        $this->assertEquals(
+            array_merge($headers, $extraHeaders),
+            $this->_request->getHeaders()
+        );
+    }
+
+    public function testClearHeaders()
+    {
+        $headers = array(
+            'User-Agent: My Agent',
+            'Cache-Control: no-cache'
+        );
+
+        $this->_request->setHeaders($headers);
+
+        $this->assertEquals(
+            $headers,
+            $this->_request->getHeaders()
+        );
+
+        $this->_request->clearHeaders();
+
+        $this->assertEquals(
+            array(),
+            $this->_request->getHeaders()
+        );
+    }
+
+    public function testGetUri()
+    {
+        $this->assertEquals(
+            '?',
+            $this->_request->getUri()
+        );
+    }
+
+    public function testGetUriWithHandlerAndParams()
+    {
+        $params = array(
+            'param1' => 1,
+            'param2' => array(2,3),
+        );
+
+        $this->_request->setHandler('myHandler');
+        $this->_request->addParams($params);
+
+        $this->assertEquals(
+            'myHandler?param1=1&param2=2&param2=3',
+            $this->_request->getUri()
+        );
+    }
+
+    public function testToString()
+    {
+        $options = array(
+            'method'   => Solarium_Client_Request::METHOD_POST,
+            'handler'  => '/myHandler',
+            'param'    => array(
+                'param1' => 1,
+                'param2' => 'test content',
+            ),
+            'rawdata'  => 'post data',
+            'header'   => array(
+                'myHeader1' => 'X-myHeader1: value1',
+                'myHeader2' => 'X-myHeader2: value2',
+            ),
+        );
+        $this->_request->setOptions($options);
+
+        $this->assertEquals(
+'Solarium_Client_Request::toString
+method: POST
+header: Array
+(
+    [0] => X-myHeader1: value1
+    [1] => X-myHeader2: value2
+)
+resource: /myHandler?param1=1&param2=test+content
+resource urldecoded: /myHandler?param1=1&param2=test content
+raw data: post data
+',
+            (string)$this->_request
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Document/ReadOnlyTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Document/ReadOnlyTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Document/ReadOnlyTest.php	(revision 7576)
@@ -0,0 +1,133 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Document_ReadOnlyTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_doc;
+
+    protected $_fields = array(
+        'id' => 123,
+        'name' => 'Test document',
+        'categories' => array(1,2,3)
+    );
+
+    protected function setUp()
+    {
+        $this->_doc = new Solarium_Document_ReadOnly($this->_fields);
+    }
+
+    public function testGetFields()
+    {
+        $this->assertEquals($this->_fields,$this->_doc->getFields());
+    }
+
+    public function testGetFieldAsProperty()
+    {
+        $this->assertEquals(
+            $this->_fields['categories'],
+            $this->_doc->categories
+        );
+    }
+
+    public function testGetInvalidFieldAsProperty()
+    {
+        $this->assertEquals(
+            null,
+            $this->_doc->invalidfieldname
+        );
+    }
+
+    public function testSetField()
+    {
+        $this->setExpectedException('Solarium_Exception');
+        $this->_doc->newField = 'new value';
+    }
+
+    public function testIterator()
+    {
+        $fields = array();
+        foreach($this->_doc AS $key => $field)
+        {
+            $fields[$key] = $field;
+        }
+
+        $this->assertEquals($this->_fields, $fields);
+    }
+
+    public function testArrayGet()
+    {
+        $this->assertEquals(
+            $this->_fields['categories'],
+            $this->_doc['categories']
+        );
+    }
+
+    public function testArrayGetInvalidField()
+    {
+        $this->assertEquals(
+            null,
+            $this->_doc['invalidfield']
+        );
+    }
+
+    public function testArrayIsset()
+    {
+        $this->assertTrue(
+            isset($this->_doc['categories'])
+        );
+    }
+
+    public function testArrayIssetInvalidField()
+    {
+        $this->assertFalse(
+            isset($this->_doc['invalidfield'])
+        );
+    }
+
+    public function testArraySet()
+    {
+        $this->setExpectedException('Solarium_Exception');
+        $this->_doc['newField'] = 'new value';
+    }
+
+    public function testArrayUnset()
+    {
+        $this->setExpectedException('Solarium_Exception');
+        unset($this->_doc['newField']);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_fields), count($this->_doc));
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Document/ReadWriteTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Document/ReadWriteTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Document/ReadWriteTest.php	(revision 7576)
@@ -0,0 +1,315 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Document_ReadWriteTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_doc;
+
+    protected $_fields = array(
+        'id' => 123,
+        'name' => 'Test document',
+        'categories' => array(1,2,3)
+    );
+
+    protected function setUp()
+    {
+        $this->_doc = new Solarium_Document_ReadWrite($this->_fields);
+    }
+    
+    public function testConstructorWithFieldsAndBoosts()
+    {
+        $fields = array('id' => 1, 'name' => 'testname');
+        $boosts = array('name' => 2.7);
+        $doc = new Solarium_Document_ReadWrite($fields, $boosts);
+
+        $this->assertEquals(
+            $fields,
+            $doc->getFields()
+        );
+
+        $this->assertEquals(
+            2.7,
+            $doc->getFieldBoost('name')
+        );
+    }
+
+    public function testAddFieldNoBoost()
+    {
+        $this->_doc->addField('myfield', 'myvalue');
+
+        $expectedFields = $this->_fields;
+        $expectedFields['myfield'] = 'myvalue';
+
+        $this->assertEquals(
+            $expectedFields,
+            $this->_doc->getFields()
+        );
+    }
+
+    public function testAddFieldWithBoost()
+    {
+        $this->_doc->addField('myfield', 'myvalue', 2.3);
+
+        $expectedFields = $this->_fields;
+        $expectedFields['myfield'] = 'myvalue';
+
+        $this->assertEquals(
+            $expectedFields,
+            $this->_doc->getFields()
+        );
+
+        $this->assertEquals(
+            2.3,
+            $this->_doc->getFieldBoost('myfield')
+        );
+    }
+
+    public function testAddFieldMultivalue()
+    {
+        $this->_doc->addField('myfield', 'myvalue');
+
+        $expectedFields = $this->_fields;
+        $expectedFields['myfield'] = 'myvalue';
+
+        $this->assertEquals(
+            $expectedFields,
+            $this->_doc->getFields()
+        );
+
+        $this->_doc->addField('myfield', 'mysecondvalue');
+
+        $expectedFields['myfield'] = array('myvalue','mysecondvalue');
+
+        $this->assertEquals(
+            $expectedFields,
+            $this->_doc->getFields()
+        );
+    }
+
+    public function testSetField()
+    {
+        $this->_doc->setField('name', 'newname');
+
+        $expectedFields = $this->_fields;
+        $expectedFields['name'] = 'newname';
+        
+        $this->assertEquals(
+            $expectedFields,
+            $this->_doc->getFields()
+        );
+    }
+
+    public function testSetFieldWithFalsyValue()
+    {
+        $falsy_value = '';
+        $this->_doc->setField('name', $falsy_value);
+ 
+        $expectedFields = $this->_fields;
+        $expectedFields['name'] = $falsy_value;
+ 
+        $this->assertEquals(
+            $expectedFields,
+            $this->_doc->getFields()
+        );
+    }
+
+    public function testRemoveField()
+    {
+        $this->_doc->removeField('name');
+
+        $expectedFields = $this->_fields;
+        unset($expectedFields['name']);
+
+        $this->assertEquals(
+            $expectedFields,
+            $this->_doc->getFields()
+        );
+    }
+
+    public function testRemoveFieldBySettingToNull()
+    {
+        $this->_doc->setField('name', NULL);
+
+        $expectedFields = $this->_fields;
+        unset($expectedFields['name']);
+
+        $this->assertEquals(
+            $expectedFields,
+            $this->_doc->getFields()
+        );
+    }
+
+    public function testRemoveFieldBoostRemoval()
+    {
+        $this->_doc->setFieldBoost('name',3.2);
+        $this->_doc->removeField('name');
+
+        $this->assertEquals(
+            null,
+            $this->_doc->getFieldBoost('name')
+        );
+    }
+
+
+    public function testRemoveInvalidField()
+    {
+        $this->_doc->removeField('invalidname'); //should silently continue...
+
+        $this->assertEquals(
+            $this->_fields,
+            $this->_doc->getFields()
+        );
+    }
+
+    public function testSetAndGetFieldBoost()
+    {
+        $this->_doc->setFieldBoost('name',2.5);
+        $this->assertEquals(
+            2.5,
+            $this->_doc->getFieldBoost('name')
+        );
+    }
+
+    public function testGetInvalidFieldBoost()
+    {
+        $this->assertEquals(
+            null,
+            $this->_doc->getFieldBoost('invalidname')
+        );
+    }
+
+    public function testSetAndGetBoost()
+    {
+        $this->_doc->setBoost(2.5);
+        $this->assertEquals(
+            2.5,
+            $this->_doc->getBoost()
+        );
+    }
+
+    public function testSetAndGetFieldByProperty()
+    {
+        $this->_doc->name = 'new name';
+
+        $this->assertEquals(
+            'new name',
+            $this->_doc->name
+        );
+    }
+
+    public function testSetAndGetMultivalueFieldByProperty()
+    {
+        $values = array('test1', 'test2', 'test3');
+        $this->_doc->multivaluefield = $values;
+
+        $this->assertEquals(
+            $values,
+            $this->_doc->multivaluefield
+        );
+    }
+
+    public function testSetAndGetMultivalueFieldByPropertyOverwrite()
+    {
+        $values = array('test1', 'test2', 'test3');
+        $this->_doc->name = $values;
+
+        $this->assertEquals(
+            $values,
+            $this->_doc->name
+        );
+    }
+
+    public function testUnsetFieldByProperty()
+    {
+        unset($this->_doc->name);
+
+        $expectedFields = $this->_fields;
+        unset($expectedFields['name']);
+
+        $this->assertEquals(
+            $expectedFields,
+            $this->_doc->getFields()
+        );
+    }
+
+    public function testSetFieldAsArray()
+    {
+        $this->_doc['name'] = 'newname';
+
+        $expectedFields = $this->_fields;
+        $expectedFields['name'] = 'newname';
+
+        $this->assertEquals(
+            $expectedFields,
+            $this->_doc->getFields()
+        );
+    }
+
+    public function testRemoveFieldAsArray()
+    {
+        unset($this->_doc['name']);
+
+        $expectedFields = $this->_fields;
+        unset($expectedFields['name']);
+
+        $this->assertEquals(
+            $expectedFields,
+            $this->_doc->getFields()
+        );
+    }
+
+    public function testClearFields()
+    {
+        $this->_doc->clear();
+
+        $expectedFields = array();
+
+        $this->assertEquals(
+            $expectedFields,
+            $this->_doc->getFields()
+        );
+    }
+
+    public function testClearFieldsBoostRemoval()
+    {
+        $this->_doc->setFieldBoost('name', 3.2);
+        $this->_doc->clear();
+
+        $expectedFields = array();
+
+        $this->assertEquals(
+            null,
+            $this->_doc->getFieldBoost('name')
+        );
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/PrefetchIteratorTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/PrefetchIteratorTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/PrefetchIteratorTest.php	(revision 7576)
@@ -0,0 +1,120 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Plugin_PrefetchIteratorTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Solarium_Plugin_PrefetchIterator
+     */
+    protected $_plugin;
+
+    /**
+     * @var Solarium_Client
+     */
+    protected $_client;
+
+    /**
+     * @var Solarium_Query_Select
+     */
+    protected $_query;
+
+
+    public function setUp()
+    {
+        $this->_plugin = new Solarium_Plugin_PrefetchIterator();
+
+        $this->_client = new Solarium_Client();
+        $this->_query = $this->_client->createSelect();
+
+    }
+
+    public function testSetAndGetPrefetch()
+    {
+        $this->_plugin->setPrefetch(120);
+        $this->assertEquals(120, $this->_plugin->getPrefetch());
+    }
+
+    public function testSetAndGetQuery()
+    {
+        $this->_plugin->setQuery($this->_query);
+        $this->assertEquals($this->_query, $this->_plugin->getQuery());
+    }
+
+    public function testCount()
+    {
+        $result = $this->_getResult();
+        $mockClient = $this->getMock('Solarium_Client', array('execute'));
+        $mockClient->expects($this->exactly(1))->method('execute')->will($this->returnValue($result));
+
+        $this->_plugin->init($mockClient, array());
+        $this->_plugin->setQuery($this->_query);
+        $this->assertEquals(5, count($this->_plugin));
+    }
+
+    public function testIteratorAndRewind()
+    {
+        $result = $this->_getResult();
+        $mockClient = $this->getMock('Solarium_Client', array('execute'));
+        $mockClient->expects($this->exactly(1))->method('execute')->will($this->returnValue($result));
+
+        $this->_plugin->init($mockClient, array());
+        $this->_plugin->setQuery($this->_query);
+
+        $results1 = array();
+        foreach($this->_plugin as $doc) {
+            $results1[] = $doc;
+        }
+
+        // the second foreach will trigger a rewind, this time include keys
+        $results2 = array();
+        foreach($this->_plugin as $key => $doc) {
+            $results2[$key] = $doc;
+        }
+
+        $this->assertEquals($result->getDocuments(), $results1);
+        $this->assertEquals($result->getDocuments(), $results2);
+    }
+
+    public function _getResult()
+    {
+        $numFound = 5;
+
+        $docs = array(
+            new Solarium_Document_ReadOnly(array('id'=>1,'title'=>'doc1')),
+            new Solarium_Document_ReadOnly(array('id'=>2,'title'=>'doc2')),
+            new Solarium_Document_ReadOnly(array('id'=>3,'title'=>'doc3')),
+            new Solarium_Document_ReadOnly(array('id'=>4,'title'=>'doc4')),
+            new Solarium_Document_ReadOnly(array('id'=>5,'title'=>'doc5')),
+        );
+
+        return new Solarium_Result_SelectDummy(1, 12, $numFound, $docs, array());
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/BufferedAddTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/BufferedAddTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/BufferedAddTest.php	(revision 7576)
@@ -0,0 +1,166 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Plugin_BufferedAddTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Solarium_Plugin_BufferedAdd
+     */
+    protected $_plugin;
+
+    public function setUp()
+    {
+        $this->_plugin = new Solarium_Plugin_BufferedAdd();
+        $this->_plugin->init(new Solarium_Client(), array());
+    }
+
+    public function testSetAndGetBufferSize()
+    {
+        $this->_plugin->setBufferSize(500);
+        $this->assertEquals(500, $this->_plugin->getBufferSize());
+    }
+
+    public function testAddDocument()
+    {
+        $doc = new Solarium_Document_ReadWrite();
+        $doc->id = '123';
+        $doc->name = 'test';
+
+        $this->_plugin->addDocument($doc);
+
+        $this->assertEquals(array($doc), $this->_plugin->getDocuments());
+    }
+
+    public function testCreateDocument()
+    {
+        $data = array('id' => '123', 'name' => 'test');
+        $doc = new Solarium_Document_ReadWrite($data);
+
+        $this->_plugin->createDocument($data);
+
+        $this->assertEquals(array($doc), $this->_plugin->getDocuments());
+    }
+
+    public function testAddDocuments()
+    {
+        $doc1 = new Solarium_Document_ReadWrite();
+        $doc1->id = '123';
+        $doc1->name = 'test';
+
+        $doc2 = new Solarium_Document_ReadWrite();
+        $doc2->id = '234';
+        $doc2->name = 'test2';
+
+        $docs = array($doc1, $doc2);
+
+        $this->_plugin->addDocuments($docs);
+
+        $this->assertEquals($docs, $this->_plugin->getDocuments());
+    }
+
+    public function testAddDocumentAutoFlush()
+    {
+        $observer = $this->getMock('Solarium_Plugin_BufferedAdd', array('flush'));
+        $observer->expects($this->once())->method('flush');
+        $observer->setBufferSize(1);
+
+        $doc1 = new Solarium_Document_ReadWrite();
+        $doc1->id = '123';
+        $doc1->name = 'test';
+
+        $doc2 = new Solarium_Document_ReadWrite();
+        $doc2->id = '234';
+        $doc2->name = 'test2';
+
+        $docs = array($doc1, $doc2);
+
+        $observer->addDocuments($docs);
+    }
+
+    public function testClear()
+    {
+        $doc = new Solarium_Document_ReadWrite();
+        $doc->id = '123';
+        $doc->name = 'test';
+
+        $this->_plugin->addDocument($doc);
+        $this->_plugin->clear();
+
+        $this->assertEquals(array(), $this->_plugin->getDocuments());
+    }
+
+    public function testFlushEmptyBuffer()
+    {
+        $this->assertEquals(false, $this->_plugin->flush());
+    }
+
+    public function testFlush()
+    {
+        $data = array('id' => '123', 'name' => 'test');
+        $doc = new Solarium_Document_ReadWrite($data);
+
+        $mockUpdate = $this->getMock('Solarium_Query_Update', array('addDocuments'));
+        $mockUpdate->expects($this->once())->method('addDocuments')->with($this->equalTo(array($doc)),$this->equalTo(true),$this->equalTo(12));
+
+        $mockClient = $this->getMock('Solarium_Client', array('createUpdate', 'update', 'triggerEvent'));
+        $mockClient->expects($this->exactly(2))->method('createUpdate')->will($this->returnValue($mockUpdate));
+        $mockClient->expects($this->once())->method('update')->will($this->returnValue('dummyResult'));
+        $mockClient->expects($this->exactly(2))->method('triggerEvent');
+
+        $plugin = new Solarium_Plugin_BufferedAdd();
+        $plugin->init($mockClient, array());
+        $plugin->addDocument($doc);
+
+        $this->assertEquals('dummyResult', $plugin->flush(true,12));
+    }
+
+    public function testCommit()
+    {
+        $data = array('id' => '123', 'name' => 'test');
+        $doc = new Solarium_Document_ReadWrite($data);
+
+        $mockUpdate = $this->getMock('Solarium_Query_Update', array('addDocuments', 'addCommit'));
+        $mockUpdate->expects($this->once())->method('addDocuments')->with($this->equalTo(array($doc)),$this->equalTo(true));
+        $mockUpdate->expects($this->once())->method('addCommit')->with($this->equalTo(false),$this->equalTo(true),$this->equalTo(false));
+
+        $mockClient = $this->getMock('Solarium_Client', array('createUpdate', 'update', 'triggerEvent'));
+        $mockClient->expects($this->exactly(2))->method('createUpdate')->will($this->returnValue($mockUpdate));
+        $mockClient->expects($this->once())->method('update')->will($this->returnValue('dummyResult'));
+        $mockClient->expects($this->exactly(2))->method('triggerEvent');
+
+        $plugin = new Solarium_Plugin_BufferedAdd();
+        $plugin->init($mockClient, array());
+        $plugin->addDocument($doc);
+
+        $this->assertEquals('dummyResult', $plugin->commit(true, false, true, false));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/CustomizeRequestTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/CustomizeRequestTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/CustomizeRequestTest.php	(revision 7576)
@@ -0,0 +1,413 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Plugin_CustomizeRequestTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Solarium_Plugin_CustomizeRequest
+     */
+    protected $_plugin;
+
+    public function setUp()
+    {
+        $this->_plugin = new Solarium_Plugin_CustomizeRequest();
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'customization' => array(
+                array(
+                    'key' => 'auth',
+                    'type' => 'header',
+                    'name' => 'X-my-auth',
+                    'value' => 'mypassword',
+                    'persistent' => true
+                ),
+                'id' => array(
+                    'type' => 'param',
+                    'name' => 'id',
+                    'value' => '1234',
+                    'persistent' => false,
+                    'overwrite' => false,
+                ),
+            )
+        );
+
+        $this->_plugin->setOptions($options);
+
+        $auth = $this->_plugin->getCustomization('auth');
+        $id = $this->_plugin->getCustomization('id');
+
+        $this->assertThat($auth, $this->isInstanceOf('Solarium_Plugin_CustomizeRequest_Customization'));
+        $this->assertEquals('auth', $auth->getKey());
+        $this->assertEquals('header', $auth->getType());
+        $this->assertEquals('X-my-auth', $auth->getName());
+        $this->assertEquals('mypassword', $auth->getValue());
+        $this->assertEquals(true, $auth->getPersistent());
+
+        $this->assertThat($id, $this->isInstanceOf('Solarium_Plugin_CustomizeRequest_Customization'));
+        $this->assertEquals('id', $id->getKey());
+        $this->assertEquals('param', $id->getType());
+        $this->assertEquals('id', $id->getName());
+        $this->assertEquals('1234', $id->getValue());
+        $this->assertEquals(false, $id->getPersistent());
+        $this->assertEquals(false, $id->getOverwrite());
+    }
+
+    public function testCreateCustomization()
+    {
+        $customization = $this->_plugin->createCustomization('id1');
+
+        $this->assertEquals(
+            $customization,
+            $this->_plugin->getCustomization('id1')
+        );
+    }
+
+    public function testCreateCustomizationWithArray()
+    {
+        $input = array(
+            'key' => 'auth',
+            'type' => 'header',
+            'name' => 'X-my-auth',
+            'value' => 'mypassword',
+            'persistent' => true
+        );
+        $customization = $this->_plugin->createCustomization($input);
+
+        $this->assertEquals($customization, $this->_plugin->getCustomization('auth'));
+        $this->assertEquals($input['key'], $customization->getKey());
+        $this->assertEquals($input['type'], $customization->getType());
+        $this->assertEquals($input['name'], $customization->getName());
+        $this->assertEquals($input['value'], $customization->getValue());
+        $this->assertEquals($input['persistent'], $customization->getPersistent());
+    }
+
+    public function testAddAndGetCustomization()
+    {
+        $customization = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization->setKey('id1');
+        $this->_plugin->addCustomization($customization);
+
+        $this->assertEquals(
+            $customization,
+            $this->_plugin->getCustomization('id1')
+        );
+    }
+
+    public function testAddAndGetCustomizationWithKey()
+    {
+        $key = 'id1';
+
+        $customization = $this->_plugin->createCustomization($key);
+
+        $this->assertEquals(
+            $key,
+            $customization->getKey()
+        );
+
+        $this->assertEquals(
+            $customization,
+            $this->_plugin->getCustomization($key)
+        );
+    }
+
+    public function testAddCustomizationWithoutKey()
+    {
+        $customization = new Solarium_Plugin_CustomizeRequest_Customization;;
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_plugin->addCustomization($customization);
+    }
+
+    public function testAddCustomizationWithUsedKey()
+    {
+        $customization1 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization1->setKey('id1')->setName('test1');
+
+        $customization2 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization2->setKey('id1')->setName('test2');
+
+        $this->_plugin->addCustomization($customization1);
+        $this->setExpectedException('Solarium_Exception');
+        $this->_plugin->addCustomization($customization2);
+    }
+
+    public function testAddDuplicateCustomizationWith()
+    {
+        $customization = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization->setKey('id1')->setName('test1');
+
+        $this->_plugin->addCustomization($customization);
+        $this->_plugin->addCustomization($customization);
+
+        $this->assertEquals(
+            $customization,
+            $this->_plugin->getCustomization('id1')
+        );
+    }
+
+    public function testGetInvalidCustomization()
+    {
+        $this->assertEquals(
+            null,
+            $this->_plugin->getCustomization('invalidkey')
+        );
+    }
+
+    public function testAddCustomizations()
+    {
+        $customization1 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization1->setKey('id1')->setName('test1');
+
+        $customization2 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization2->setKey('id2')->setName('test2');
+
+        $customizations = array('id1' => $customization1, 'id2' => $customization2);
+
+        $this->_plugin->addCustomizations($customizations);
+        $this->assertEquals(
+            $customizations,
+            $this->_plugin->getCustomizations()
+        );
+    }
+
+    public function testRemoveCustomization()
+    {
+        $customization1 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization1->setKey('id1')->setName('test1');
+
+        $customization2 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization2->setKey('id2')->setName('test2');
+
+        $customizations = array($customization1, $customization2);
+
+        $this->_plugin->addCustomizations($customizations);
+        $this->_plugin->removeCustomization('id1');
+        $this->assertEquals(
+            array('id2' => $customization2),
+            $this->_plugin->getCustomizations()
+        );
+    }
+
+    public function testRemoveCustomizationWithObjectInput()
+    {
+        $customization1 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization1->setKey('id1')->setName('test1');
+
+        $customization2 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization2->setKey('id2')->setName('test2');
+
+        $customizations = array($customization1, $customization2);
+
+        $this->_plugin->addCustomizations($customizations);
+        $this->_plugin->removeCustomization($customization1);
+        $this->assertEquals(
+            array('id2' => $customization2),
+            $this->_plugin->getCustomizations()
+        );
+    }
+
+    public function testRemoveInvalidCustomization()
+    {
+        $customization1 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization1->setKey('id1')->setName('test1');
+
+        $customization2 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization2->setKey('id2')->setName('test2');
+
+        $customizations = array('id1' => $customization1, 'id2' => $customization2);
+
+        $this->_plugin->addCustomizations($customizations);
+        $this->_plugin->removeCustomization('id3'); //continue silently
+        $this->assertEquals(
+            $customizations,
+            $this->_plugin->getCustomizations()
+        );
+    }
+
+    public function testClearCustomizations()
+    {
+        $customization1 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization1->setKey('id1')->setName('test1');
+
+        $customization2 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization2->setKey('id2')->setName('test2');
+
+        $customizations = array($customization1, $customization2);
+
+        $this->_plugin->addCustomizations($customizations);
+        $this->_plugin->clearCustomizations();
+        $this->assertEquals(
+            array(),
+            $this->_plugin->getCustomizations()
+        );
+    }
+
+    public function testSetCustomizations()
+    {
+        $customization1 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization1->setKey('id1')->setName('test1');
+
+        $customization2 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization2->setKey('id2')->setName('test2');
+
+        $customizations1 = array('id1' => $customization1, 'id2' => $customization2);
+
+        $this->_plugin->addCustomizations($customizations1);
+
+        $customization3 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization3->setKey('id3')->setName('test3');
+
+        $customization4 = new Solarium_Plugin_CustomizeRequest_Customization;
+        $customization4->setKey('id4')->setName('test4');
+
+        $customizations2 = array('id3' => $customization3, 'id4' => $customization4);
+
+        $this->_plugin->setCustomizations($customizations2);
+
+        $this->assertEquals(
+            $customizations2,
+            $this->_plugin->getCustomizations()
+        );
+    }
+
+    public function testPostCreateRequestWithHeaderAndParam()
+    {
+        $input = array(
+                    'key' => 'xid',
+                    'type' => 'param',
+                    'name' => 'xid',
+                    'value' => 123,
+                );
+        $this->_plugin->addCustomization($input);
+
+        $input = array(
+                    'key' => 'auth',
+                    'type' => 'header',
+                    'name' => 'X-my-auth',
+                    'value' => 'mypassword',
+                    'persistent' => true
+                );
+        $this->_plugin->addCustomization($input);
+
+        $request = new Solarium_Client_Request();
+        $this->_plugin->postCreateRequest(null, $request);
+
+        $this->assertEquals(
+            123,
+            $request->getParam('xid')
+        );
+
+        $this->assertEquals(
+            array('X-my-auth: mypassword'),
+            $request->getHeaders()
+        );
+    }
+
+    public function testPostCreateRequestWithInvalidCustomization()
+    {
+        $input = array(
+            'key' => 'xid',
+            'type' => 'invalid',
+            'name' => 'xid',
+            'value' => 123,
+        );
+        $this->_plugin->addCustomization($input);
+
+        $request = new Solarium_Client_Request();
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_plugin->postCreateRequest(null, $request);
+    }
+
+    public function testPostCreateRequestWithoutCustomizations()
+    {
+        $request = new Solarium_Client_Request();
+        $originalRequest = clone $request;
+
+        $this->_plugin->postCreateRequest(null, $request);
+
+        $this->assertEquals(
+            $originalRequest,
+            $request
+        );
+    }
+
+    public function testPostCreateRequestWithPersistentAndNonPersistentCustomizations()
+    {
+        $input = array(
+                    'key' => 'xid',
+                    'type' => 'param',
+                    'name' => 'xid',
+                    'value' => 123,
+                );
+        $this->_plugin->addCustomization($input);
+
+        $input = array(
+                    'key' => 'auth',
+                    'type' => 'header',
+                    'name' => 'X-my-auth',
+                    'value' => 'mypassword',
+                    'persistent' => true
+                );
+        $this->_plugin->addCustomization($input);
+
+        $request = new Solarium_Client_Request();
+        $this->_plugin->postCreateRequest(null, $request);
+
+        $this->assertEquals(
+            123,
+            $request->getParam('xid')
+        );
+
+        $this->assertEquals(
+            array('X-my-auth: mypassword'),
+            $request->getHeaders()
+        );
+
+        // second use, only the header should be persistent
+        $request = new Solarium_Client_Request();
+        $this->_plugin->postCreateRequest(null, $request);
+
+        $this->assertEquals(
+            null,
+            $request->getParam('xid')
+        );
+
+        $this->assertEquals(
+            array('X-my-auth: mypassword'),
+            $request->getHeaders()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/ParallelExecutionTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/ParallelExecutionTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/ParallelExecutionTest.php	(revision 7576)
@@ -0,0 +1,90 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Plugin_ParallelExecutionTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Solarium_Plugin_ParallelExecution
+     */
+    protected $_plugin;
+
+    public function setUp()
+    {
+        $this->_plugin = new Solarium_Plugin_ParallelExecution();
+
+    }
+
+    public function testAddAndGetQueries()
+    {
+        $client1 = new Solarium_Client();
+        $client2 = new Solarium_Client(array(
+            'adapter' => 'MyAdapter',
+                    'adapteroptions' => array(
+                        'host' => 'myhost',
+                    )
+            )
+        );
+        $this->_plugin->init($client1, array());
+
+        $query1 = $client1->createSelect()->setQuery('test1');
+        $query2 = $client1->createSelect()->setQuery('test2');
+
+        $this->_plugin->addQuery(1, $query1);
+        $this->_plugin->addQuery(2, $query2, $client2);
+
+        $this->assertEquals(
+            array(
+                1 => array('query' => $query1, 'client' => $client1),
+                2 => array('query' => $query2, 'client' => $client2),
+            ),
+            $this->_plugin->getQueries()
+        );
+    }
+
+    public function testClearQueries()
+        {
+            $client = new Solarium_Client();
+            $this->_plugin->init($client, array());
+
+            $query1 = $client->createSelect()->setQuery('test1');
+            $query2 = $client->createSelect()->setQuery('test2');
+
+            $this->_plugin->addQuery(1, $query1);
+            $this->_plugin->addQuery(2, $query2);
+            $this->_plugin->clearQueries();
+
+            $this->assertEquals(
+                array(),
+                $this->_plugin->getQueries()
+            );
+        }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/PostBigRequestTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/PostBigRequestTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/PostBigRequestTest.php	(revision 7576)
@@ -0,0 +1,105 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Plugin_PostBigRequestTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Solarium_Plugin_PostBigRequest
+     */
+    protected $_plugin;
+
+    /**
+     * @var Solarium_Client
+     */
+    protected $_client;
+
+    /**
+     * @var Solarium_Query_Select
+     */
+    protected $query;
+
+    public function setUp()
+    {
+        $this->_plugin = new Solarium_Plugin_PostBigRequest();
+
+        $this->_client = new Solarium_Client();
+        $this->_query = $this->_client->createSelect();
+
+    }
+
+    public function testSetAndGetMaxQueryStringLength()
+    {
+        $this->_plugin->setMaxQueryStringLength(512);
+        $this->assertEquals(512, $this->_plugin->getMaxQueryStringLength());
+    }
+
+    public function testPostCreateRequest()
+    {
+        // create a very long query
+        $fq = '';
+        for($i=1; $i<=1000; $i++) {
+           $fq .= ' OR price:'.$i;
+        }
+        $fq = substr($fq, 4);
+        $this->_query->createFilterQuery('fq')->setQuery($fq);
+
+        $requestOutput = $this->_client->createRequest($this->_query);
+        $requestInput = clone $requestOutput;
+        $this->_plugin->postCreateRequest($this->_query, $requestOutput);
+
+        $this->assertEquals(Solarium_Client_Request::METHOD_GET, $requestInput->getMethod());
+        $this->assertEquals(Solarium_Client_Request::METHOD_POST, $requestOutput->getMethod());
+        $this->assertEquals($requestInput->getQueryString(), $requestOutput->getRawData());
+        $this->assertEquals('', $requestOutput->getQueryString());
+    }
+
+    public function testPostCreateRequestUnalteredSmallRequest()
+    {
+        $requestOutput = $this->_client->createRequest($this->_query);
+        $requestInput = clone $requestOutput;
+        $this->_plugin->postCreateRequest($this->_query, $requestOutput);
+
+        $this->assertEquals($requestInput, $requestOutput);
+    }
+
+    public function testPostCreateRequestUnalteredPostRequest()
+    {
+        $query = $this->_client->createUpdate();
+        $query->addDeleteById(1);
+
+        $requestOutput = $this->_client->createRequest($query);
+        $requestInput = clone $requestOutput;
+        $this->_plugin->postCreateRequest($query, $requestOutput);
+
+        $this->assertEquals($requestInput, $requestOutput);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/Loadbalancer/WeightedRandomChoiceTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/Loadbalancer/WeightedRandomChoiceTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/Loadbalancer/WeightedRandomChoiceTest.php	(revision 7576)
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Plugin_Loadbalancer_WeightedRandomChoiceTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testGetRandom()
+    {
+        $choices = array('key1' => 1, 'key2' => 2, 'key3' => 3);
+
+        $randomizer = new Solarium_Plugin_Loadbalancer_WeightedRandomChoice($choices);
+        $choice = $randomizer->getRandom();
+
+        $this->assertTrue(
+            array_key_exists($choice, $choices)
+        );
+
+        $counts = array('key1' => 0, 'key2' => 0, 'key3' => 0);
+        for ($i = 0; $i<1000; $i++) {
+            $choice = $randomizer->getRandom();
+            $counts[$choice]++;
+        }
+
+        $this->assertTrue($counts['key1'] < $counts['key2']);
+        $this->assertTrue($counts['key2'] < $counts['key3']);
+    }
+
+    public function testGetRandomWithExclude()
+    {
+        $choices = array('key1' => 1, 'key2' => 1, 'key3' => 300);
+        $excludes = array('key3');
+
+        $randomizer = new Solarium_Plugin_Loadbalancer_WeightedRandomChoice($choices);
+
+        $key = $randomizer->getRandom($excludes);
+
+        $this->assertTrue($key !== 'key3');
+    }
+
+    public function testAllEntriesExcluded()
+    {
+        $choices = array('key1' => 1, 'key2' => 2, 'key3' => 3);
+        $excludes = array_keys($choices);
+
+        $randomizer = new Solarium_Plugin_Loadbalancer_WeightedRandomChoice($choices);
+
+        $this->setExpectedException('Solarium_Exception');
+        $randomizer->getRandom($excludes);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/AbstractTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/AbstractTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/AbstractTest.php	(revision 7576)
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Plugin_AbstractTest extends PHPUnit_Framework_TestCase
+{
+    protected $_plugin, $_client, $_options;
+
+    public function setUp()
+    {
+        $this->_client = 'dummy';
+        $this->_options = array('option1' => 1);
+        $this->_plugin = new MyPlugin();
+        $this->_plugin->init($this->_client, $this->_options);
+    }
+
+    public function testConstructor()
+    {
+       $this->assertEquals(
+            $this->_client,
+            $this->_plugin->getClient()
+        );
+
+        $this->assertEquals(
+            $this->_options,
+            $this->_plugin->getOptions()
+        );
+    }
+
+
+    public function testEventHooksEmpty()
+    {
+        $this->assertEquals(null, $this->_plugin->preCreateRequest(null));
+        $this->assertEquals(null, $this->_plugin->postCreateRequest(null,null));
+        $this->assertEquals(null, $this->_plugin->preExecuteRequest(null));
+        $this->assertEquals(null, $this->_plugin->postExecuteRequest(null,null));
+        $this->assertEquals(null, $this->_plugin->preExecute(null));
+        $this->assertEquals(null, $this->_plugin->postExecute(null,null));
+        $this->assertEquals(null, $this->_plugin->preCreateResult(null,null));
+        $this->assertEquals(null, $this->_plugin->postCreateResult(null,null,null));
+        $this->assertEquals(null, $this->_plugin->preCreateQuery(null,null));
+        $this->assertEquals(null, $this->_plugin->postCreateQuery(null,null,null));
+    }
+
+}
+
+class MyPlugin extends Solarium_Plugin_Abstract{
+
+    public function getClient()
+    {
+        return $this->_client;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/CustomizeRequest/CustomizeRequestTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/CustomizeRequest/CustomizeRequestTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/CustomizeRequest/CustomizeRequestTest.php	(revision 7576)
@@ -0,0 +1,115 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Plugin_CustomizeRequest_CustomizationTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Plugin_CustomizeRequest_Customization
+     */
+    protected $_instance;
+
+    public function setUp()
+    {
+        $this->_instance = new Solarium_Plugin_CustomizeRequest_Customization();
+    }
+
+    public function testSetAndGetKey()
+    {
+        $value = 'mykey';
+        $this->_instance->setKey($value);
+        $this->assertEquals($value, $this->_instance->getKey());
+    }
+
+    public function testSetAndGetName()
+    {
+        $value = 'myname';
+        $this->_instance->setName($value);
+        $this->assertEquals($value, $this->_instance->getName());
+    }
+
+    public function testSetAndGetType()
+    {
+        $value = 'mytype';
+        $this->_instance->setType($value);
+        $this->assertEquals($value, $this->_instance->getType());
+    }
+
+    public function testSetAndGetValue()
+    {
+        $value = 'myvalue';
+        $this->_instance->setValue($value);
+        $this->assertEquals($value, $this->_instance->getValue());
+    }
+
+    public function testSetAndGetPersistence()
+    {
+        $value = true;
+        $this->_instance->setPersistent($value);
+        $this->assertEquals($value, $this->_instance->getPersistent());
+    }
+
+    public function testSetAndGetOverwrite()
+    {
+        $value = false;
+        $this->_instance->setOverwrite($value);
+        $this->assertEquals($value, $this->_instance->getOverwrite());
+    }
+
+    public function testIsValid()
+    {
+        $this->_instance->setKey('mykey');
+        $this->_instance->setType('param');
+        $this->_instance->setName('myname');
+        $this->_instance->setValue('myvalue');
+        $this->assertTrue($this->_instance->isValid());
+    }
+
+    public function testIsValidWithInvalidType()
+    {
+        $this->_instance->setKey('mykey');
+        $this->_instance->setType('mytype');
+        $this->_instance->setName('myname');
+        $this->_instance->setValue('myvalue');
+
+        $this->assertFalse($this->_instance->isValid());
+    }
+
+    public function testIsValidWithMissingValue()
+    {
+        $this->_instance->setKey('mykey');
+        $this->_instance->setType('param');
+        $this->_instance->setName('myname');
+
+        $this->assertFalse($this->_instance->isValid());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/LoadbalancerTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/LoadbalancerTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Plugin/LoadbalancerTest.php	(revision 7576)
@@ -0,0 +1,477 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Plugin_LoadbalancerTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Solarium_Plugin_Loadbalancer
+     */
+    protected $_plugin;
+
+    /**
+     * @var Solarium_Client
+     */
+    protected $_client;
+
+    protected $_serverOptions = array('host' => 'nonexistinghostname');
+
+    public function setUp()
+    {
+        $this->_plugin = new Solarium_Plugin_Loadbalancer();
+
+        $this->_client = new Solarium_Client();
+        $adapter = $this->getMock('Solarium_Client_Adapter_Http');
+        $adapter->expects($this->any())
+            ->method('execute')
+            ->will($this->returnValue('dummyresult'));
+        $this->_client->setAdapter($adapter);
+        $this->_plugin->init($this->_client, array());
+    }
+
+    public function testConfigMode()
+    {
+        $options = array(
+            'server' => array(
+                'server1' => array(
+                    'options' => array(
+                        'host' => 'host1'
+                    ),
+                    'weight' => 10,
+                ),
+                'server2' => array(
+                    'options' => array(
+                        'host' => 'host2'
+                    ),
+                    'weight' => 5,
+                ),
+            ),
+            'blockedquerytype' => array(Solarium_Client::QUERYTYPE_UPDATE, Solarium_Client::QUERYTYPE_MORELIKETHIS)
+        );
+
+        $this->_plugin->setOptions($options);
+
+        $this->assertEquals(
+            array(
+                'server1' => array(
+                    'options' => array('host' => 'host1'),
+                    'weight' => 10,
+                ),
+                'server2' => array(
+                    'options' => array('host' => 'host2'),
+                    'weight' => 5,
+                )
+            ),
+            $this->_plugin->getServers()
+        );
+
+        $this->assertEquals(
+            array(Solarium_Client::QUERYTYPE_UPDATE, Solarium_Client::QUERYTYPE_MORELIKETHIS),
+            $this->_plugin->getBlockedQueryTypes()
+        );
+    }
+
+    public function testSetAndGetFailoverEnabled()
+    {
+        $this->_plugin->setFailoverEnabled(true);
+        $this->assertEquals(true, $this->_plugin->getFailoverEnabled());
+    }
+
+    public function testSetAndGetFailoverMaxRetries()
+    {
+        $this->_plugin->setFailoverMaxRetries(16);
+        $this->assertEquals(16, $this->_plugin->getFailoverMaxRetries());
+    }
+
+    public function testAddServer()
+    {
+        $this->_plugin->addServer('s1', $this->_serverOptions, 10);
+
+        $this->assertEquals(
+            array('s1' =>
+                array(
+                    'options' => $this->_serverOptions,
+                    'weight' => 10,
+                )
+            ),
+            $this->_plugin->getServers()
+        );
+    }
+
+    public function testAddServerWithDuplicateKey()
+    {
+        $this->_plugin->addServer('s1', $this->_serverOptions, 10);
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_plugin->addServer('s1', $this->_serverOptions, 20);
+    }
+
+    public function testGetServer()
+    {
+        $this->_plugin->addServer('s1', $this->_serverOptions, 10);
+
+        $this->assertEquals(
+            array('options' => $this->_serverOptions, 'weight' => 10),
+            $this->_plugin->getServer('s1')
+        );
+    }
+
+    public function testGetInvalidServer()
+    {
+        $this->_plugin->addServer('s1', $this->_serverOptions, 10);
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_plugin->getServer('s2');
+    }
+
+    public function testClearServers()
+    {
+        $this->_plugin->addServer('s1', $this->_serverOptions, 10);
+        $this->_plugin->clearServers();
+        $this->assertEquals(array(), $this->_plugin->getServers());
+    }
+
+    public function testAddServers()
+    {
+        $servers = array(
+            's1' => array('options' => $this->_serverOptions, 'weight' => 10),
+            's2' => array('options' => $this->_serverOptions, 'weight' => 20),
+        );
+
+        $this->_plugin->addServers($servers);
+        $this->assertEquals($servers, $this->_plugin->getServers());
+    }
+
+    public function testRemoveServer()
+    {
+        $servers = array(
+            's1' => array('options' => $this->_serverOptions, 'weight' => 10),
+            's2' => array('options' => $this->_serverOptions, 'weight' => 20),
+        );
+
+        $this->_plugin->addServers($servers);
+        $this->_plugin->removeServer('s1');
+
+        $this->assertEquals(
+            array('s2' => array('options' => $this->_serverOptions, 'weight' => 20)),
+            $this->_plugin->getServers()
+        );
+    }
+
+    public function testSetServers()
+    {
+        $servers1 = array(
+            's1' => array('options' => $this->_serverOptions, 'weight' => 10),
+            's2' => array('options' => $this->_serverOptions, 'weight' => 20),
+        );
+
+        $servers2 = array(
+            's3' => array('options' => $this->_serverOptions, 'weight' => 50),
+            's4' => array('options' => $this->_serverOptions, 'weight' => 30),
+        );
+
+        $this->_plugin->addServers($servers1);
+        $this->_plugin->setServers($servers2);
+
+        $this->assertEquals(
+            $servers2,
+            $this->_plugin->getServers()
+        );
+    }
+
+    public function testSetAndGetForcedServerForNextQuery()
+    {
+        $servers1 = array(
+            's1' => array('options' => $this->_serverOptions, 'weight' => 10),
+            's2' => array('options' => $this->_serverOptions, 'weight' => 20),
+        );
+        $this->_plugin->addServers($servers1);
+
+        $this->_plugin->setForcedServerForNextQuery('s2');
+        $this->assertEquals('s2', $this->_plugin->getForcedServerForNextQuery());
+    }
+
+    public function testSetForcedServerForNextQueryWithInvalidKey()
+    {
+        $servers1 = array(
+            's1' => array('options' => $this->_serverOptions, 'weight' => 10),
+            's2' => array('options' => $this->_serverOptions, 'weight' => 20),
+        );
+        $this->_plugin->addServers($servers1);
+
+        $this->setExpectedException('Solarium_Exception');
+        $this->_plugin->setForcedServerForNextQuery('s3');
+    }
+
+    public function testAddBlockedQueryType()
+    {
+        $this->_plugin->addBlockedQueryType('type1');
+        $this->_plugin->addBlockedQueryType('type2');
+
+        $this->assertEquals(
+            array(Solarium_Client::QUERYTYPE_UPDATE, 'type1', 'type2'),
+            $this->_plugin->getBlockedQueryTypes()
+        );
+    }
+
+    public function testClearBlockedQueryTypes()
+    {
+        $this->_plugin->addBlockedQueryType('type1');
+        $this->_plugin->addBlockedQueryType('type2');
+        $this->_plugin->clearBlockedQueryTypes();
+        $this->assertEquals(array(), $this->_plugin->getBlockedQueryTypes());
+    }
+
+    public function testAddBlockedQueryTypes()
+    {
+        $blockedQueryTypes = array('type1', 'type2', 'type3');
+
+        $this->_plugin->clearBlockedQueryTypes();
+        $this->_plugin->addBlockedQueryTypes($blockedQueryTypes);
+        $this->assertEquals($blockedQueryTypes, $this->_plugin->getBlockedQueryTypes());
+    }
+
+    public function testRemoveBlockedQueryType()
+    {
+        $blockedQueryTypes = array('type1', 'type2', 'type3');
+
+        $this->_plugin->clearBlockedQueryTypes();
+        $this->_plugin->addBlockedQueryTypes($blockedQueryTypes);
+        $this->_plugin->removeBlockedQueryType('type2');
+
+        $this->assertEquals(
+            array('type1', 'type3'),
+            $this->_plugin->getBlockedQueryTypes()
+        );
+    }
+
+    public function testSetBlockedQueryTypes()
+    {
+        $blockedQueryTypes = array('type1', 'type2', 'type3');
+
+        $this->_plugin->setBlockedQueryTypes($blockedQueryTypes);
+
+        $this->assertEquals(
+            $blockedQueryTypes,
+            $this->_plugin->getBlockedQueryTypes()
+        );
+    }
+
+    public function testPreExecuteRequestWithForcedServer()
+    {
+        $servers = array(
+           's1' => array('options' => $this->_serverOptions, 'weight' => 100),
+           's2' => array('options' => $this->_serverOptions, 'weight' => 1),
+        );
+        $query = new Solarium_Query_Select();
+        $request = new Solarium_Client_Request();
+
+        $this->_plugin->setServers($servers);
+        $this->_plugin->setForcedServerForNextQuery('s2');
+        $this->_plugin->preCreateRequest($query);
+        $this->_plugin->preExecuteRequest($request);
+
+        $this->assertEquals(
+            's2',
+            $this->_plugin->getLastServerKey()
+        );
+    }
+
+    public function testAdapterPresetRestore()
+    {
+        $originalHost = $this->_client->getAdapter()->getHost();
+        $servers = array(
+           's1' => array('options' => $this->_serverOptions, 'weight' => 100),
+           's2' => array('options' => $this->_serverOptions, 'weight' => 1),
+        );
+        $request = new Solarium_Client_Request();
+
+        $this->_plugin->setServers($servers);
+        $this->_plugin->setForcedServerForNextQuery('s2');
+
+        $query = new Solarium_Query_Select();
+        $this->_plugin->preCreateRequest($query);
+        $this->_plugin->preExecuteRequest($request);
+
+        $this->assertEquals(
+            's2',
+            $this->_plugin->getLastServerKey()
+        );
+
+        $query = new Solarium_Query_Update(); // this is a blocked querytype that should trigger a restore
+        $this->_plugin->preCreateRequest($query);
+        $this->_plugin->preExecuteRequest($request);
+
+        $this->assertEquals(
+            $originalHost,
+            $this->_client->getAdapter()->getHost()
+        );
+    }
+
+    public function testBlockedQueryTypeNotLoadbalanced()
+    {
+        $originalHost = $this->_client->getAdapter()->getHost();
+        $servers = array(
+           's1' => array('options' => $this->_serverOptions, 'weight' => 100),
+           's2' => array('options' => $this->_serverOptions, 'weight' => 1),
+        );
+        $this->_plugin->setServers($servers);
+        $request = new Solarium_Client_Request();
+
+        $query = new Solarium_Query_Update(); // this is a blocked querytype that should not be loadbalanced
+        $this->_plugin->preCreateRequest($query);
+        $this->_plugin->preExecuteRequest($request);
+
+        $this->assertEquals(
+            $originalHost,
+            $this->_client->getAdapter()->getHost()
+        );
+
+        $this->assertEquals(
+            null,
+            $this->_plugin->getLastServerKey()
+        );
+    }
+
+    public function testLoadbalancerRandomizing()
+    {
+        $servers = array(
+           's1' => array('options' => $this->_serverOptions, 'weight' => 1),
+           's2' => array('options' => $this->_serverOptions, 'weight' => 1),
+        );
+        $this->_plugin->setServers($servers);
+        $request = new Solarium_Client_Request();
+
+        $query = new Solarium_Query_Select(); //
+        $this->_plugin->preCreateRequest($query);
+        $this->_plugin->preExecuteRequest($request);
+
+        $this->assertTrue(
+            in_array($this->_plugin->getLastServerKey(), array('s1','s2'))
+        );
+    }
+
+    public function testFailover()
+    {
+        $this->_plugin = new TestLoadbalancer(); // special loadbalancer that returns servers in fixed order
+        $this->_client = new Solarium_Client();
+        $this->_client->setAdapter(new TestAdapterForFailover()); // set special mock that fails once
+        $this->_plugin->init($this->_client, array());
+
+        $request = new Solarium_Client_Request();
+        $servers = array(
+           's1' => array('options' => $this->_serverOptions, 'weight' => 1),
+           's2' => array('options' => $this->_serverOptions, 'weight' => 1),
+        );
+        $this->_plugin->setServers($servers);
+        $this->_plugin->setFailoverEnabled(true);
+
+        $query = new Solarium_Query_Select();
+        $this->_plugin->preCreateRequest($query);
+        $this->_plugin->preExecuteRequest($request);
+
+        $this->assertEquals(
+            's2',
+            $this->_plugin->getLastServerKey()
+        );
+    }
+
+    public function testFailoverMaxRetries()
+    {
+        $this->_plugin = new TestLoadbalancer(); // special loadbalancer that returns servers in fixed order
+        $this->_client = new Solarium_Client();
+        $adapter = new TestAdapterForFailover();
+        $adapter->setFailCount(10);
+        $this->_client->setAdapter($adapter); // set special mock that fails for all servers
+        $this->_plugin->init($this->_client, array());
+
+        $request = new Solarium_Client_Request();
+        $servers = array(
+           's1' => array('options' => $this->_serverOptions, 'weight' => 1),
+           's2' => array('options' => $this->_serverOptions, 'weight' => 1),
+        );
+        $this->_plugin->setServers($servers);
+        $this->_plugin->setFailoverEnabled(true);
+
+        $query = new Solarium_Query_Select();
+        $this->_plugin->preCreateRequest($query);
+
+        $this->setExpectedException('Solarium_Exception', 'Maximum number of loadbalancer retries reached');
+
+        $this->_plugin->preExecuteRequest($request);
+    }
+
+
+
+}
+
+class TestLoadbalancer extends Solarium_Plugin_Loadbalancer{
+
+    protected $_counter = 0;
+
+    /**
+     * Get options array for a randomized server
+     *
+     * @return array
+     */
+    protected function _getRandomServerOptions()
+    {
+        $this->_counter++;
+        $serverKey = 's'.$this->_counter;
+
+        $this->_serverExcludes[] = $serverKey;
+        $this->_lastServerKey = $serverKey;
+        return $this->_servers[$serverKey]['options'];
+    }
+
+}
+
+class TestAdapterForFailover extends Solarium_Client_Adapter_Http{
+
+    protected $_counter = 0;
+
+    protected $_failCount = 1;
+
+    public function setFailCount($count)
+    {
+        $this->_failCount = $count;
+    }
+
+    public function execute($request)
+    {
+        $this->_counter++;
+        if($this->_counter <= $this->_failCount) {
+            throw new Solarium_Client_HttpException('failover exception');
+        }
+
+        return 'dummyvalue';
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/MoreLikeThis/ResultTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/MoreLikeThis/ResultTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/MoreLikeThis/ResultTest.php	(revision 7576)
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_MoreLikeThis_ResultTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_MoreLikeThis_Result
+     */
+    protected $_mltResult;
+
+    public function setUp()
+    {
+        $this->_docs = array(
+            new Solarium_Document_ReadOnly(array('id'=>1,'name'=>'test1')),
+            new Solarium_Document_ReadOnly(array('id'=>2,'name'=>'test2')),
+        );
+
+        $this->_mltResult = new Solarium_Result_Select_MoreLikeThis_Result(2, 5.13, $this->_docs);
+    }
+
+    public function testGetNumFound()
+    {
+        $this->assertEquals(2, $this->_mltResult->getNumFound());
+    }
+
+    public function testGetMaximumScore()
+    {
+        $this->assertEquals(5.13, $this->_mltResult->getMaximumScore());
+    }
+
+    public function testGetDocuments()
+    {
+         $this->assertEquals($this->_docs, $this->_mltResult->getDocuments());
+    }
+
+    public function testIterator()
+    {
+        $docs = array();
+        foreach($this->_mltResult AS $key => $doc)
+        {
+            $docs[$key] = $doc;
+        }
+
+        $this->assertEquals($this->_docs, $docs);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_docs), count($this->_mltResult));
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/GroupingTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/GroupingTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/GroupingTest.php	(revision 7576)
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_GroupingTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Grouping
+     */
+    protected $_grouping;
+
+    protected $_items;
+
+    public function setUp()
+    {
+        $this->_items = array(
+            'key1' => 'content1',
+            'key2' => 'content2',
+        );
+        
+        $this->_grouping = new Solarium_Result_Select_Grouping($this->_items);
+    }
+
+    public function testGetGroups()
+    {
+        $this->assertEquals(
+            $this->_items,
+            $this->_grouping->getGroups()
+        );
+    }
+
+    public function testGetGroup()
+    {
+        $this->assertEquals(
+            $this->_items['key1'],
+            $this->_grouping->getGroup('key1')
+        );
+    }
+
+    public function testGetGroupInvalid()
+    {
+        $this->assertEquals(
+            null,
+            $this->_grouping->getGroup('invalidkey')
+        );
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_grouping AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_items, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_items), count($this->_grouping));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Facet/RangeTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Facet/RangeTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Facet/RangeTest.php	(revision 7576)
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Facet_RangeTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Facet_Range
+     */
+    protected $_facet;
+
+    protected $_values, $_before, $_after, $_between;
+
+    public function setUp()
+    {
+        $this->_values = array(
+            '10.0' => 12,
+            '20.0' => 5,
+            '30.0' => 3,
+        );
+        $this->_before = 2;
+        $this->_after = 4;
+        $this->_between = 3;
+
+        $this->_facet = new Solarium_Result_Select_Facet_Range($this->_values, $this->_before, $this->_after, $this->_between);
+    }
+
+    public function testGetValues()
+    {
+        $this->assertEquals($this->_values, $this->_facet->getValues());
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_values), count($this->_facet));
+    }
+
+    public function testIterator()
+    {
+        $values = array();
+        foreach($this->_facet AS $key => $value)
+        {
+            $values[$key] = $value;
+        }
+
+        $this->assertEquals($this->_values, $values);
+    }
+
+    public function testGetBefore()
+    {
+        $this->assertEquals($this->_before, $this->_facet->getBefore());
+    }
+
+    public function testGetAfter()
+    {
+        $this->assertEquals($this->_after, $this->_facet->getAfter());
+    }
+
+    public function testGetBetween()
+    {
+        $this->assertEquals($this->_between, $this->_facet->getBetween());
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Facet/MultiQueryTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Facet/MultiQueryTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Facet/MultiQueryTest.php	(revision 7576)
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Facet_MultiQueryTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_values, $_facet;
+
+    public function setUp()
+    {
+        $this->_values = array(
+            'a' => 12,
+            'b' => 5,
+            'c' => 3,
+        );
+        $this->_facet = new Solarium_Result_Select_Facet_MultiQuery($this->_values);
+    }
+
+    public function testGetValues()
+    {
+        $this->assertEquals($this->_values, $this->_facet->getValues());
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_values), count($this->_facet));
+    }
+
+    public function testIterator()
+    {
+        $values = array();
+        foreach($this->_facet AS $key => $value)
+        {
+            $values[$key] = $value;
+        }
+
+        $this->assertEquals($this->_values, $values);
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Facet/FieldTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Facet/FieldTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Facet/FieldTest.php	(revision 7576)
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Facet_FieldTest extends PHPUnit_Framework_TestCase
+{
+
+    protected $_values, $_facet;
+
+    public function setUp()
+    {
+        $this->_values = array(
+            'a' => 12,
+            'b' => 5,
+            'c' => 3,
+        );
+        $this->_facet = new Solarium_Result_Select_Facet_Field($this->_values);
+    }
+
+    public function testGetValues()
+    {
+        $this->assertEquals($this->_values, $this->_facet->getValues());
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_values), count($this->_facet));
+    }
+
+    public function testIterator()
+    {
+        $values = array();
+        foreach($this->_facet AS $key => $value)
+        {
+            $values[$key] = $value;
+        }
+
+        $this->assertEquals($this->_values, $values);
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Facet/QueryTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Facet/QueryTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Facet/QueryTest.php	(revision 7576)
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Facet_QueryTest extends PHPUnit_Framework_TestCase
+{
+    
+    public function testGetValue()
+    {
+        $facet = new Solarium_Result_Select_Facet_Query(124);
+
+        $this->assertEquals(124, $facet->getValue());
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/SpellcheckTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/SpellcheckTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/SpellcheckTest.php	(revision 7576)
@@ -0,0 +1,95 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_SpellcheckTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Spellcheck
+     */
+    protected $_result;
+
+    protected $_suggestions, $_collation, $_correctlySpelled;
+
+    public function setUp()
+    {
+        $this->_suggestions = array(
+            'key1' => 'content1',
+            'key2' => 'content2',
+        );
+        $this->_collation = 'dummy1';
+        $this->_correctlySpelled = false;
+
+        $this->_result = new Solarium_Result_Select_Spellcheck($this->_suggestions, $this->_collation, $this->_correctlySpelled);
+    }
+
+    public function testGetCollation()
+    {
+        $this->assertEquals($this->_collation, $this->_result->getCollation());
+    }
+
+    public function testGetCorrectlySpelled()
+    {
+        $this->assertEquals($this->_correctlySpelled, $this->_result->getCorrectlySpelled());
+    }
+
+    public function testGetSuggestion()
+    {
+         $this->assertEquals($this->_suggestions['key1'], $this->_result->getSuggestion('key1'));
+    }
+
+    public function testGetInvalidSuggestion()
+    {
+         $this->assertEquals(null, $this->_result->getSuggestion('key3'));
+    }
+
+    public function testGetSuggestions()
+    {
+         $this->assertEquals($this->_suggestions, $this->_result->getSuggestions());
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_result AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_suggestions, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_suggestions), count($this->_result));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/FacetSetTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/FacetSetTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/FacetSetTest.php	(revision 7576)
@@ -0,0 +1,89 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_FacetSetTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_FacetSet
+     */
+    protected $_result;
+
+    protected $_facets;
+
+    public function setUp()
+    {
+        $this->_facets = array(
+            'facet1' => 'content1',
+            'facet2' => 'content2',
+        );
+        
+        $this->_result = new Solarium_Result_Select_FacetSet($this->_facets);
+    }
+
+    public function testGetFacets()
+    {
+         $this->assertEquals($this->_facets, $this->_result->getFacets());
+    }
+
+    public function testGetFacet()
+    {
+        $this->assertEquals(
+            $this->_facets['facet2'],
+            $this->_result->getFacet('facet2')
+        );
+    }
+
+    public function testGetInvalidFacet()
+    {
+        $this->assertEquals(
+            null,
+            $this->_result->getFacet('invalid')
+        );
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_result AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_facets, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_facets), count($this->_result));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/StatsTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/StatsTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/StatsTest.php	(revision 7576)
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_StatsTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Stats
+     */
+    protected $_result;
+
+    public function setUp()
+    {
+        $this->_data = array(
+            'key1' => 'value1',
+            'key2' => 'value2',
+        );
+        $this->_result = new Solarium_Result_Select_Stats($this->_data);
+    }
+
+    public function testGetResult()
+    {
+         $this->assertEquals($this->_data['key1'], $this->_result->getResult('key1'));
+    }
+
+    public function testGetInvalidResult()
+    {
+         $this->assertEquals(null, $this->_result->getResult('key3'));
+    }
+
+    public function testGetResults()
+    {
+         $this->assertEquals($this->_data, $this->_result->getResults());
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_result AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_data, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_data), count($this->_result));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Highlighting/ResultTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Highlighting/ResultTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Highlighting/ResultTest.php	(revision 7576)
@@ -0,0 +1,89 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Highlighting_ResultTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Highlighting_Result
+     */
+    protected $_result;
+
+    protected $_fields;
+
+    public function setUp()
+    {
+        $this->_fields = array(
+            'field1' => 'content1',
+            'field2' => 'content2',
+        );
+        
+        $this->_result = new Solarium_Result_Select_Highlighting_Result($this->_fields);
+    }
+
+    public function testGetFields()
+    {
+         $this->assertEquals($this->_fields, $this->_result->getFields());
+    }
+
+    public function testGetField()
+    {
+        $this->assertEquals(
+            $this->_fields['field2'],
+            $this->_result->getField('field2')
+        );
+    }
+
+    public function testGetInvalidField()
+    {
+        $this->assertEquals(
+            array(),
+            $this->_result->getField('invalid')
+        );
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_result AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_fields, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_fields), count($this->_result));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/MoreLikeThisTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/MoreLikeThisTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/MoreLikeThisTest.php	(revision 7576)
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_MoreLikeThisTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_MoreLikeThis
+     */
+    protected $_mlt;
+
+    protected $_results;
+
+    public function setUp()
+    {
+        $docs = array(
+            new Solarium_Document_ReadOnly(array('id'=>1,'name'=>'test1')),
+            new Solarium_Document_ReadOnly(array('id'=>2,'name'=>'test2')),
+        );
+
+        $this->_results = array(
+            'key1' => new Solarium_Result_Select_MoreLikeThis_Result(2, 5.13, $docs),
+            'key2' => new Solarium_Result_Select_MoreLikeThis_Result(2, 2.3, $docs),   
+        );
+        
+        $this->_mlt = new Solarium_Result_Select_MoreLikeThis($this->_results);
+    }
+
+    public function testGetResults()
+    {
+         $this->assertEquals($this->_results, $this->_mlt->getResults());
+    }
+
+    public function testGetResult()
+    {
+        $this->assertEquals(
+            $this->_results['key1'],
+            $this->_mlt->getResult('key1')
+        );
+    }
+
+    public function testGetInvalidResult()
+    {
+        $this->assertEquals(
+            null,
+            $this->_mlt->getResult('invalid')
+        );
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_mlt AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_results, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_results), count($this->_mlt));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/DocumentSetTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/DocumentSetTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/DocumentSetTest.php	(revision 7576)
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Debug_DocumentSetTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Debug_DocumentSet
+     */
+    protected $_result;
+
+    protected $_docs;
+
+    public function setUp()
+    {
+        $this->_docs = array('key1' => 'dummy1', 'key2' => 'dummy2');
+        $this->_result = new Solarium_Result_Select_Debug_DocumentSet($this->_docs);
+    }
+
+    public function testGetDocument()
+    {
+        $this->assertEquals(
+            $this->_docs['key1'],
+            $this->_result->getDocument('key1')
+        );
+    }
+
+    public function testGetDocumentWithInvalidKey()
+    {
+        $this->assertEquals(
+            null,
+            $this->_result->getDocument('invalidkey')
+        );
+    }
+
+    public function testGetDocuments()
+    {
+        $this->assertEquals(
+            $this->_docs,
+            $this->_result->getDocuments()
+        );
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_result AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_docs, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_docs), count($this->_result));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/DocumentTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/DocumentTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/DocumentTest.php	(revision 7576)
@@ -0,0 +1,85 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Debug_DocumentTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Debug_Document
+     */
+    protected $_result;
+
+    protected $_value, $_match, $_description, $_key, $_details;
+
+    public function setUp()
+    {
+        $this->_key = 'dummy-key';
+        $this->_value = 1.5;
+        $this->_match = true;
+        $this->_description = 'dummy-desc';
+        $this->_details = array(0 => 'dummy1', 1 => 'dummy2');
+
+        $this->_result = new Solarium_Result_Select_Debug_Document(
+            $this->_key,
+            $this->_match,
+            $this->_value,
+            $this->_description,
+            $this->_details
+        );
+    }
+
+    public function testGetKey()
+    {
+         $this->assertEquals($this->_key, $this->_result->getKey());
+    }
+
+    public function testGetDetails()
+    {
+         $this->assertEquals($this->_details, $this->_result->getDetails());
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_result AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_details, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_details), count($this->_result));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/DetailTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/DetailTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/DetailTest.php	(revision 7576)
@@ -0,0 +1,70 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Debug_DetailTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Debug_Detail
+     */
+    protected $_result;
+
+    protected $_value, $_match, $_description;
+
+    public function setUp()
+    {
+        $this->_value = 1.5;
+        $this->_match = true;
+        $this->_description = 'dummy-desc';
+
+        $this->_result = new Solarium_Result_Select_Debug_Detail(
+            $this->_match,
+            $this->_value,
+            $this->_description
+        );
+    }
+
+    public function testGetValue()
+    {
+         $this->assertEquals($this->_value, $this->_result->getValue());
+    }
+
+    public function testGetMatch()
+    {
+         $this->assertEquals($this->_match, $this->_result->getMatch());
+    }
+
+    public function testGetDescription()
+    {
+         $this->assertEquals($this->_description, $this->_result->getDescription());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/TimingTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/TimingTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/TimingTest.php	(revision 7576)
@@ -0,0 +1,97 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Debug_TimingTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Debug_Timing
+     */
+    protected $_result;
+
+    protected $_time, $_phases;
+
+    public function setUp()
+    {
+        $this->_time = 14;
+        $this->_phases = array('key1' => 'dummy1', 'key2' => 'dummy2');
+        $this->_result = new Solarium_Result_Select_Debug_Timing($this->_time, $this->_phases);
+    }
+
+    public function testGetTime()
+    {
+        $this->assertEquals(
+            $this->_time,
+            $this->_result->getTime()
+        );
+    }
+
+    public function testGetPhase()
+    {
+        $this->assertEquals(
+            $this->_phases['key1'],
+            $this->_result->getPhase('key1')
+        );
+    }
+
+    public function testGetPhaseWithInvalidKey()
+    {
+        $this->assertEquals(
+            null,
+            $this->_result->getPhase('invalidkey')
+        );
+    }
+
+    public function testGetPhases()
+    {
+        $this->assertEquals(
+            $this->_phases,
+            $this->_result->getPhases()
+        );
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_result AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_phases, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_phases), count($this->_result));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/TimingPhaseTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/TimingPhaseTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Debug/TimingPhaseTest.php	(revision 7576)
@@ -0,0 +1,98 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Debug_TimingPhaseTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Debug_TimingPhase
+     */
+    protected $_result;
+
+    protected $_name, $_time, $_timings;
+
+    public function setUp()
+    {
+        $this->_name = 'dummy-name';
+        $this->_time = 14;
+        $this->_timings = array('class1' => 1, 'class2' => 3);
+        $this->_result = new Solarium_Result_Select_Debug_TimingPhase($this->_name, $this->_time, $this->_timings);
+    }
+
+    public function testGetTime()
+    {
+        $this->assertEquals(
+            $this->_time,
+            $this->_result->getTime()
+        );
+    }
+
+    public function testGetTiming()
+    {
+        $this->assertEquals(
+            $this->_timings['class1'],
+            $this->_result->getTiming('class1')
+        );
+    }
+
+    public function testGetPhaseWithInvalidKey()
+    {
+        $this->assertEquals(
+            null,
+            $this->_result->getTiming('invalidkey')
+        );
+    }
+
+    public function testGetTimings()
+    {
+        $this->assertEquals(
+            $this->_timings,
+            $this->_result->getTimings()
+        );
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_result AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_timings, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_timings), count($this->_result));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Grouping/ValueGroupTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Grouping/ValueGroupTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Grouping/ValueGroupTest.php	(revision 7576)
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Grouping_ValueGroupTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Grouping_ValueGroup
+     */
+    protected $_group;
+
+    protected $_value, $_numFound, $_start, $_items;
+
+    public function setUp()
+    {
+        $this->_value = 'test value';
+        $this->_numFound = 6;
+        $this->_start = 2;
+
+        $this->_items = array(
+            'key1' => 'content1',
+            'key2' => 'content2',
+        );
+
+        $this->_group = new Solarium_Result_Select_Grouping_ValueGroup($this->_value, $this->_numFound, $this->_start, $this->_items);
+    }
+
+    public function testGetValue()
+    {
+        $this->assertEquals(
+            $this->_value,
+            $this->_group->getValue()
+        );
+    }
+
+    public function testGetNumFound()
+    {
+        $this->assertEquals(
+            $this->_numFound,
+            $this->_group->getNumFound()
+        );
+    }
+
+    public function testGetStart()
+    {
+        $this->assertEquals(
+            $this->_start,
+            $this->_group->getStart()
+        );
+    }
+
+    public function testGetDocuments()
+    {
+        $this->assertEquals(
+            $this->_items,
+            $this->_group->getDocuments()
+        );
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_group AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_items, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_items), count($this->_group));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Grouping/FieldGroupTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Grouping/FieldGroupTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Grouping/FieldGroupTest.php	(revision 7576)
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Grouping_FieldGroupTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Grouping_FieldGroup
+     */
+    protected $_group;
+
+    protected $_matches, $_numberOfGroups, $_items;
+
+    public function setUp()
+    {
+        $this->_matches = 12;
+        $this->_numberOfGroups = 6;
+
+        $this->_items = array(
+            'key1' => 'content1',
+            'key2' => 'content2',
+        );
+
+        $this->_group = new Solarium_Result_Select_Grouping_FieldGroup($this->_matches, $this->_numberOfGroups, $this->_items);
+    }
+
+    public function testGetMatches()
+    {
+        $this->assertEquals(
+            $this->_matches,
+            $this->_group->getMatches()
+        );
+    }
+
+    public function testGetNumberOfGroups()
+    {
+        $this->assertEquals(
+            $this->_numberOfGroups,
+            $this->_group->getNumberOfGroups()
+        );
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_group AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_items, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_items), count($this->_group));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Grouping/QueryGroupTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Grouping/QueryGroupTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Grouping/QueryGroupTest.php	(revision 7576)
@@ -0,0 +1,113 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Grouping_QueryGroupTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Grouping_QueryGroup
+     */
+    protected $_group;
+
+    protected $_matches, $_numFound, $_start, $_maximumScore, $_items;
+
+    public function setUp()
+    {
+        $this->_matches = 12;
+        $this->_numFound = 6;
+        $this->_start = 2;
+        $this->_maximumScore = 0.89;
+
+        $this->_items = array(
+            'key1' => 'content1',
+            'key2' => 'content2',
+        );
+
+        $this->_group = new Solarium_Result_Select_Grouping_QueryGroup($this->_matches, $this->_numFound, $this->_start, $this->_maximumScore, $this->_items);
+    }
+
+    public function testGetMatches()
+    {
+        $this->assertEquals(
+            $this->_matches,
+            $this->_group->getMatches()
+        );
+    }
+
+    public function testGetNumFound()
+    {
+        $this->assertEquals(
+            $this->_numFound,
+            $this->_group->getNumFound()
+        );
+    }
+
+    public function testGetStart()
+    {
+        $this->assertEquals(
+            $this->_start,
+            $this->_group->getStart()
+        );
+    }
+
+    public function testGetMaximumScore()
+    {
+        $this->assertEquals(
+            $this->_maximumScore,
+            $this->_group->getMaximumScore()
+        );
+    }
+
+    public function testGetDocuments()
+    {
+        $this->assertEquals(
+            $this->_items,
+            $this->_group->getDocuments()
+        );
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_group AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_items, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_items), count($this->_group));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/HighlightingTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/HighlightingTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/HighlightingTest.php	(revision 7576)
@@ -0,0 +1,89 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_HighlightingTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Highlighting
+     */
+    protected $_result;
+
+    protected $_items;
+
+    public function setUp()
+    {
+        $this->_items = array(
+            'key1' => 'content1',
+            'key2' => 'content2',
+        );
+        
+        $this->_result = new Solarium_Result_Select_Highlighting($this->_items);
+    }
+
+    public function testGetResults()
+    {
+         $this->assertEquals($this->_items, $this->_result->getResults());
+    }
+
+    public function testGetResult()
+    {
+        $this->assertEquals(
+            $this->_items['key2'],
+            $this->_result->getResult('key2')
+        );
+    }
+
+    public function testGetInvalidResult()
+    {
+        $this->assertEquals(
+            null,
+            $this->_result->getResult('invalid')
+        );
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_result AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_items, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_items), count($this->_result));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/DebugTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/DebugTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/DebugTest.php	(revision 7576)
@@ -0,0 +1,115 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_DebugTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Debug
+     */
+    protected $_result;
+
+    protected $_queryString, $_queryParser, $_otherQuery, $_explain, $_explainOther, $timing;
+
+    public function setUp()
+    {
+        $this->_queryString = 'dummy-querystring';
+        $this->_parsedQuery = 'dummy-parsed-qs';
+        $this->_queryParser = 'dummy-parser';
+        $this->_otherQuery = 'id:67';
+        $this->_explainData = array('a'=>'dummy1', 'b'=>'dummy2');
+        $this->_explain = new ArrayIterator($this->_explainData);
+        $this->_explainOther = 'dummy-other';
+        $this->_timing = 'dummy-timing';
+
+        $this->_result = new Solarium_Result_Select_Debug(
+            $this->_queryString,
+            $this->_parsedQuery,
+            $this->_queryParser,
+            $this->_otherQuery,
+            $this->_explain,
+            $this->_explainOther,
+            $this->_timing
+        );
+    }
+
+    public function testGetQueryString()
+    {
+         $this->assertEquals($this->_queryString, $this->_result->getQueryString());
+    }
+
+    public function testGetParsedQuery()
+    {
+         $this->assertEquals($this->_parsedQuery, $this->_result->getParsedQuery());
+    }
+
+    public function testGetQueryParser()
+    {
+         $this->assertEquals($this->_queryParser, $this->_result->getQueryParser());
+    }
+
+    public function testGetOtherQuery()
+    {
+         $this->assertEquals($this->_otherQuery, $this->_result->getOtherQuery());
+    }
+
+    public function testGetExplain()
+    {
+         $this->assertEquals($this->_explain, $this->_result->getExplain());
+    }
+
+    public function testGetExplainOther()
+    {
+         $this->assertEquals($this->_explainOther, $this->_result->getExplainOther());
+    }
+
+    public function testGetTiming()
+    {
+         $this->assertEquals($this->_timing, $this->_result->getTiming());
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_result AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_explainData, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_explain), count($this->_result));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Spellcheck/CollationTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Spellcheck/CollationTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Spellcheck/CollationTest.php	(revision 7576)
@@ -0,0 +1,85 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Spellcheck_CollationTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Spellcheck_Collation
+     */
+    protected $_result;
+
+    protected $_corrections, $_hits, $_query;
+
+    public function setUp()
+    {
+        $this->_corrections = array(
+            'key1' => 'content1',
+            'key2' => 'content2',
+        );
+        $this->_hits = 1;
+        $this->_query = 'dummy query';
+
+        $this->_result = new Solarium_Result_Select_Spellcheck_Collation($this->_query, $this->_hits, $this->_corrections);
+    }
+
+    public function testGetQuery()
+    {
+        $this->assertEquals($this->_query, $this->_result->getQuery());
+    }
+
+    public function testGetHits()
+    {
+        $this->assertEquals($this->_hits, $this->_result->getHits());
+    }
+
+    public function testGetCorrections()
+    {
+         $this->assertEquals($this->_corrections, $this->_result->getCorrections());
+    }
+
+    public function testIterator()
+    {
+        $items = array();
+        foreach($this->_result AS $key => $item)
+        {
+            $items[$key] = $item;
+        }
+
+        $this->assertEquals($this->_corrections, $items);
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_corrections), count($this->_result));
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Spellcheck/SuggestionTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Spellcheck/SuggestionTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Spellcheck/SuggestionTest.php	(revision 7576)
@@ -0,0 +1,86 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Spellcheck_SuggestionTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Spellcheck_Suggestion
+     */
+    protected $_result;
+
+    protected $_numFound, $_startOffset, $_endOffset, $_originalFrequency, $_word, $_frequency;
+
+    public function setUp()
+    {
+        $this->_numFound = 1;
+        $this->_startOffset = 2;
+        $this->_endOffset = 3;
+        $this->_originalFrequency = 4;
+        $this->_word = 'dummyword';
+        $this->_frequency = 5;
+
+        $this->_result = new Solarium_Result_Select_Spellcheck_Suggestion(
+            $this->_numFound, $this->_startOffset, $this->_endOffset, $this->_originalFrequency, $this->_word, $this->_frequency
+        );
+    }
+
+    public function testGetNumFound()
+    {
+        $this->assertEquals($this->_numFound, $this->_result->getNumFound());
+    }
+
+    public function testGetStartOffset()
+    {
+        $this->assertEquals($this->_startOffset, $this->_result->getStartOffset());
+    }
+
+    public function testGetEndOffset()
+    {
+        $this->assertEquals($this->_endOffset, $this->_result->getEndOffset());
+    }
+
+    public function testGetOriginalFrequency()
+    {
+         $this->assertEquals($this->_originalFrequency, $this->_result->getOriginalFrequency());
+    }
+
+    public function testGetWord()
+    {
+         $this->assertEquals($this->_word, $this->_result->getWord());
+    }
+
+    public function testGetFrequency()
+    {
+         $this->assertEquals($this->_frequency, $this->_result->getFrequency());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Stats/ResultTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Stats/ResultTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Stats/ResultTest.php	(revision 7576)
@@ -0,0 +1,110 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Stats_ResultTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Stats_Result
+     */
+    protected $_result;
+
+    protected $_field, $_stats;
+
+    public function setUp()
+    {
+        $this->_field = 'myfield';
+        $this->_stats = array(
+            'min' => 'dummyMin',
+            'max' => 'dummyMax',
+            'sum' => 'dummySum',
+            'count' => 'dummyCount',
+            'missing' => 'dummyMissing',
+            'sumOfSquares' => 'dummySos',
+            'mean' => 'dummyMean',
+            'stddev' => 'dummyStddev',
+            'facets' => 'dummyFacets',
+        );
+
+        $this->_result = new Solarium_Result_Select_Stats_Result($this->_field, $this->_stats);
+    }
+
+    public function testGetName()
+    {
+        $this->assertEquals($this->_field, $this->_result->getName());
+    }
+
+    public function testGetMin()
+    {
+        $this->assertEquals($this->_stats['min'], $this->_result->getMin());
+    }
+
+    public function testGetMax()
+    {
+        $this->assertEquals($this->_stats['max'], $this->_result->getMax());
+    }
+
+    public function testGetSum()
+    {
+        $this->assertEquals($this->_stats['sum'], $this->_result->getSum());
+    }
+
+    public function testGetCount()
+    {
+        $this->assertEquals($this->_stats['count'], $this->_result->getCount());
+    }
+
+    public function testGetMissing()
+    {
+        $this->assertEquals($this->_stats['missing'], $this->_result->getMissing());
+    }
+
+    public function testGetSumOfSquares()
+    {
+        $this->assertEquals($this->_stats['sumOfSquares'], $this->_result->getSumOfSquares());
+    }
+
+    public function testGetMean()
+    {
+        $this->assertEquals($this->_stats['mean'], $this->_result->getMean());
+    }
+
+    public function testGetStddev()
+    {
+        $this->assertEquals($this->_stats['stddev'], $this->_result->getStddev());
+    }
+
+    public function testGetFacets()
+    {
+        $this->assertEquals($this->_stats['facets'], $this->_result->getFacets());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Stats/FacetValueTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Stats/FacetValueTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Select/Stats/FacetValueTest.php	(revision 7576)
@@ -0,0 +1,110 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Select_Stats_FacetValueTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select_Stats_FacetValue
+     */
+    protected $_result;
+
+    protected $_value, $_stats;
+
+    public function setUp()
+    {
+        $this->_value = 'myvalue';
+        $this->_stats = array(
+            'min' => 'dummyMin',
+            'max' => 'dummyMax',
+            'sum' => 'dummySum',
+            'count' => 'dummyCount',
+            'missing' => 'dummyMissing',
+            'sumOfSquares' => 'dummySos',
+            'mean' => 'dummyMean',
+            'stddev' => 'dummyStddev',
+            'facets' => 'dummyFacets',
+        );
+
+        $this->_result = new Solarium_Result_Select_Stats_FacetValue($this->_value, $this->_stats);
+    }
+
+    public function testGetValue()
+    {
+        $this->assertEquals($this->_value, $this->_result->getValue());
+    }
+
+    public function testGetMin()
+    {
+        $this->assertEquals($this->_stats['min'], $this->_result->getMin());
+    }
+
+    public function testGetMax()
+    {
+        $this->assertEquals($this->_stats['max'], $this->_result->getMax());
+    }
+
+    public function testGetSum()
+    {
+        $this->assertEquals($this->_stats['sum'], $this->_result->getSum());
+    }
+
+    public function testGetCount()
+    {
+        $this->assertEquals($this->_stats['count'], $this->_result->getCount());
+    }
+
+    public function testGetMissing()
+    {
+        $this->assertEquals($this->_stats['missing'], $this->_result->getMissing());
+    }
+
+    public function testGetSumOfSquares()
+    {
+        $this->assertEquals($this->_stats['sumOfSquares'], $this->_result->getSumOfSquares());
+    }
+
+    public function testGetMean()
+    {
+        $this->assertEquals($this->_stats['mean'], $this->_result->getMean());
+    }
+
+    public function testGetStddev()
+    {
+        $this->assertEquals($this->_stats['stddev'], $this->_result->getStddev());
+    }
+
+    public function testGetFacets()
+    {
+        $this->assertEquals($this->_stats['facets'], $this->_result->getFacets());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/TermsTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/TermsTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/TermsTest.php	(revision 7576)
@@ -0,0 +1,127 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_TermsTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Terms
+     */
+    protected $_result;
+
+    /**
+     * @var array
+     */
+    protected $_data;
+
+    public function setUp()
+    {
+        $this->_data = array(
+            'fieldA' => array(
+                'term1',
+                11,
+                'term2',
+                5,
+                'term3',
+                2,
+            ),
+            'fieldB' => array(
+                'term4',
+                4,
+                'term5',
+                1,
+            )
+        );
+
+        $this->_result = new Solarium_Result_TermsDummy($this->_data);
+    }
+
+    public function testGetStatus()
+    {
+        $this->assertEquals(
+            1,
+            $this->_result->getStatus()
+        );
+    }
+
+    public function testGetQueryTime()
+    {
+        $this->assertEquals(
+            12,
+            $this->_result->getQueryTime()
+        );
+    }
+
+    public function testGetResults()
+    {
+        $this->assertEquals($this->_data, $this->_result->getResults());
+    }
+
+    public function testGetTerms()
+    {
+        $this->assertEquals($this->_data['fieldA'], $this->_result->getTerms('fieldA'));
+    }
+
+    public function testGetTermsWithInvalidFieldName()
+    {
+        $this->assertEquals(array(), $this->_result->getTerms('fieldX'));
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_data), count($this->_result));
+    }
+
+    public function testIterator()
+    {
+        $results = array();
+        foreach($this->_result AS $key => $doc)
+        {
+            $results[$key] = $doc;
+        }
+
+        $this->assertEquals($this->_data, $results);
+    }
+
+}
+
+class Solarium_Result_TermsDummy extends Solarium_Result_Terms
+{
+    protected $_parsed = true;
+
+    public function __construct($results)
+    {
+        $this->_results = $results;
+        $this->_status = 1;
+        $this->_queryTime = 12;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/ListTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/ListTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/ListTest.php	(revision 7576)
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Analysis_ListTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Analysis_List
+     */
+    protected $_result;
+
+    protected $_items, $_name;
+
+    public function setUp()
+    {
+        $this->_name = 'testname';
+        $this->_items = array('key1' => 'dummy1', 'key2' => 'dummy2', 'key3' => 'dummy3');
+        $this->_result = new Solarium_Result_Analysis_List($this->_name, $this->_items);
+    }
+
+    public function testGetItems()
+    {
+        $this->assertEquals($this->_items, $this->_result->getItems());
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_items), count($this->_result));
+    }
+
+    public function testIterator()
+    {
+        $lists = array();
+        foreach($this->_result AS $key => $list)
+        {
+            $lists[$key] = $list;
+        }
+
+        $this->assertEquals($this->_items, $lists);
+    }
+
+    public function testGetName()
+    {
+        $this->assertEquals(
+            $this->_name,
+            $this->_result->getName()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/DocumentTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/DocumentTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/DocumentTest.php	(revision 7576)
@@ -0,0 +1,114 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Analysis_DocumentTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Analysis_Document
+     */
+    protected $_result;
+
+    protected $_items;
+
+    public function setUp()
+    {
+        $this->_items = array('key1' => 'dummy1', 'key2' => 'dummy2', 'key3' => 'dummy3');
+        $this->_result = new Solarium_Result_Analysis_DocumentDummy(1, 12, $this->_items);
+    }
+
+    public function testGetDocuments()
+    {
+        $this->assertEquals($this->_items, $this->_result->getDocuments());
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_items), count($this->_result));
+    }
+
+    public function testIterator()
+    {
+        $docs = array();
+        foreach($this->_result AS $key => $doc)
+        {
+            $docs[$key] = $doc;
+        }
+
+        $this->assertEquals($this->_items, $docs);
+    }
+
+    public function testGetStatus()
+    {
+        $this->assertEquals(
+            1,
+            $this->_result->getStatus()
+        );
+    }
+
+    public function testGetQueryTime()
+    {
+        $this->assertEquals(
+            12,
+            $this->_result->getQueryTime()
+        );
+    }
+
+    public function testGetDocument()
+    {
+        $this->assertEquals(
+            $this->_items['key2'],
+            $this->_result->getDocument('key2')
+        );
+    }
+
+    public function testGetInvalidDocument()
+    {
+        $this->assertEquals(
+            null,
+            $this->_result->getDocument('invalidkey')
+        );
+    }
+    
+}
+
+class Solarium_Result_Analysis_DocumentDummy extends Solarium_Result_Analysis_Document
+{
+    protected $_parsed = true;
+
+    public function __construct($status, $queryTime, $items)
+    {
+        $this->_items = $items;
+        $this->_queryTime = $queryTime;
+        $this->_status = $status;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/ItemTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/ItemTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/ItemTest.php	(revision 7576)
@@ -0,0 +1,110 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Analysis_ItemTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Analysis_Item
+     */
+    protected $_item;
+
+    protected $_data;
+
+    public function setUp()
+    {
+        $this->_data = array(
+            'text' => 'dummytest',
+            'start' => 10,
+            'end' => 22,
+            'position' => 2,
+            'positionHistory' => array(2,1),
+            'type' => '<dummytype>',
+            'raw_text' => 'dummy raw text',
+            'match' => true
+        );
+        $this->_item = new Solarium_Result_Analysis_Item($this->_data);
+    }
+
+    public function testGetText()
+    {
+        $this->assertEquals($this->_data['text'], $this->_item->getText());
+    }
+
+    public function testGetStart()
+    {
+        $this->assertEquals($this->_data['start'], $this->_item->getStart());
+    }
+
+    public function testGetEnd()
+    {
+        $this->assertEquals($this->_data['end'], $this->_item->getEnd());
+    }
+
+    public function testGetPosition()
+    {
+        $this->assertEquals($this->_data['position'], $this->_item->getPosition());
+    }
+
+    public function testGetPositionHistory()
+    {
+        $this->assertEquals($this->_data['positionHistory'], $this->_item->getPositionHistory());
+    }
+
+    public function testGetRawText()
+    {
+        $this->assertEquals($this->_data['raw_text'], $this->_item->getRawText());
+    }
+
+    public function testGetType()
+    {
+        $this->assertEquals($this->_data['type'], $this->_item->getType());
+    }
+
+    public function testGetRawTextEmpty()
+    {
+        $data = array(
+            'text' => 'dummytest',
+            'start' => 10,
+            'end' => 22,
+            'position' => 2,
+            'positionHistory' => array(2,1),
+            'type' => '<dummytype>',
+        );
+        $item = new Solarium_Result_Analysis_Item($data);
+        $this->assertEquals(null, $item->getRawText());
+    }
+
+    public function testGetMatch()
+    {
+        $this->assertEquals($this->_data['match'], $this->_item->getMatch());
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/FieldTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/FieldTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/FieldTest.php	(revision 7576)
@@ -0,0 +1,98 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Analysis_FieldTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Analysis_Field
+     */
+    protected $_result;
+
+    protected $_items;
+
+    public function setUp()
+    {
+        $this->_items = array('key1' => 'dummy1', 'key2' => 'dummy2', 'key3' => 'dummy3');
+        $this->_result = new Solarium_Result_Analysis_FieldDummy(1, 12, $this->_items);
+    }
+
+    public function testGetLists()
+    {
+        $this->assertEquals($this->_items, $this->_result->getLists());
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_items), count($this->_result));
+    }
+
+    public function testIterator()
+    {
+        $lists = array();
+        foreach($this->_result AS $key => $list)
+        {
+            $lists[$key] = $list;
+        }
+
+        $this->assertEquals($this->_items, $lists);
+    }
+
+    public function testGetStatus()
+    {
+        $this->assertEquals(
+            1,
+            $this->_result->getStatus()
+        );
+    }
+
+    public function testGetQueryTime()
+    {
+        $this->assertEquals(
+            12,
+            $this->_result->getQueryTime()
+        );
+    }
+    
+}
+
+class Solarium_Result_Analysis_FieldDummy extends Solarium_Result_Analysis_Field
+{
+    protected $_parsed = true;
+
+    public function __construct($status, $queryTime, $items)
+    {
+        $this->_items = $items;
+        $this->_queryTime = $queryTime;
+        $this->_status = $status;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/TypesTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/TypesTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Analysis/TypesTest.php	(revision 7576)
@@ -0,0 +1,143 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Analysis_TypesTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Analysis_Types
+     */
+    protected $_result;
+
+    protected $_items, $_name;
+
+    public function setUp()
+    {
+        $this->_name = 'testname';
+        $this->_items = array(
+            'index' => new testAnalysisTypeIndexDummy(),
+            'query' => new testAnalysisTypeQueryDummy()
+        );
+        $this->_result = new Solarium_Result_Analysis_Types($this->_name, $this->_items);
+    }
+
+    public function testGetItems()
+    {
+        $this->assertEquals($this->_items, $this->_result->getItems());
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_items), count($this->_result));
+    }
+
+    public function testIterator()
+    {
+        $lists = array();
+        foreach($this->_result AS $key => $list)
+        {
+            $lists[$key] = $list;
+        }
+
+        $this->assertEquals($this->_items, $lists);
+    }
+
+    public function testGetName()
+    {
+        $this->assertEquals(
+            $this->_name,
+            $this->_result->getName()
+        );
+    }
+
+    public function testGetIndexAnalysis()
+    {
+        $this->assertEquals(
+            $this->_items['index'],
+            $this->_result->getIndexAnalysis()
+        );
+    }
+
+    public function testGetIndexAnalysisNoData()
+    {
+        $items = array(
+            'index' => new testAnalysisTypeInvalidDummy(),
+            'query' => new testAnalysisTypeQueryDummy()
+        );
+        
+        $result = new Solarium_Result_Analysis_Types($this->_name, $items);
+        $this->assertEquals(
+            null,
+            $result->getIndexAnalysis()
+        );
+    }
+
+    public function testGetQueryAnalysis()
+    {
+        $this->assertEquals(
+            $this->_items['query'],
+            $this->_result->getQueryAnalysis()
+        );
+    }
+
+    public function testGetQueryAnalysisNoData()
+    {
+        $items = array(
+            'index' => new testAnalysisTypeIndexDummy(),
+            'query' => new testAnalysisTypeInvalidDummy()
+        );
+
+        $result = new Solarium_Result_Analysis_Types($this->_name, $items);
+        $this->assertEquals(
+            null,
+            $result->getQueryAnalysis()
+        );
+    }
+
+}
+
+class testAnalysisTypeIndexDummy{
+    public function getName(){
+        return 'index';
+    }
+}
+
+class testAnalysisTypeQueryDummy{
+    public function getName(){
+        return 'query';
+    }
+}
+
+class testAnalysisTypeInvalidDummy{
+    public function getName(){
+        return 'invalid';
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/PingTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/PingTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/PingTest.php	(revision 7576)
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_PingTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testGetStatus()
+    {
+        $client = new Solarium_Client;
+        $query = new Solarium_Query_Ping;
+        $response = new Solarium_Client_Response('{"responseHeader":{"status":1,"QTime":12}}',array('HTTP 1.1 200 OK'));
+
+        $ping = new Solarium_Result_Ping($client, $query, $response);
+        $this->assertEquals(
+            0,
+            $ping->getStatus()
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/MoreLikeThisTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/MoreLikeThisTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/MoreLikeThisTest.php	(revision 7576)
@@ -0,0 +1,93 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_MoreLikeThisTest extends PHPUnit_Framework_TestCase
+{
+
+    public function testGetInterestingTerms()
+    {
+        $query = new Solarium_Query_MoreLikeThis();
+        $query->setInterestingTerms('list');
+
+        $mock = $this->getMock('Solarium_Result_MoreLikeThis', array('getQuery','_parseResponse'), array(), '', false);
+        $mock->expects($this->once())
+             ->method('getQuery')
+             ->will($this->returnValue($query));
+        $mock->expects($this->once())
+             ->method('_parseResponse');
+
+        $mock->getInterestingTerms();
+    }
+
+    public function testGetInterestingTermsException()
+    {
+        $query = new Solarium_Query_MoreLikeThis();
+        $query->setInterestingTerms('none');
+
+        $mock = $this->getMock('Solarium_Result_MoreLikeThis', array('getQuery'), array(), '', false);
+        $mock->expects($this->once())
+             ->method('getQuery')
+             ->will($this->returnValue($query));
+
+        $this->setExpectedException('Solarium_Exception');
+        $mock->getInterestingTerms();
+    }
+
+    public function testGetMatch()
+    {
+        $query = new Solarium_Query_MoreLikeThis();
+        $query->setMatchInclude(true);
+
+        $mock = $this->getMock('Solarium_Result_MoreLikeThis', array('getQuery','_parseResponse'), array(), '', false);
+        $mock->expects($this->once())
+             ->method('getQuery')
+             ->will($this->returnValue($query));
+        $mock->expects($this->once())
+             ->method('_parseResponse');
+
+        $mock->getMatch();
+    }
+    
+    public function testGetMatchException()
+    {
+        $query = new Solarium_Query_MoreLikeThis();
+        $query->setMatchInclude(false);
+
+        $mock = $this->getMock('Solarium_Result_MoreLikeThis', array('getQuery'), array(), '', false);
+        $mock->expects($this->once())
+             ->method('getQuery')
+             ->will($this->returnValue($query));
+
+        $this->setExpectedException('Solarium_Exception');
+        $mock->getMatch();
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/SelectTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/SelectTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/SelectTest.php	(revision 7576)
@@ -0,0 +1,204 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_SelectTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Select
+     */
+    protected $_result;
+
+    protected $_numFound, $_docs, $_components, $_facetSet, $_moreLikeThis,
+              $_highlighting, $_grouping, $_stats, $_debug;
+
+    public function setUp()
+    {
+        $this->_numFound = 11;
+
+        $this->_docs = array(
+            new Solarium_Document_ReadOnly(array('id'=>1,'title'=>'doc1')),
+            new Solarium_Document_ReadOnly(array('id'=>1,'title'=>'doc1')),
+        );
+
+        $this->_facetSet = 'dummy-facetset-value';
+        $this->_moreLikeThis = 'dummy-facetset-value';
+        $this->_highlighting = 'dummy-highlighting-value';
+        $this->_grouping = 'dummy-grouping-value';
+        $this->_spellcheck = 'dummy-grouping-value';
+        $this->_stats = 'dummy-stats-value';
+        $this->_debug = 'dummy-debug-value';
+
+        $this->_components = array(
+            Solarium_Query_Select::COMPONENT_FACETSET => $this->_facetSet,
+            Solarium_Query_Select::COMPONENT_MORELIKETHIS => $this->_moreLikeThis,
+            Solarium_Query_Select::COMPONENT_HIGHLIGHTING => $this->_highlighting,
+            Solarium_Query_Select::COMPONENT_GROUPING => $this->_grouping,
+            Solarium_Query_Select::COMPONENT_SPELLCHECK => $this->_spellcheck,
+            Solarium_Query_Select::COMPONENT_STATS => $this->_stats,
+            Solarium_Query_Select::COMPONENT_DEBUG => $this->_debug,
+        );
+
+        $this->_result = new Solarium_Result_SelectDummy(1, 12, $this->_numFound, $this->_docs, $this->_components);
+    }
+
+    public function testGetNumFound()
+    {
+        $this->assertEquals($this->_numFound, $this->_result->getNumFound());
+    }
+
+    public function testGetDocuments()
+    {
+        $this->assertEquals($this->_docs, $this->_result->getDocuments());
+    }
+
+    public function testGetFacetSet()
+    {
+        $this->assertEquals($this->_facetSet, $this->_result->getFacetSet());
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_docs), count($this->_result));
+    }
+
+    public function testGetComponents()
+    {
+        $this->assertEquals($this->_components, $this->_result->getComponents());
+    }
+
+    public function testGetComponent()
+    {
+        $this->assertEquals(
+            $this->_components[Solarium_Query_Select::COMPONENT_MORELIKETHIS],
+            $this->_result->getComponent(Solarium_Query_Select::COMPONENT_MORELIKETHIS)
+        );
+    }
+
+    public function testGetInvalidComponent()
+    {
+        $this->assertEquals(
+            null,
+            $this->_result->getComponent('invalid')
+        );
+    }
+
+    public function testGetMoreLikeThis()
+    {
+        $this->assertEquals(
+            $this->_components[Solarium_Query_Select::COMPONENT_MORELIKETHIS],
+            $this->_result->getMoreLikeThis()
+        );
+    }
+
+    public function testGetHighlighting()
+    {
+        $this->assertEquals(
+            $this->_components[Solarium_Query_Select::COMPONENT_HIGHLIGHTING],
+            $this->_result->getHighlighting()
+        );
+    }
+
+    public function testGetGrouping()
+    {
+        $this->assertEquals(
+            $this->_components[Solarium_Query_Select::COMPONENT_GROUPING],
+            $this->_result->getGrouping()
+        );
+    }
+
+    public function testGetSpellcheck()
+    {
+        $this->assertEquals(
+            $this->_components[Solarium_Query_Select::COMPONENT_SPELLCHECK],
+            $this->_result->getSpellcheck()
+        );
+    }
+
+    public function testGetStats()
+    {
+        $this->assertEquals(
+            $this->_components[Solarium_Query_Select::COMPONENT_STATS],
+            $this->_result->getStats()
+        );
+    }
+
+    public function testGetDebug()
+    {
+        $this->assertEquals(
+            $this->_components[Solarium_Query_Select::COMPONENT_DEBUG],
+            $this->_result->getDebug()
+        );
+    }
+
+    public function testIterator()
+    {
+        $docs = array();
+        foreach($this->_result AS $key => $doc)
+        {
+            $docs[$key] = $doc;
+        }
+
+        $this->assertEquals($this->_docs, $docs);
+    }
+
+    public function testGetStatus()
+    {
+        $this->assertEquals(
+            1,
+            $this->_result->getStatus()
+        );
+    }
+
+    public function testGetQueryTime()
+    {
+        $this->assertEquals(
+            12,
+            $this->_result->getQueryTime()
+        );
+    }
+
+}
+
+class Solarium_Result_SelectDummy extends Solarium_Result_Select
+{
+    protected $_parsed = true;
+
+    public function __construct($status, $queryTime, $numfound, $docs, $components)
+    {
+        $this->_numfound = $numfound;
+        $this->_documents = $docs;
+        $this->_components = $components;
+        $this->_queryTime = $queryTime;
+        $this->_status = $status;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Suggester/TermTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Suggester/TermTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/Suggester/TermTest.php	(revision 7576)
@@ -0,0 +1,123 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_Suggester_TermTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Suggester_Term
+     */
+    protected $_result;
+
+    /**
+     * @var int
+     */
+    protected $_numFound;
+
+    /**
+     * @var int
+     */
+    protected $_startOffset;
+
+    /**
+     * @var int
+     */
+    protected $_endOffset;
+
+    /**
+     * @var array
+     */
+    protected $_suggestions;
+
+    public function setUp()
+    {
+        $this->_numFound = 5;
+        $this->_startOffset = 2;
+        $this->_endOffset = 6;
+        $this->_suggestions = array(
+            'suggestion1',
+            'suggestion2',
+        );
+
+        $this->_result = new Solarium_Result_Suggester_Term(
+            $this->_numFound, $this->_startOffset, $this->_endOffset, $this->_suggestions
+        );
+    }
+
+    public function testGetNumFound()
+    {
+        $this->assertEquals(
+            $this->_numFound,
+            $this->_result->getNumFound()
+        );
+    }
+
+    public function testGetStartOffset()
+    {
+        $this->assertEquals(
+            $this->_startOffset,
+            $this->_result->getStartOffset()
+        );
+    }
+
+    public function testGetEndOffset()
+    {
+        $this->assertEquals(
+            $this->_endOffset,
+            $this->_result->getEndOffset()
+        );
+    }
+
+    public function testGetSuggestions()
+    {
+        $this->assertEquals(
+            $this->_suggestions,
+            $this->_result->getSuggestions()
+        );
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_suggestions), count($this->_result));
+    }
+
+    public function testIterator()
+    {
+        $results = array();
+        foreach($this->_result AS $key => $doc)
+        {
+            $results[$key] = $doc;
+        }
+
+        $this->assertEquals($this->_suggestions, $results);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/UpdateTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/UpdateTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/UpdateTest.php	(revision 7576)
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_UpdateTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Update
+     */
+    protected $_result;
+
+    public function setUp()
+    {
+        $this->_result = new Solarium_Result_UpdateDummy();
+    }
+
+    public function testGetStatus()
+    {
+        $this->assertEquals(
+            1,
+            $this->_result->getStatus()
+        );
+    }
+
+    public function testGetQueryTime()
+    {
+        $this->assertEquals(
+            12,
+            $this->_result->getQueryTime()
+        );
+    }
+    
+}
+
+class Solarium_Result_UpdateDummy extends Solarium_Result_Update
+{
+    protected $_parsed = true;
+
+    public function __construct()
+    {
+        $this->_status = 1;
+        $this->_queryTime = 12;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/QueryTypeTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/QueryTypeTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/QueryTypeTest.php	(revision 7576)
@@ -0,0 +1,117 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_QueryTypeTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Solarium_Result_QueryTypeDummy
+     */
+    protected $_result;
+
+    public function setUp()
+    {
+        $client = new Solarium_Client;
+        $query = new Solarium_Query_Update;
+        $response = new Solarium_Client_Response('{"responseHeader":{"status":1,"QTime":12}}',array('HTTP 1.1 200 OK'));
+        $this->_result = new Solarium_Result_QueryTypeDummy($client, $query, $response);
+    }
+
+    public function testParseResponse()
+    {
+        $client = new Solarium_Client;
+        $query = new Solarium_Query_DummyTest;
+        $response = new Solarium_Client_Response('{"responseHeader":{"status":1,"QTime":12}}',array('HTTP 1.1 200 OK'));
+        $result = new Solarium_Result_QueryTypeDummy($client, $query, $response);
+
+        $this->setExpectedException('Solarium_Exception');
+        $result->parse();
+    }
+
+    public function testParseResponseInvalidQuerytype()
+    {
+        $this->_result->parse();
+    }
+
+    public function testParseLazyLoading()
+    {
+        $this->assertEquals(0,$this->_result->parseCount);
+
+        $this->_result->parse();
+        $this->assertEquals(1,$this->_result->parseCount);
+
+        $this->_result->parse();
+        $this->assertEquals(1,$this->_result->parseCount);
+    }
+
+    public function testMapData()
+    {
+        $this->_result->mapData(array('dummyvar' => 'dummyvalue'));
+
+        $this->assertEquals('dummyvalue',$this->_result->getVar('dummyvar'));
+    }
+    
+}
+
+class Solarium_Query_DummyTest extends Solarium_Query_Select
+{
+    public function getType()
+    {
+        return 'dummy';
+    }
+}
+
+class Solarium_Result_QueryTypeDummy extends Solarium_Result_QueryType
+{
+
+    public $parseCount = 0;
+
+    public function parse()
+    {
+        $this->_parseResponse();
+    }
+
+    public function _mapData($data)
+    {
+        $this->parseCount++;
+        parent::_mapData($data);
+    }
+
+    public function mapData($data)
+    {
+        $this->_mapData($data);
+    }
+
+    public function getVar($name)
+    {
+        return $this->{'_'.$name};
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/SuggesterTest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/SuggesterTest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/tests/Solarium/Result/SuggesterTest.php	(revision 7576)
@@ -0,0 +1,126 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ */
+
+class Solarium_Result_SuggesterTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var Solarium_Result_Suggester
+     */
+    protected $_result;
+
+    /**
+     * @var array
+     */
+    protected $_data;
+
+    /**
+     * @var string
+     */
+    protected $_collation;
+
+    public function setUp()
+    {
+        $this->_data = array(
+            'term1' => 'data1',
+            'term2' => 'data2',
+        );
+        $this->_collation = 'collation result';
+        $this->_result = new Solarium_Result_SuggesterDummy($this->_data, $this->_collation);
+    }
+
+    public function testGetStatus()
+    {
+        $this->assertEquals(
+            1,
+            $this->_result->getStatus()
+        );
+    }
+
+    public function testGetQueryTime()
+    {
+        $this->assertEquals(
+            12,
+            $this->_result->getQueryTime()
+        );
+    }
+
+    public function testGetResults()
+    {
+        $this->assertEquals($this->_data, $this->_result->getResults());
+    }
+
+    public function testGetTerm()
+    {
+        $this->assertEquals($this->_data['term1'], $this->_result->getTerm('term1'));
+    }
+
+    public function testGetTermsWithInvalidFieldName()
+    {
+        $this->assertEquals(array(), $this->_result->getTerm('term3'));
+    }
+
+    public function testCount()
+    {
+        $this->assertEquals(count($this->_data), count($this->_result));
+    }
+
+    public function testIterator()
+    {
+        $results = array();
+        foreach($this->_result AS $key => $doc)
+        {
+            $results[$key] = $doc;
+        }
+
+        $this->assertEquals($this->_data, $results);
+    }
+
+    public function testGetCollation()
+    {
+        $this->assertEquals($this->_collation, $this->_result->getCollation());
+    }
+
+}
+
+class Solarium_Result_SuggesterDummy extends Solarium_Result_Suggester
+{
+    protected $_parsed = true;
+
+    public function __construct($results, $collation)
+    {
+        $this->_results = $results;
+        $this->_collation = $collation;
+        $this->_status = 1;
+        $this->_queryTime = 12;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/.project
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/.project	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/.project	(revision 7576)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>solrclient</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.dltk.core.scriptbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.php.core.PHPNature</nature>
+	</natures>
+</projectDescription>
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client.php	(revision 7576)
@@ -0,0 +1,833 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Main interface for interaction with Solr
+ *
+ * The client is the main interface for usage of the Solarium library.
+ * You can use it to get query instances and to execute them.
+ * It also allows to register plugins and querytypes to customize Solarium.
+ * Finally, it also gives access to the adapter, which holds the Solr connection settings.
+ *
+ * Example usage with default settings:
+ * <code>
+ * $client = new Solarium_Client;
+ * $query = $client->createSelect();
+ * $result = $client->select($query);
+ * </code>
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client extends Solarium_Configurable
+{
+
+    /**
+     * Querytype select
+     */
+    const QUERYTYPE_SELECT = 'select';
+
+    /**
+     * Querytype update
+     */
+    const QUERYTYPE_UPDATE = 'update';
+
+    /**
+     * Querytype ping
+     */
+    const QUERYTYPE_PING = 'ping';
+
+    /**
+     * Querytype morelikethis
+     */
+    const QUERYTYPE_MORELIKETHIS = 'mlt';
+
+    /**
+     * Querytype analysis field
+     */
+    const QUERYTYPE_ANALYSIS_FIELD = 'analysis-field';
+
+    /**
+     * Querytype analysis document
+     */
+    const QUERYTYPE_ANALYSIS_DOCUMENT = 'analysis-document';
+
+    /**
+     * Querytype terms
+     */
+    const QUERYTYPE_TERMS = 'terms';
+
+    /**
+     * Querytype suggester
+     */
+    const QUERYTYPE_SUGGESTER = 'suggester';
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'adapter' => 'Solarium_Client_Adapter_Http',
+    );
+
+    /**
+     * Querytype mappings
+     *
+     * These can be customized using {@link registerQueryType()}
+     */
+    protected $_queryTypes = array(
+        self::QUERYTYPE_SELECT => array(
+            'query'          => 'Solarium_Query_Select',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Select',
+            'responseparser' => 'Solarium_Client_ResponseParser_Select'
+        ),
+        self::QUERYTYPE_UPDATE => array(
+            'query'          => 'Solarium_Query_Update',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Update',
+            'responseparser' => 'Solarium_Client_ResponseParser_Update'
+        ),
+        self::QUERYTYPE_PING => array(
+            'query'          => 'Solarium_Query_Ping',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Ping',
+            'responseparser' => 'Solarium_Client_ResponseParser_Ping'
+        ),
+        self::QUERYTYPE_MORELIKETHIS => array(
+            'query'           => 'Solarium_Query_MoreLikeThis',
+            'requestbuilder'  => 'Solarium_Client_RequestBuilder_MoreLikeThis',
+            'responseparser'  => 'Solarium_Client_ResponseParser_MoreLikeThis'
+        ),
+        self::QUERYTYPE_ANALYSIS_DOCUMENT => array(
+            'query'          => 'Solarium_Query_Analysis_Document',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Analysis_Document',
+            'responseparser' => 'Solarium_Client_ResponseParser_Analysis_Document'
+        ),
+        self::QUERYTYPE_ANALYSIS_FIELD => array(
+            'query'          => 'Solarium_Query_Analysis_Field',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Analysis_Field',
+            'responseparser' => 'Solarium_Client_ResponseParser_Analysis_Field'
+        ),
+        self::QUERYTYPE_TERMS => array(
+            'query'          => 'Solarium_Query_Terms',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Terms',
+            'responseparser' => 'Solarium_Client_ResponseParser_Terms'
+        ),
+        self::QUERYTYPE_SUGGESTER => array(
+            'query'          => 'Solarium_Query_Suggester',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Suggester',
+            'responseparser' => 'Solarium_Client_ResponseParser_Suggester'
+        ),
+    );
+
+    /**
+     * Plugin types
+     *
+     * @var array
+     */
+    protected $_pluginTypes = array(
+        'loadbalancer' => 'Solarium_Plugin_Loadbalancer',
+        'postbigrequest' => 'Solarium_Plugin_PostBigRequest',
+        'customizerequest' => 'Solarium_Plugin_CustomizeRequest',
+        'parallelexecution' => 'Solarium_Plugin_ParallelExecution',
+        'bufferedadd' => 'Solarium_Plugin_BufferedAdd',
+        'prefetchiterator' => 'Solarium_Plugin_PrefetchIterator',
+    );
+
+    /**
+     * Registered plugin instances
+     *
+     * @var array
+     */
+    protected $_pluginInstances = array();
+
+    /**
+     * Adapter instance
+     *
+     * If an adapter instance is set using {@link setAdapter()} this var will
+     * contain a reference to that instance.
+     *
+     * In all other cases the adapter is lazy-loading, it will be instantiated
+     * on first use by {@link getAdapter()} based on the 'adapter' entry in
+     * {@link $_options}. This option can be set using {@link setAdapter()}
+     *
+     * @var Solarium_Client_Adapter
+     */
+    protected $_adapter;
+
+    /**
+     * Request builder instances
+     *
+     * @var array
+     */
+    protected $_requestBuilders;
+
+    /**
+     * Initialization hook
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'querytype':
+                    $this->registerQueryTypes($value);
+                    break;
+                case 'plugin':
+                    $this->registerPlugins($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Set the adapter
+     *
+     * The adapter has to be a class that extends
+     * {@link Solarium_Client_Adapter}.
+     *
+     * If a string is passed it is assumed to be the classname and it will be
+     * instantiated on first use. This requires the availability of the class
+     * through autoloading or a manual require before calling this method.
+     * Any existing adapter instance will be removed by this method, this way an
+     * instance of the new adapter type will be created upon the next usage of
+     * the adapter (lazy-loading)
+     *
+     * If an adapter instance is passed it will replace the current adapter
+     * immediately, bypassing the lazy loading.
+     *
+     * @param string|Solarium_Client_Adapter $adapter
+     * @return Solarium_Client Provides fluent interface
+     */
+    public function setAdapter($adapter)
+    {
+        if (is_string($adapter)) {
+            $this->_adapter = null;
+            return $this->_setOption('adapter', $adapter);
+        } else {
+            // forward options
+            $adapter->setOptions($this->_options);
+            // overwrite existing adapter
+            $this->_adapter = $adapter;
+            return $this;
+        }
+    }
+
+    /**
+     * Create an adapter instance
+     *
+     * The 'adapter' entry in {@link $_options} will be used to create an
+     * adapter instance. This entry can be the default value of
+     * {@link $_options}, a value passed to the constructor or a value set by
+     * using {@link setAdapter()}
+     *
+     * This method is used for lazy-loading the adapter upon first use in
+     * {@link getAdapter()}
+     *
+     * @return void
+     */
+    protected function _createAdapter()
+    {
+        $adapterClass = $this->getOption('adapter');
+        $this->_adapter = new $adapterClass;
+        $this->_adapter->setOptions($this->getOption('adapteroptions'));
+    }
+
+    /**
+     * Get the adapter instance
+     *
+     * If {@see $_adapter} doesn't hold an instance a new one will be created by
+     * calling {@see _createAdapter()}
+     *
+     * @param boolean $autoload
+     * @return Solarium_Client_Adapter
+     */
+    public function getAdapter($autoload = true)
+    {
+        if (null === $this->_adapter && $autoload) {
+            $this->_createAdapter();
+        }
+
+        return $this->_adapter;
+    }
+
+    /**
+     * Register a querytype
+     *
+     * You can also use this method to override any existing querytype with a new mapping.
+     * This requires the availability of the classes through autoloading or a manual
+     * require before calling this method.
+     *
+     * @param string $type
+     * @param string $query
+     * @param string|object $requestBuilder
+     * @param string|object $responseParser
+     * @return Solarium_Client Provides fluent interface
+     */
+    public function registerQueryType($type, $query, $requestBuilder, $responseParser)
+    {
+        $this->_queryTypes[$type] = array(
+            'query' => $query,
+            'requestbuilder' => $requestBuilder,
+            'responseparser' => $responseParser,
+        );
+
+        return $this;
+    }
+
+    /**
+     * Register multiple querytypes
+     *
+     * @param array $queryTypes
+     * @return Solarium_Client Provides fluent interface
+     */
+    public function registerQueryTypes($queryTypes)
+    {
+        foreach ($queryTypes as $type => $queryType) {
+
+            if (!isset($queryType['type'])) $queryType['type'] = $type;
+
+            $this->registerQueryType(
+                $queryType['type'],
+                $queryType['query'],
+                $queryType['requestbuilder'],
+                $queryType['responseparser']
+            );
+        }
+    }
+
+    /**
+     * Get all registered querytypes
+     *
+     * @return array
+     */
+    public function getQueryTypes()
+    {
+        return $this->_queryTypes;
+    }
+
+    /**
+     * Register a plugin
+     *
+     * You can supply a plugin instance or a plugin classname as string.
+     * This requires the availability of the class through autoloading
+     * or a manual require.
+     *
+     * @param string $key
+     * @param string|Solarium_Plugin_Abstract $plugin
+     * @param array $options
+     * @return Solarium_Client Provides fluent interface
+     */
+    public function registerPlugin($key, $plugin, $options = array())
+    {
+        if (is_string($plugin)) {
+            $plugin = new $plugin;
+        }
+
+        if (!($plugin instanceof Solarium_Plugin_Abstract)) {
+           throw new Solarium_Exception('All plugins must extend Solarium_Plugin_Abstract');
+        }
+
+        $plugin->init($this, $options);
+
+        $this->_pluginInstances[$key] = $plugin;
+
+        return $this;
+    }
+
+    /**
+     * Register multiple plugins
+     *
+     * @param array $plugins
+     * @return Solarium_Client Provides fluent interface
+     */
+    public function registerPlugins($plugins)
+    {
+        foreach ($plugins as $key => $plugin) {
+
+            if (!isset($plugin['key'])) $plugin['key'] = $key;
+
+            $this->registerPlugin(
+                $plugin['key'],
+                $plugin['plugin'],
+                $plugin['options']
+            );
+        }
+
+        return $this;
+    }
+
+    /**
+     * Get all registered plugins
+     *
+     * @return array
+     */
+    public function getPlugins()
+    {
+        return $this->_pluginInstances;
+    }
+
+    /**
+     * Get a plugin instance
+     *
+     * @param string $key
+     * @param boolean $autocreate
+     * @return Solarium_Plugin_Abstract|null
+     */
+    public function getPlugin($key, $autocreate = true)
+    {
+        if (isset($this->_pluginInstances[$key])) {
+            return $this->_pluginInstances[$key];
+        } elseif ($autocreate) {
+            if (array_key_exists($key, $this->_pluginTypes)) {
+                $this->registerPlugin($key, $this->_pluginTypes[$key]);
+                return $this->_pluginInstances[$key];
+            } else {
+                throw new Solarium_Exception('Cannot autoload plugin of unknown type: ' . $key);
+            }
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Remove a plugin instance
+     *
+     * You can remove a plugin by passing the plugin key, or the plugin instance
+     *
+     * @param string|Solarium_Plugin_Abstract $plugin
+     * @return Solarium_Client Provides fluent interface
+     */
+    public function removePlugin($plugin)
+    {
+        if (is_object($plugin)) {
+            foreach ($this->_pluginInstances as $key => $instance) {
+                if ($instance === $plugin) {
+                    unset($this->_pluginInstances[$key]);
+                    break;
+                }
+            }
+        } else {
+            if (isset($this->_pluginInstances[$plugin])) {
+                unset($this->_pluginInstances[$plugin]);
+            }
+        }
+        return $this;
+    }
+
+    /**
+     * Trigger external events for plugins
+     *
+     * This methods adds 'namespacing' to the event name to prevent conflicts with Solariums internal event keys.
+     *
+     * Based on the event name you can always tell if an event was internal (Solarium base classes)
+     * or external (plugins, even if it's a plugin included with Solarium).
+     *
+     * External events always have the 'event' prefix in the event name.
+     *
+     * @param string $event
+     * @param array $params
+     * @param bool $resultOverride
+     * @return void|mixed
+     */
+    public function triggerEvent($event, $params = array(), $resultOverride = false)
+    {
+        // Add namespacing
+        $event = 'event'.$event;
+
+        return $this->_callPlugins($event, $params, $resultOverride);
+    }
+
+    /**
+     * Forward events to plugins
+     *
+     * @param string $event
+     * @param array $params
+     * @param bool $resultOverride
+     * @return void|mixed
+     */
+    protected function _callPlugins($event, $params, $resultOverride = false)
+    {
+        foreach ($this->_pluginInstances AS $plugin) {
+            if (method_exists($plugin, $event)) {
+                $result = call_user_func_array(array($plugin, $event), $params);
+
+                if ($result !== null && $resultOverride) {
+                    return $result;
+                }
+            }
+        }
+    }
+
+    /**
+     * Creates a request based on a query instance
+     *
+     * @param Solarium_Query $query
+     * @return Solarium_Client_Request
+     */
+    public function createRequest($query)
+    {
+        $pluginResult = $this->_callPlugins('preCreateRequest', array($query), true);
+        if($pluginResult !== null) return $pluginResult;
+
+        $queryType = $query->getType();
+        if (!isset($this->_queryTypes[$queryType])) {
+            throw new Solarium_Exception('No requestbuilder registered for querytype: '. $queryType);
+        }
+
+        $requestBuilder = $this->_queryTypes[$queryType]['requestbuilder'];
+        if (is_string($requestBuilder)) {
+            $requestBuilder = new $requestBuilder;
+        }
+        $request = $requestBuilder->build($query);
+
+        $this->_callPlugins('postCreateRequest', array($query, $request));
+
+        return $request;
+    }
+
+    /**
+     * Creates a result object
+     *
+     * @param Solarium_Query $query
+     * @param array Solarium_Client_Response $response
+     * @return Solarium_Result
+     */
+    public function createResult($query, $response)
+    {
+        $pluginResult = $this->_callPlugins('preCreateResult', array($query, $response), true);
+        if($pluginResult !== null) return $pluginResult;
+
+        $resultClass = $query->getResultClass();
+        $result = new $resultClass($this, $query, $response);
+
+        $this->_callPlugins('postCreateResult', array($query, $response, $result));
+
+        return $result;
+    }
+
+    /**
+     * Execute a query
+     *
+     * @param Solarium_Query
+     * @return Solarium_Result
+     */
+    public function execute($query)
+    {
+        $pluginResult = $this->_callPlugins('preExecute', array($query), true);
+        if($pluginResult !== null) return $pluginResult;
+
+        $request = $this->createRequest($query);
+        $response = $this->executeRequest($request);
+        $result = $this->createResult($query, $response);
+
+        $this->_callPlugins('postExecute', array($query, $result));
+
+        return $result;
+    }
+
+    /**
+     * Execute a request and return the response
+     *
+     * @param Solarium_Client_Request
+     * @return Solarium_Client_Response
+     */
+    public function executeRequest($request)
+    {
+        $pluginResult = $this->_callPlugins('preExecuteRequest', array($request), true);
+        if ($pluginResult !== null) {
+            $response = $pluginResult; //a plugin result overrules the standard execution result
+        } else {
+            $response = $this->getAdapter()->execute($request);
+        }
+
+        $this->_callPlugins('postExecuteRequest', array($request, $response));
+
+        return $response;
+    }
+
+    /**
+     * Execute a ping query
+     *
+     * Example usage:
+     * <code>
+     * $client = new Solarium_Client;
+     * $query = $client->createPing();
+     * $result = $client->ping($query);
+     * </code>
+     *
+     * @see Solarium_Query_Ping
+     *
+     * @internal This is a convenience method that forwards the query to the
+     *  execute method, thus allowing for an easy to use and clean API.
+     *
+     * @param Solarium_Query_Ping $query
+     * @return Solarium_Result_Ping
+     */
+    public function ping($query)
+    {
+        return $this->execute($query);
+    }
+
+    /**
+     * Execute an update query
+     *
+     * Example usage:
+     * <code>
+     * $client = new Solarium_Client;
+     * $query = $client->createUpdate();
+     * $update->addOptimize();
+     * $result = $client->update($update);
+     * </code>
+     *
+     * @see Solarium_Query_Update
+     * @see Solarium_Result_Update
+     *
+     * @internal This is a convenience method that forwards the query to the
+     *  execute method, thus allowing for an easy to use and clean API.
+     *
+     * @param Solarium_Query_Update $query
+     * @return Solarium_Result_Update
+     */
+    public function update($query)
+    {
+        return $this->execute($query);
+    }
+
+    /**
+     * Execute a select query
+     *
+     * Example usage:
+     * <code>
+     * $client = new Solarium_Client;
+     * $query = $client->createSelect();
+     * $result = $client->select($query);
+     * </code>
+     *
+     * @see Solarium_Query_Select
+     * @see Solarium_Result_Select
+     *
+     * @internal This is a convenience method that forwards the query to the
+     *  execute method, thus allowing for an easy to use and clean API.
+     *
+     * @param Solarium_Query_Select $query
+     * @return Solarium_Result_Select
+     */
+    public function select($query)
+    {
+        return $this->execute($query);
+    }
+
+    /**
+     * Execute a MoreLikeThis query
+     *
+     * Example usage:
+     * <code>
+     * $client = new Solarium_Client;
+     * $query = $client->createMoreLikeThis();
+     * $result = $client->moreLikeThis($query);
+     * </code>
+     *
+     * @see Solarium_Query_MoreLikeThis
+     * @see Solarium_Result_MoreLikeThis
+     *
+     * @internal This is a convenience method that forwards the query to the
+     *  execute method, thus allowing for an easy to use and clean API.
+     *
+     * @param Solarium_Query_MoreLikeThis $query
+     * @return Solarium_Result_MoreLikeThis
+     */
+    public function moreLikeThis($query)
+    {
+        return $this->execute($query);
+    }
+
+    /**
+     * Execute an analysis query
+     *
+     * @internal This is a convenience method that forwards the query to the
+     *  execute method, thus allowing for an easy to use and clean API.
+     *
+     * @param Solarium_Query_Analysis_Document|Solarium_Query_Analysis_Field $query
+     * @return Solarium_Result_Analysis_Document|Solarium_Result_Analysis_Field
+     */
+    public function analyze($query)
+    {
+        return $this->execute($query);
+    }
+
+    /**
+     * Execute a terms query
+     *
+     * @internal This is a convenience method that forwards the query to the
+     *  execute method, thus allowing for an easy to use and clean API.
+     *
+     * @param Solarium_Query_Terms $query
+     * @return Solarium_Result_Terms
+     */
+    public function terms($query)
+    {
+        return $this->execute($query);
+    }
+
+    /**
+     * Execute a suggester query
+     *
+     * @internal This is a convenience method that forwards the query to the
+     *  execute method, thus allowing for an easy to use and clean API.
+     *
+     * @param Solarium_Query_Suggester $query
+     * @return Solarium_Result_Suggester
+     */
+    public function suggester($query)
+    {
+        return $this->execute($query);
+    }
+
+    /**
+     * Create a query instance
+     *
+     * @param string $type
+     * @param array $options
+     * @return Solarium_Query
+     */
+    public function createQuery($type, $options = null)
+    {
+        $type = strtolower($type);
+
+        $pluginResult = $this->_callPlugins('preCreateQuery', array($type, $options), true);
+        if($pluginResult !== null) return $pluginResult;
+
+        if (!isset($this->_queryTypes[$type])) {
+            throw new Solarium_Exception('Unknown querytype: '. $type);
+        }
+
+        $class = $this->_queryTypes[$type]['query'];
+        $query = new $class($options);
+
+        $this->_callPlugins('postCreateQuery', array($type, $options, $query));
+
+        return $query;
+    }
+
+    /**
+     * Create a select query instance
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Select
+     */
+    public function createSelect($options = null)
+    {
+        return $this->createQuery(self::QUERYTYPE_SELECT, $options);
+    }
+
+    /**
+     * Create a MoreLikeThis query instance
+     *
+     * @param mixed $options
+     * @return Solarium_Query_MoreLikeThis
+     */
+    public function createMoreLikeThis($options = null)
+    {
+        return $this->createQuery(self::QUERYTYPE_MORELIKETHIS, $options);
+    }
+
+    /**
+     * Create an update query instance
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Update
+     */
+    public function createUpdate($options = null)
+    {
+        return $this->createQuery(self::QUERYTYPE_UPDATE, $options);
+    }
+
+    /**
+     * Create a ping query instance
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Ping
+     */
+    public function createPing($options = null)
+    {
+        return $this->createQuery(self::QUERYTYPE_PING, $options);
+    }
+
+    /**
+     * Create an analysis field query instance
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Analysis_Field
+     */
+    public function createAnalysisField($options = null)
+    {
+        return $this->createQuery(self::QUERYTYPE_ANALYSIS_FIELD, $options);
+    }
+
+    /**
+     * Create an analysis document query instance
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Analysis_Document
+     */
+    public function createAnalysisDocument($options = null)
+    {
+        return $this->createQuery(self::QUERYTYPE_ANALYSIS_DOCUMENT, $options);
+    }
+
+    /**
+     * Create a terms query instance
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Terms
+     */
+    public function createTerms($options = null)
+    {
+        return $this->createQuery(self::QUERYTYPE_TERMS, $options);
+    }
+
+    /**
+     * Create a suggester query instance
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Suggester
+     */
+    public function createSuggester($options = null)
+    {
+        return $this->createQuery(self::QUERYTYPE_SUGGESTER, $options);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Exception.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Exception.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Exception.php	(revision 7576)
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * Solarium specific exception
+ *
+ * All exceptions thrown by Solarium are of this type. This way you can easily
+ * catch Solarium exceptions and keep them separate from your own exceptions.
+ *
+ * @package Solarium
+ */
+class Solarium_Exception extends Exception
+{
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result.php	(revision 7576)
@@ -0,0 +1,147 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Query result
+ *
+ * This base class provides access to the response and decoded data. If you need more functionality
+ * like resultset parsing use one of the subclasses
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result
+{
+
+    /**
+     * Response object
+     *
+     * @var Solarium_Client_Response
+     */
+    protected $_response;
+
+    /**
+     * Decode response data
+     *
+     * This is lazy loaded, {@link getData()}
+     *
+     * @var array
+     */
+    protected $_data;
+
+    /**
+     * Query used for this request
+     *
+     * @var Solarium_Query
+     */
+    protected $_query;
+
+    /**
+     * Solarium client instance
+     *
+     * @var Solarium_Client
+     */
+    protected $_client;
+
+    /**
+     * Constructor
+     *
+     * @param Solarium_Client $client
+     * @param Solarium_Query $query
+     * @param Solarium_Client_Response $response
+     * @return void
+     */
+    public function __construct($client, $query, $response)
+    {
+        $this->_client = $client;
+        $this->_query = $query;
+        $this->_response = $response;
+
+        // check status for error (range of 400 and 500)
+        $statusNum = floor($response->getStatusCode() / 100);
+        if ($statusNum == 4 || $statusNum == 5) {
+            throw new Solarium_Client_HttpException(
+                $response->getStatusMessage(),
+                $response->getStatusCode()
+            );
+        }
+    }
+
+    /**
+     * Get response object
+     *
+     * This is the raw HTTP response object, not the parsed data!
+     *
+     * @return Solarium_Client_Response
+     */
+    public function getResponse()
+    {
+        return $this->_response;
+    }
+
+    /**
+     * Get query instance
+     *
+     * @return Solarium_Query
+     */
+    public function getQuery()
+    {
+        return $this->_query;
+    }
+
+    /**
+     * Get Solr response data
+     *
+     * Includes a lazy loading mechanism: JSON body data is decoded on first use and then saved for reuse.
+     *
+     * @return array
+     */
+    public function getData()
+    {
+        if (null == $this->_data) {
+            $this->_data = json_decode($this->_response->getBody(), true);
+            if (null === $this->_data) {
+                throw new Solarium_Exception(
+                    'Solr JSON response could not be decoded'
+                );
+            }
+        }
+
+        return $this->_data;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Autoloader.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Autoloader.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Autoloader.php	(revision 7576)
@@ -0,0 +1,93 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * Autoloader
+ *
+ * This class is included to allow for easy usage of Solarium. If you already
+ * have your own autoloader that follows the Zend Framework class/file naming
+ * you can use that to autoload Solarium (for instance Zend_Loader).
+ *
+ * @package Solarium
+ */
+class Solarium_Autoloader
+{
+
+    /**
+     * Register the Solarium autoloader
+     *
+     * The autoloader only acts for classnames that start with 'Solarium'. It
+     * will be appended to any other autoloaders already registered.
+     *
+     * Using this autoloader will disable any existing __autoload function. If
+     * you want to use multiple autoloaders please use spl_autoload_register.
+     *
+     * @static
+     * @return void
+     */
+    static public function register()
+    {
+        spl_autoload_register(array(new self, 'load'));
+    }
+
+    /**
+     * Autoload a class
+     *
+     * This method is automatically called after registering this autoloader.
+     * The autoloader only acts for classnames that start with 'Solarium'.
+     *
+     * @static
+     * @param string $class
+     * @return void
+     */
+    static public function load($class)
+    {
+        if (substr($class, 0, 8) == 'Solarium') {
+
+            $class = str_replace(
+                array('Solarium', '_'),
+                array('', '/'),
+                $class
+            );
+            
+            $file = dirname(__FILE__) . '/' . $class . '.php';
+
+            require($file);
+        }
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/FilterQuery.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/FilterQuery.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/FilterQuery.php	(revision 7576)
@@ -0,0 +1,214 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Filterquery
+ *
+ * @link http://wiki.apache.org/solr/CommonQueryParameters#fq
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_FilterQuery extends Solarium_Configurable
+{
+
+    /**
+     * Tags for this filterquery
+     *
+     * @var array
+     */
+    protected $_tags = array();
+
+    /**
+     * Query
+     *
+     * @var string
+     */
+    protected $_query;
+
+    /**
+     * Initialize options
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'tag':
+                    if(!is_array($value)) $value = array($value);
+                    $this->addTags($value);
+                    break;
+                case 'key':
+                    $this->setKey($value);
+                    break;
+                case 'query':
+                    $this->setQuery($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Get key value
+     *
+     * @return string
+     */
+    public function getKey()
+    {
+        return $this->getOption('key');
+    }
+
+    /**
+     * Set key value
+     *
+     * @param string $value
+     * @return Solarium_Query_Select_FilterQuery Provides fluent interface
+     */
+    public function setKey($value)
+    {
+        return $this->_setOption('key', $value);
+    }
+
+    /**
+     * Set the query string
+     *
+     * This overwrites the current value
+     *
+     * @param string $query
+     * @param array $bind Bind values for placeholders in the query string
+     * @return Solarium_Query Provides fluent interface
+     */
+    public function setQuery($query, $bind = null)
+    {
+        if (!is_null($bind)) {
+            $helper = new Solarium_Query_Helper;
+            $query = $helper->assemble($query, $bind);
+        }
+
+        $this->_query = trim($query);
+        return $this;
+    }
+
+    /**
+     * Get the query string
+     *
+     * @return string
+     */
+    public function getQuery()
+    {
+        return $this->_query;
+    }
+
+    /**
+     * Add a tag
+     *
+     * @param string $tag
+     * @return Solarium_Query_Select_FilterQuery Provides fluent interface
+     */
+    public function addTag($tag)
+    {
+        $this->_tags[$tag] = true;
+        return $this;
+    }
+
+    /**
+     * Add tags
+     *
+     * @param array $tags
+     * @return Solarium_Query_Select_FilterQuery Provides fluent interface
+     */
+    public function addTags($tags)
+    {
+        foreach ($tags AS $tag) {
+            $this->addTag($tag);
+        }
+        return $this;
+    }
+
+    /**
+     * Get all tagss
+     *
+     * @return array
+     */
+    public function getTags()
+    {
+        return array_keys($this->_tags);
+    }
+
+    /**
+     * Remove a tag
+     *
+     * @param string $tag
+     * @return Solarium_Query_Select_FilterQuery Provides fluent interface
+     */
+    public function removeTag($tag)
+    {
+        if (isset($this->_tags[$tag])) {
+            unset($this->_tags[$tag]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all tags
+     *
+     * @return Solarium_Query_Select_FilterQuery Provides fluent interface
+     */
+    public function clearTags()
+    {
+        $this->_tags = array();
+        return $this;
+    }
+
+    /**
+     * Set multiple tags
+     *
+     * This overwrites any existing tags
+     *
+     * @param array $filterQueries
+     * @return Solarium_Query_Select_FilterQuery Provides fluent interface
+     */
+    public function setTags($filterQueries)
+    {
+        $this->clearTags();
+        return $this->addTags($filterQueries);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Grouping.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Grouping.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Grouping.php	(revision 7576)
@@ -0,0 +1,409 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Grouping component
+ *
+ * Also known as Result Grouping or Field Collapsing.
+ * See the Solr wiki for more info about this functionality
+ *
+ * @link http://wiki.apache.org/solr/FieldCollapsing
+ *
+ * @since 2.1.0
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_Grouping extends Solarium_Query_Select_Component
+{
+
+    /**
+     * Value for format grouped
+     */
+    const FORMAT_GROUPED = 'grouped';
+
+    /**
+     * Value for format simple
+     */
+    const FORMAT_SIMPLE = 'simple';
+
+    /**
+     * Component type
+     *
+     * @var string
+     */
+    protected $_type = Solarium_Query_Select::COMPONENT_GROUPING;
+
+    /**
+     * Fields for grouping
+     *
+     * @var array
+     */
+    protected $_fields = array();
+
+    /**
+     * Queries for grouping
+     *
+     * @var array
+     */
+    protected $_queries = array();
+
+    /**
+     * Initialize options
+     *
+     * Several options need some extra checks or setup work, for these options
+     * the setters are called.
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'queries':
+                    $this->setQueries($value);
+                    break;
+                case 'fields':
+                    $this->setFields($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Add a grouping field
+     *
+     * Group based on the unique values of a field
+     *
+     * @param string $field
+     * @return Solarium_Field_Select_Component_Grouping fluent interface
+     */
+    public function addField($field)
+    {
+        $this->_fields[] = $field;
+
+        return $this;
+    }
+
+    /**
+     * Add multiple grouping fields
+     *
+     * You can use an array or a comma separated string as input
+     *
+     * @param array|string $fields
+     * @return Solarium_Field_Select_Component_Grouping Provides fluent interface
+     */
+    public function addFields($fields)
+    {
+        if (is_string($fields)) {
+            $fields = explode(',', $fields);
+            $fields = array_map('trim', $fields);
+        }
+
+        $this->_fields = array_merge($this->_fields, $fields);
+
+        return $this;
+    }
+
+    /**
+     * Get all fields
+     *
+     * @return array
+     */
+    public function getFields()
+    {
+        return $this->_fields;
+    }
+
+    /**
+     * Remove all fields
+     *
+     * @return Solarium_Field_Select_Component_Grouping fluent interface
+     */
+    public function clearFields()
+    {
+        $this->_fields = array();
+        return $this;
+    }
+
+    /**
+     * Set multiple fields
+     *
+     * This overwrites any existing fields
+     *
+     * @param array $fields
+     */
+    public function setFields($fields)
+    {
+        $this->clearFields();
+        $this->addFields($fields);
+    }
+
+    /**
+     * Add a grouping query
+     *
+     * Group documents that match the given query
+     *
+     * @param string $query
+     * @return Solarium_Query_Select_Component_Grouping fluent interface
+     */
+    public function addQuery($query)
+    {
+        $this->_queries[] = $query;
+
+        return $this;
+    }
+
+    /**
+     * Add multiple grouping queries
+     *
+     * @param array|string $queries
+     * @return Solarium_Query_Select_Component_Grouping Provides fluent interface
+     */
+    public function addQueries($queries)
+    {
+        if(!is_array($queries)) $queries = array($queries);
+
+        $this->_queries = array_merge($this->_queries, $queries);
+
+        return $this;
+    }
+
+    /**
+     * Get all queries
+     *
+     * @return array
+     */
+    public function getQueries()
+    {
+        return $this->_queries;
+    }
+
+    /**
+     * Remove all queries
+     *
+     * @return Solarium_Query_Select_Component_Grouping fluent interface
+     */
+    public function clearQueries()
+    {
+        $this->_queries = array();
+        return $this;
+    }
+
+    /**
+     * Set multiple queries
+     *
+     * This overwrites any existing queries
+     *
+     * @param array $queries
+     */
+    public function setQueries($queries)
+    {
+        $this->clearQueries();
+        $this->addQueries($queries);
+    }
+
+    /**
+     * Set limit option
+     *
+     * The number of results (documents) to return for each group
+     *
+     * @param int $limit
+     * @return Solarium_Query_Select_Component_Grouping Provides fluent interface
+     */
+    public function setLimit($limit)
+    {
+        return $this->_setOption('limit', $limit);
+    }
+
+    /**
+     * Get limit option
+     *
+     * @return string|null
+     */
+    public function getLimit()
+    {
+        return $this->getOption('limit');
+    }
+
+    /**
+     * Set offset option
+     *
+     * The offset into the document list of each group.
+     *
+     * @param int $offset
+     * @return Solarium_Query_Select_Component_Grouping Provides fluent interface
+     */
+    public function setOffset($offset)
+    {
+        return $this->_setOption('offset', $offset);
+    }
+
+    /**
+     * Get offset option
+     *
+     * @return string|null
+     */
+    public function getOffset()
+    {
+        return $this->getOption('offset');
+    }
+
+    /**
+     * Set sort option
+     *
+     * How to sort documents within a single group
+     *
+     * @param string $sort
+     * @return Solarium_Query_Select_Component_Grouping Provides fluent interface
+     */
+    public function setSort($sort)
+    {
+        return $this->_setOption('sort', $sort);
+    }
+
+    /**
+     * Get sort option
+     *
+     * @return string|null
+     */
+    public function getSort()
+    {
+        return $this->getOption('sort');
+    }
+
+    /**
+     * Set mainresult option
+     *
+     * If true, the result of the first field grouping command is used as the main
+     * result list in the response, using group format 'simple'
+     *
+     * @param boolean $value
+     * @return Solarium_Query_Select_Component_Grouping Provides fluent interface
+     */
+    public function setMainResult($value)
+    {
+        return $this->_setOption('mainresult', $value);
+    }
+
+    /**
+     * Get mainresult option
+     *
+     * @return boolean|null
+     */
+    public function getMainResult()
+    {
+        return $this->getOption('mainresult');
+    }
+
+    /**
+     * Set numberofgroups option
+     *
+     * If true, includes the number of groups that have matched the query.
+     *
+     * @param boolean $value
+     * @return Solarium_Query_Select_Component_Grouping Provides fluent interface
+     */
+    public function setNumberOfGroups($value)
+    {
+        return $this->_setOption('numberofgroups', $value);
+    }
+
+    /**
+     * Get numberofgroups option
+     *
+     * @return boolean|null
+     */
+    public function getNumberOfGroups()
+    {
+        return $this->getOption('numberofgroups');
+    }
+
+    /**
+     * Set cachepercentage option
+     *
+     * If > 0 enables grouping cache. Grouping is executed actual two searches.
+     * This option caches the second search. A value of 0 disables grouping caching.
+     *
+     * Tests have shown that this cache only improves search time with boolean queries,
+     * wildcard queries and fuzzy queries. For simple queries like a term query or
+     * a match all query this cache has a negative impact on performance
+     *
+     * @param integer $value
+     * @return Solarium_Query_Select_Component_Grouping Provides fluent interface
+     */
+    public function setCachePercentage($value)
+    {
+        return $this->_setOption('cachepercentage', $value);
+    }
+
+    /**
+     * Get cachepercentage option
+     *
+     * @return integer|null
+     */
+    public function getCachePercentage()
+    {
+        return $this->getOption('cachepercentage');
+    }
+
+    /**
+     * Set truncate option
+     *
+     * If true, facet counts are based on the most relevant document of each group matching the query.
+     * Same applies for StatsComponent. Default is false. Only available from Solr 3.4
+     *
+     * @param boolean $value
+     * @return Solarium_Query_Select_Component_Grouping Provides fluent interface
+     */
+    public function setTruncate($value)
+    {
+        return $this->_setOption('truncate', $value);
+    }
+
+    /**
+     * Get truncate option
+     *
+     * @return boolean|null
+     */
+    public function getTruncate()
+    {
+        return $this->getOption('truncate');
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet/Range.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet/Range.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet/Range.php	(revision 7576)
@@ -0,0 +1,305 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Facet range
+ *
+ * @link http://wiki.apache.org/solr/SimpleFacetParameters#Facet_by_Range
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_Facet_Range extends Solarium_Query_Select_Component_Facet
+{
+
+    /**
+     * Value for the 'other' option
+     */
+    const OTHER_BEFORE = 'before';
+
+    /**
+     * Value for the 'other' option
+     */
+    const OTHER_AFTER = 'after';
+
+    /**
+     * Value for the 'other' option
+     */
+    const OTHER_BETWEEN = 'between';
+
+    /**
+     * Value for the 'other' option
+     */
+    const OTHER_ALL = 'all';
+
+    /**
+     * Value for the 'other' option
+     */
+    const OTHER_NONE = 'none';
+
+    /**
+     * Value for the 'include' option
+     */
+    const INCLUDE_LOWER = 'lower';
+
+    /**
+     * Value for the 'include' option
+     */
+    const INCLUDE_UPPER = 'upper';
+
+    /**
+     * Value for the 'include' option
+     */
+    const INCLUDE_EDGE = 'edge';
+
+    /**
+     * Value for the 'include' option
+     */
+    const INCLUDE_OUTER = 'outer';
+
+    /**
+     * Value for the 'include' option
+     */
+    const INCLUDE_ALL = 'all';
+
+    /**
+     * Initialize options
+     *
+     * Several options need some extra checks or setup work, for these options
+     * the setters are called.
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        parent::_init();
+
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'include':
+                    $this->setInclude($value);
+                    break;
+                case 'other':
+                    $this->setOther($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Get the facet type
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Query_Select_Component_FacetSet::FACET_RANGE;
+    }
+    
+    /**
+     * Set the field name
+     *
+     * @param string $field
+     * @return Solarium_Query_Select_Component_Facet_Range Provides fluent interface
+     */
+    public function setField($field)
+    {
+        return $this->_setOption('field', $field);
+    }
+
+    /**
+     * Get the field name
+     *
+     * @return string
+     */
+    public function getField()
+    {
+        return $this->getOption('field');
+    }
+
+    /**
+     * Set the lower bound of the range
+     *
+     * @param string $start
+     * @return Solarium_Query_Select_Component_Facet_Range Provides fluent interface
+     */
+    public function setStart($start)
+    {
+        return $this->_setOption('start', $start);
+    }
+
+    /**
+     * Get the lower bound of the range
+     *
+     * @return string
+     */
+    public function getStart()
+    {
+        return $this->getOption('start');
+    }
+
+    /**
+     * Set the upper bound of the range
+     *
+     * @param string $end
+     * @return Solarium_Query_Select_Component_Facet_Range Provides fluent interface
+     */
+    public function setEnd($end)
+    {
+        return $this->_setOption('end', $end);
+    }
+
+    /**
+     * Get the upper bound of the range
+     *
+     * @return string
+     */
+    public function getEnd()
+    {
+        return $this->getOption('end');
+    }
+
+    /**
+     * Set range gap
+     *
+     * The size of each range expressed as a value to be added to the lower bound
+     *
+     * @param string $gap
+     * @return Solarium_Query_Select_Component_Facet_Range Provides fluent interface
+     */
+    public function setGap($gap)
+    {
+        return $this->_setOption('gap', $gap);
+    }
+
+    /**
+     * Get range gap
+     *
+     * The size of each range expressed as a value to be added to the lower bound
+     *
+     * @return string
+     */
+    public function getGap()
+    {
+        return $this->getOption('gap');
+    }
+
+    /**
+     * Set hardend option
+     *
+     * A Boolean parameter instructing Solr what to do in the event that facet.range.gap
+     * does not divide evenly between facet.range.start and facet.range.end
+     *
+     * @param boolean $hardend
+     * @return Solarium_Query_Select_Component_Facet_Range Provides fluent interface
+     */
+    public function setHardend($hardend)
+    {
+        return $this->_setOption('hardend', $hardend);
+    }
+
+    /**
+     * Get hardend option
+     *
+     * @return boolean
+     */
+    public function getHardend()
+    {
+        return $this->getOption('hardend');
+    }
+
+    /**
+     * Set other counts
+     *
+     * Use one of the constants as value.
+     * If you want to use multiple values supply an array or comma separated string
+     *
+     * @param string|array $other
+     * @return Solarium_Query_Select_Component_Facet_Range Provides fluent interface
+     */
+    public function setOther($other)
+    {
+        if (is_array($other)) {
+            $other = implode(',', $other);
+        }
+
+        return $this->_setOption('other', $other);   
+    }
+
+    /**
+     * Get other counts
+     *
+     * In case of multiple values a comma separated string will be returned
+     *
+     * @return string
+     */
+    public function getOther()
+    {
+        return $this->getOption('other');
+    }
+
+    /**
+     * Set include option
+     *
+     * Use one of the constants as value.
+     * If you want to use multiple values supply an array or comma separated string
+     *
+     * @param string|array $include
+     * @return Solarium_Query_Select_Component_Facet_Range Provides fluent interface
+     */
+    public function setInclude($include)
+    {
+        if (is_array($include)) {
+            $include = implode(',', $include);
+        }
+
+        return $this->_setOption('include', $include);
+    }
+
+    /**
+     * Get include option
+     *
+     * In case of multiple values a comma separated string will be returned
+     *
+     * @return string
+     */
+    public function getInclude()
+    {
+        return $this->getOption('include');
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet/MultiQuery.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet/MultiQuery.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet/MultiQuery.php	(revision 7576)
@@ -0,0 +1,300 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Facet MultiQuery
+ *
+ * This is a 'virtual' querytype that combines multiple facet queries into a
+ * single resultset
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_Facet_MultiQuery extends Solarium_Query_Select_Component_Facet
+{
+
+    /**
+     * Facet query objects
+     *
+     * @var array
+     */
+    protected $_facetQueries = array();
+
+    /**
+     * Initialize options
+     *
+     * Several options need some extra checks or setup work, for these options
+     * the setters are called.
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        parent::_init();
+
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'query':
+                    if(!is_array($value)) $value = array($value);
+                    $this->addQueries($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Get the facet type
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Query_Select_Component_FacetSet::FACET_MULTIQUERY;
+    }
+
+    /**
+     * Create a new facetQuery
+     *
+     * Convenience method so you don't need to manually create facetquery
+     * objects.
+     *
+     * @param string $key
+     * @param string $query
+     * @param array $excludes
+     * @return Solarium_Query_Select_Component_Facet_MultiQuery Provides fluent interface
+     */
+    public function createQuery($key, $query, $excludes = array())
+    {
+        // merge excludes with shared excludes
+        $excludes = array_merge($this->getExcludes(), $excludes);
+
+        $facetQuery = new Solarium_Query_Select_Component_Facet_Query;
+        $facetQuery->setKey($key);
+        $facetQuery->setQuery($query);
+        $facetQuery->setExcludes($excludes);
+
+        return $this->addQuery($facetQuery);
+    }
+
+    /**
+     * Add a facetquery
+     *
+     * Supports a facetquery instance or a config array, in that case a new
+     * facetquery instance wil be created based on the options.
+     *
+     * @param Solarium_Query_Select_Component_Facet_Query|array $facetQuery
+     * @return Solarium_Query_Select_Component_Facet_MultiQuery Provides fluent interface
+     */
+    public function addQuery($facetQuery)
+    {
+        if (is_array($facetQuery)) {
+            $facetQuery = new Solarium_Query_Select_Component_Facet_Query($facetQuery);
+        }
+
+        $key = $facetQuery->getKey();
+
+        if (0 === strlen($key)) {
+            throw new Solarium_Exception('A facetquery must have a key value');
+        }
+
+        if (array_key_exists($key, $this->_facetQueries)) {
+            throw new Solarium_Exception('A query must have a unique key value within a multiquery facet');
+        }
+
+        // forward shared excludes
+        $facetQuery->addExcludes($this->getExcludes());
+
+        $this->_facetQueries[$key] = $facetQuery;
+        return $this;
+    }
+
+    /**
+     * Add multiple facetqueries
+     *
+     * @param array $facetQueries Instances or config array
+     * @return Solarium_Query_Select_Component_Facet_MultiQuery Provides fluent interface
+     */
+    public function addQueries(array $facetQueries)
+    {
+        foreach ($facetQueries AS $key => $facetQuery) {
+
+            // in case of a config array: add key to config
+            if (is_array($facetQuery) && !isset($facetQuery['key'])) {
+                $facetQuery['key'] = $key;
+            }
+
+            $this->addQuery($facetQuery);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Get a facetquery
+     *
+     * @param string $key
+     * @return string
+     */
+    public function getQuery($key)
+    {
+        if (isset($this->_facetQueries[$key])) {
+            return $this->_facetQueries[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all facetqueries
+     *
+     * @return array
+     */
+    public function getQueries()
+    {
+        return $this->_facetQueries;
+    }
+
+    /**
+     * Remove a single facetquery
+     *
+     * You can remove a facetquery by passing it's key or the facetquery instance
+     *
+     * @param string|Solarium_Query_Select_Component_Facet_Query $query
+     * @return Solarium_Query_Select_Component_Facet_MultiQuery Provides fluent interface
+     */
+    public function removeQuery($query)
+    {
+        if (is_object($query)) {
+            $query = $query->getKey();
+        }
+
+        if (isset($this->_facetQueries[$query])) {
+            unset($this->_facetQueries[$query]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all facetqueries
+     *
+     * @return Solarium_Query_Select_Component_Facet_MultiQuery Provides fluent interface
+     */
+    public function clearQueries()
+    {
+        $this->_facetQueries = array();
+        return $this;
+    }
+
+    /**
+     * Set multiple facetqueries
+     *
+     * This overwrites any existing facetqueries
+     *
+     * @param array $facetQueries
+     * @return Solarium_Query_Select_Component_Facet_MultiQuery Provides fluent interface
+     */
+    public function setQueries($facetQueries)
+    {
+        $this->clearQueries();
+        return $this->addQueries($facetQueries);
+    }
+
+    /**
+     * Add an exclude tag
+     *
+     * Excludes added to the MultiQuery facet a shared by all underlying
+     * FacetQueries, so they must be forwarded to any existing instances.
+     *
+     * If you don't want to share an exclude use the addExclude method of a
+     * specific FacetQuery instance instead.
+     *
+     * @param string $tag
+     * @return Solarium_Query_Select_Component_Facet Provides fluent interface
+     */
+    public function addExclude($tag)
+    {
+        foreach ($this->_facetQueries AS $facetQuery) {
+            $facetQuery->addExclude($tag);
+        }
+
+        return parent::addExclude($tag);
+    }
+
+    /**
+     * Remove a single exclude tag
+     *
+     * Excludes added to the MultiQuery facet a shared by all underlying
+     * FacetQueries, so changes must be forwarded to any existing instances.
+     *
+     * If you don't want this use the removeExclude method of a
+     * specific FacetQuery instance instead.
+     *
+     * @param string $exclude
+     * @return Solarium_Query_Select_Component_Facet_MultiQuery Provides fluent interface
+     */
+    public function removeExclude($exclude)
+    {
+        foreach ($this->_facetQueries AS $facetQuery) {
+            $facetQuery->removeExclude($exclude);
+        }
+
+        return parent::removeExclude($exclude);
+    }
+
+    /**
+     * Remove all excludes
+     *
+     * Excludes added to the MultiQuery facet a shared by all underlying
+     * FacetQueries, so changes must be forwarded to any existing instances.
+     *
+     * If you don't want this use the clearExcludes method of a
+     * specific FacetQuery instance instead.
+     *
+     * @return Solarium_Query_Select_Component_Facet_MultiQuery Provides fluent interface
+     */
+    public function clearExcludes()
+    {
+        foreach ($this->_facetQueries AS $facetQuery) {
+            $facetQuery->clearExcludes();
+        }
+
+        return parent::clearExcludes();
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet/Field.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet/Field.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet/Field.php	(revision 7576)
@@ -0,0 +1,261 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Facet query
+ *
+ * @link http://wiki.apache.org/solr/SimpleFacetParameters#Field_Value_Faceting_Parameters
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_Facet_Field extends Solarium_Query_Select_Component_Facet
+{
+
+    /**
+     * Facet sort type index
+     */
+    const SORT_INDEX = 'index';
+
+    /**
+     * Facet sort type count
+     */
+    const SORT_COUNT = 'count';
+
+    /**
+     * Facet method enum
+     */
+    const METHOD_ENUM = 'enum';
+
+    /**
+     * Facet method fc
+     */
+    const METHOD_FC = 'fc';
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'field' => 'id'
+    );
+
+    /**
+     * Get the facet type
+     * 
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Query_Select_Component_FacetSet::FACET_FIELD;
+    }
+    
+    /**
+     * Set the field name
+     *
+     * @param string $field
+     * @return Solarium_Query_Select_Component_Facet_Field Provides fluent interface
+     */
+    public function setField($field)
+    {
+        return $this->_setOption('field', $field);
+    }
+
+    /**
+     * Get the field name
+     *
+     * @return string
+     */
+    public function getField()
+    {
+        return $this->getOption('field');
+    }
+
+    /**
+     * Set the facet sort order
+     *
+     * Use one of the SORT_* constants as the value
+     *
+     * @param string $sort
+     * @return Solarium_Query_Select_Component_Facet_Field Provides fluent interface
+     */
+    public function setSort($sort)
+    {
+        return $this->_setOption('sort', $sort);
+    }
+
+    /**
+     * Get the facet sort order
+     *
+     * @return string
+     */
+    public function getSort()
+    {
+        return $this->getOption('sort');
+    }
+
+    /**
+     * Limit the terms for faceting by a prefix
+     *
+     * @param string $prefix
+     * @return Solarium_Query_Select_Component_Facet_Field Provides fluent interface
+     */
+    public function setPrefix($prefix)
+    {
+        return $this->_setOption('prefix', $prefix);
+    }
+
+    /**
+     * Get the facet prefix
+     *
+     * @return string
+     */
+    public function getPrefix()
+    {
+        return $this->getOption('prefix');
+    }
+
+    /**
+     * Set the facet limit
+     *
+     * @param int $limit
+     * @return Solarium_Query_Select_Component_Facet_Field Provides fluent interface
+     */
+    public function setLimit($limit)
+    {
+        return $this->_setOption('limit', $limit);
+    }
+
+    /**
+     * Get the facet limit
+     *
+     * @return string
+     */
+    public function getLimit()
+    {
+        return $this->getOption('limit');
+    }
+
+    /**
+     * Set the facet offset
+     *
+     * @param int $offset
+     * @return Solarium_Query_Select_Component_Facet_Field Provides fluent interface
+     */
+    public function setOffset($offset)
+    {
+        return $this->_setOption('offset', $offset);
+    }
+
+    /**
+     * Get the facet offset
+     *
+     * @return int
+     */
+    public function getOffset()
+    {
+        return $this->getOption('offset');
+    }
+
+    /**
+     * Set the facet mincount
+     *
+     * @param int $minCount
+     * @return Solarium_Query_Select_Component_Facet_Field Provides fluent interface
+     */
+    public function setMinCount($minCount)
+    {
+        return $this->_setOption('mincount', $minCount);
+    }
+
+    /**
+     * Get the facet mincount
+     *
+     * @return int
+     */
+    public function getMinCount()
+    {
+        return $this->getOption('mincount');
+    }
+
+    /**
+     * Set the missing count option
+     *
+     * @param boolean $missing
+     * @return Solarium_Query_Select_Component_Facet_Field Provides fluent interface
+     */
+    public function setMissing($missing)
+    {
+        return $this->_setOption('missing', $missing);
+    }
+
+    /**
+     * Get the facet missing option
+     *
+     * @return boolean
+     */
+    public function getMissing()
+    {
+        return $this->getOption('missing');
+    }
+
+    /**
+     * Set the facet method
+     *
+     * Use one of the METHOD_* constants as value
+     *
+     * @param string $method
+     * @return Solarium_Query_Select_Facet_Field Provides fluent interface
+     */
+    public function setMethod($method)
+    {
+        return $this->_setOption('method', $method);
+    }
+
+    /**
+     * Get the facet method
+     *
+     * @return string
+     */
+    public function getMethod()
+    {
+        return $this->getOption('method');
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet/Query.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet/Query.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet/Query.php	(revision 7576)
@@ -0,0 +1,98 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Facet query
+ *
+ * @link http://wiki.apache.org/solr/SimpleFacetParameters#facet.query_:_Arbitrary_Query_Faceting
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_Facet_Query extends Solarium_Query_Select_Component_Facet
+{
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'query' => '*:*'
+    );
+
+    /**
+     * Get the facet type
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Query_Select_Component_FacetSet::FACET_QUERY;
+    }
+
+    /**
+     * Set the query string
+     *
+     * This overwrites the current value
+     *
+     * @param string $query
+     * @param array $bind Bind values for placeholders in the query string
+     * @return Solarium_Query_Select_Facet_Query Provides fluent interface
+     */
+    public function setQuery($query, $bind = null)
+    {
+        if (!is_null($bind)) {
+            $helper = new Solarium_Query_Helper;
+            $query = $helper->assemble($query, $bind);
+        }
+
+        return $this->_setOption('query', $query);
+    }
+
+    /**
+     * Get the query string
+     *
+     * @return string
+     */
+    public function getQuery()
+    {
+        return $this->getOption('query');
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Spellcheck.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Spellcheck.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Spellcheck.php	(revision 7576)
@@ -0,0 +1,341 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Spellcheck component
+ *
+ * @link http://wiki.apache.org/solr/SpellCheckComponent
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_Component
+{
+    /**
+     * Component type
+     *
+     * @var string
+     */
+    protected $_type = Solarium_Query_Select::COMPONENT_SPELLCHECK;
+
+    /**
+     * Set query option
+     *
+     * Query to spellcheck
+     *
+     * @param string $query
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setQuery($query)
+    {
+        return $this->_setOption('query', $query);
+    }
+
+    /**
+     * Get query option
+     *
+     * @return string|null
+     */
+    public function getQuery()
+    {
+        return $this->getOption('query');
+    }
+
+    /**
+     * Set build option
+     *
+     * Build the spellcheck?
+     *
+     * @param boolean $build
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setBuild($build)
+    {
+        return $this->_setOption('build', $build);
+    }
+
+    /**
+     * Get build option
+     *
+     * @return boolean|null
+     */
+    public function getBuild()
+    {
+        return $this->getOption('build');
+    }
+
+    /**
+     * Set reload option
+     *
+     * Reload the dictionary?
+     *
+     * @param boolean $reload
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setReload($reload)
+    {
+        return $this->_setOption('reload', $reload);
+    }
+
+    /**
+     * Get fragsize option
+     *
+     * @return boolean|null
+     */
+    public function getReload()
+    {
+        return $this->getOption('reload');
+    }
+
+    /**
+     * Set dictionary option
+     *
+     * The name of the dictionary to use
+     *
+     * @param string $dictionary
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setDictionary($dictionary)
+    {
+        return $this->_setOption('dictionary', $dictionary);
+    }
+
+    /**
+     * Get dictionary option
+     *
+     * @return string|null
+     */
+    public function getDictionary()
+    {
+        return $this->getOption('dictionary');
+    }
+
+    /**
+     * Set count option
+     *
+	 * The maximum number of suggestions to return
+	 *
+     * @param int $count
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setCount($count)
+    {
+        return $this->_setOption('count', $count);
+    }
+
+    /**
+     * Get count option
+     *
+     * @return int|null
+     */
+    public function getCount()
+    {
+        return $this->getOption('count');
+    }
+
+    /**
+     * Set onlyMorePopular option
+     *
+     * Only return suggestions that result in more hits for the query than the existing query
+     *
+     * @param boolean $onlyMorePopular
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setOnlyMorePopular($onlyMorePopular)
+    {
+        return $this->_setOption('onlymorepopular', $onlyMorePopular);
+    }
+
+    /**
+     * Get onlyMorePopular option
+     *
+     * @return boolean|null
+     */
+    public function getOnlyMorePopular()
+    {
+        return $this->getOption('onlymorepopular');
+    }
+
+    /**
+     * Set extendedResults option
+     *
+     * @param boolean $extendedResults
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setExtendedResults($extendedResults)
+    {
+        return $this->_setOption('extendedresults', $extendedResults);
+    }
+
+    /**
+     * Get extendedResults option
+     *
+     * @return boolean|null
+     */
+    public function getExtendedResults()
+    {
+        return $this->getOption('extendedresults');
+    }
+
+    /**
+     * Set collate option
+     *
+     * @param boolean $collate
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setCollate($collate)
+    {
+        return $this->_setOption('collate', $collate);
+    }
+
+    /**
+     * Get collate option
+     *
+     * @return boolean|null
+     */
+    public function getCollate()
+    {
+        return $this->getOption('collate');
+    }
+
+    /**
+     * Set maxCollations option
+     *
+     * @param int $maxCollations
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setMaxCollations($maxCollations)
+    {
+        return $this->_setOption('maxcollations', $maxCollations);
+    }
+
+    /**
+     * Get maxCollations option
+     *
+     * @return int|null
+     */
+    public function getMaxCollations()
+    {
+        return $this->getOption('maxcollations');
+    }
+
+    /**
+     * Set maxCollationTries option
+     *
+     * @param string $maxCollationTries
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setMaxCollationTries($maxCollationTries)
+    {
+        return $this->_setOption('maxcollationtries', $maxCollationTries);
+    }
+
+    /**
+     * Get maxCollationTries option
+     *
+     * @return string|null
+     */
+    public function getMaxCollationTries()
+    {
+        return $this->getOption('maxcollationtries');
+    }
+
+    /**
+     * Set maxCollationEvaluations option
+     *
+     * @param int $maxCollationEvaluations
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setMaxCollationEvaluations($maxCollationEvaluations)
+    {
+        return $this->_setOption('maxcollationevaluations', $maxCollationEvaluations);
+    }
+
+    /**
+     * Get maxCollationEvaluations option
+     *
+     * @return int|null
+     */
+    public function getMaxCollationEvaluations()
+    {
+        return $this->getOption('maxcollationevaluations');
+    }
+
+    /**
+     * Set collateExtendedResults option
+     *
+     * @param string $collateExtendedResults
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setCollateExtendedResults($collateExtendedResults)
+    {
+        return $this->_setOption('collateextendedresults', $collateExtendedResults);
+    }
+
+    /**
+     * Get collateExtendedResults option
+     *
+     * @return string|null
+     */
+    public function getCollateExtendedResults()
+    {
+        return $this->getOption('collateextendedresults');
+    }
+
+    /**
+     * Set accuracy option
+     *
+     * @param float $accuracy
+     * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
+     */
+    public function setAccuracy($accuracy)
+    {
+        return $this->_setOption('accuracy', $accuracy);
+    }
+
+    /**
+     * Get accuracy option
+     *
+     * @return float|null
+     */
+    public function getAccuracy()
+    {
+        return $this->getOption('accuracy');
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/FacetSet.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/FacetSet.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/FacetSet.php	(revision 7576)
@@ -0,0 +1,454 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * MoreLikeThis component
+ *
+ * @link http://wiki.apache.org/solr/MoreLikeThis
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_FacetSet extends Solarium_Query_Select_Component
+{
+
+    /**
+     * Facet type field
+     */
+    const FACET_FIELD = 'field';
+
+    /**
+     * Facet type query
+     */
+    const FACET_QUERY = 'query';
+
+    /**
+     * Facet type multiquery
+     */
+    const FACET_MULTIQUERY = 'multiquery';
+
+    /**
+     * Facet type range
+     */
+    const FACET_RANGE = 'range';
+
+    /**
+     * Facet type mapping
+     *
+     * @var array
+     */
+    protected $_facetTypes = array(
+        self::FACET_FIELD => 'Solarium_Query_Select_Component_Facet_Field',
+        self::FACET_QUERY => 'Solarium_Query_Select_Component_Facet_Query',
+        self::FACET_MULTIQUERY => 'Solarium_Query_Select_Component_Facet_MultiQuery',
+        self::FACET_RANGE => 'Solarium_Query_Select_Component_Facet_Range',
+    );
+
+    /**
+     * Component type
+     *
+     * @var string
+     */
+    protected $_type = Solarium_Query_Select::COMPONENT_FACETSET;
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array();
+
+    /**
+     * Facets
+     *
+     * @var array
+     */
+    protected $_facets = array();
+
+    /**
+     * Initialize options
+     *
+     * Several options need some extra checks or setup work, for these options
+     * the setters are called.
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        if (isset($this->_options['facet'])) {
+            foreach ($this->_options['facet'] AS $key => $config) {
+                if (!isset($config['key'])) {
+                    $config['key'] = $key;
+                }
+
+                $this->addFacet($config);
+            }
+        }
+    }
+
+    /**
+     * Limit the terms for faceting by a prefix
+     *
+     * This is a global value for all facets in this facetset
+     *
+     * @param string $prefix
+     * @return Solarium_Query_Select_Component_FacetSet Provides fluent interface
+     */
+    public function setPrefix($prefix)
+    {
+        return $this->_setOption('prefix', $prefix);
+    }
+
+    /**
+     * Get the facet prefix
+     *
+     * This is a global value for all facets in this facetset
+     *
+     * @return string
+     */
+    public function getPrefix()
+    {
+        return $this->getOption('prefix');
+    }
+
+    /**
+     * Set the facet sort order
+     *
+     * Use one of the SORT_* constants as the value
+     *
+     * This is a global value for all facets in this facetset
+     *
+     * @param string $sort
+     * @return Solarium_Query_Select_Component_FacetSet Provides fluent interface
+     */
+    public function setSort($sort)
+    {
+        return $this->_setOption('sort', $sort);
+    }
+
+    /**
+     * Get the facet sort order
+     *
+     * This is a global value for all facets in this facetset
+     *
+     * @return string
+     */
+    public function getSort()
+    {
+        return $this->getOption('sort');
+    }
+
+    /**
+     * Set the facet limit
+     *
+     *  This is a global value for all facets in this facetset
+     *
+     * @param int $limit
+     * @return Solarium_Query_Select_Component_FacetSet Provides fluent interface
+     */
+    public function setLimit($limit)
+    {
+        return $this->_setOption('limit', $limit);
+    }
+
+    /**
+     * Get the facet limit
+     *
+     * This is a global value for all facets in this facetset
+     *
+     * @return string
+     */
+    public function getLimit()
+    {
+        return $this->getOption('limit');
+    }
+
+    /**
+     * Set the facet mincount
+     *
+     * This is a global value for all facets in this facetset
+     *
+     * @param int $minCount
+     * @return Solarium_Query_Select_Component_FacetSet Provides fluent interface
+     */
+    public function setMinCount($minCount)
+    {
+        return $this->_setOption('mincount', $minCount);
+    }
+
+    /**
+     * Get the facet mincount
+     *
+     * This is a global value for all facets in this facetset
+     *
+     * @return int
+     */
+    public function getMinCount()
+    {
+        return $this->getOption('mincount');
+    }
+
+    /**
+     * Set the missing count option
+     *
+     * This is a global value for all facets in this facetset
+     *
+     * @param boolean $missing
+     * @return Solarium_Query_Select_Component_FacetSet Provides fluent interface
+     */
+    public function setMissing($missing)
+    {
+        return $this->_setOption('missing', $missing);
+    }
+
+    /**
+     * Get the facet missing option
+     *
+     * This is a global value for all facets in this facetset
+     *
+     * @return boolean
+     */
+    public function getMissing()
+    {
+        return $this->getOption('missing');
+    }
+
+    /**
+     * Add a facet
+     *
+     * @param Solarium_Query_Select_Component_Facet|array $facet
+     * @return Solarium_Query Provides fluent interface
+     */
+    public function addFacet($facet)
+    {
+        if (is_array($facet)) {
+            $facet = $this->createFacet($facet['type'], $facet, false);
+        }
+
+        $key = $facet->getKey();
+
+        if (0 === strlen($key)) {
+            throw new Solarium_Exception('A facet must have a key value');
+        }
+
+        //double add calls for the same facet are ignored, but non-unique keys cause an exception
+        //@todo add trigger_error with a notice for double add calls?
+        if (array_key_exists($key, $this->_facets) && $this->_facets[$key] !== $facet) {
+            throw new Solarium_Exception('A facet must have a unique key value within a query');
+        } else {
+             $this->_facets[$key] = $facet;
+        }
+
+        return $this;
+    }
+
+    /**
+     * Add multiple facets
+     *
+     * @param array $facets
+     * @return Solarium_Query Provides fluent interface
+     */
+    public function addFacets(array $facets)
+    {
+        foreach ($facets AS $key => $facet) {
+
+            // in case of a config array: add key to config
+            if (is_array($facet) && !isset($facet['key'])) {
+                $facet['key'] = $key;
+            }
+
+            $this->addFacet($facet);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Get a facet
+     *
+     * @param string $key
+     * @return string
+     */
+    public function getFacet($key)
+    {
+        if (isset($this->_facets[$key])) {
+            return $this->_facets[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all facets
+     *
+     * @return array
+     */
+    public function getFacets()
+    {
+        return $this->_facets;
+    }
+
+    /**
+     * Remove a single facet
+     *
+     * You can remove a facet by passing it's key or the facet instance
+     *
+     * @param string|Solarium_Query_Select_Component_Facet $facet
+     * @return Solarium_Query Provides fluent interface
+     */
+    public function removeFacet($facet)
+    {
+        if (is_object($facet)) {
+            $facet = $facet->getKey();
+        }
+
+        if (isset($this->_facets[$facet])) {
+            unset($this->_facets[$facet]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all facets
+     *
+     * @return Solarium_Query Provides fluent interface
+     */
+    public function clearFacets()
+    {
+        $this->_facets = array();
+        return $this;
+    }
+
+    /**
+     * Set multiple facets
+     *
+     * This overwrites any existing facets
+     *
+     * @param array $facets
+     */
+    public function setFacets($facets)
+    {
+        $this->clearFacets();
+        $this->addFacets($facets);
+    }
+
+    /**
+     * Create a facet instance
+     *
+     * If you supply a string as the first arguments ($options) it will be used as the key for the facet
+     * and it will be added to this query.
+     * If you supply an options array/object that contains a key the facet will also be added to the query.
+     *
+     * When no key is supplied the facet cannot be added, in that case you will need to add it manually
+     * after setting the key, by using the addFacet method.
+     *
+     * @param string $type
+     * @param array|object|null $options
+     * @param boolean $add
+     * @return Solarium_Query_Select_Component_Facet
+     */
+    public function createFacet($type, $options = null, $add = true)
+    {
+        $type = strtolower($type);
+
+        if (!isset($this->_facetTypes[$type])) {
+            throw new Solarium_Exception("Facettype unknown: " . $type);
+        }
+
+        $class = $this->_facetTypes[$type];
+
+        if (is_string($options)) {
+            $facet = new $class;
+            $facet->setKey($options);
+        } else {
+            $facet = new $class($options);
+        }
+
+        if ($add && $facet->getKey() !== null) {
+            $this->addFacet($facet);
+        }
+
+        return $facet;
+    }
+
+    /**
+     * Get a facet field instance
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Select_Component_Facet_Field
+     */
+    public function createFacetField($options = null)
+    {
+        return $this->createFacet(self::FACET_FIELD, $options);
+    }
+
+    /**
+     * Get a facet query instance
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Select_Component_Facet_Query
+     */
+    public function createFacetQuery($options = null)
+    {
+        return $this->createFacet(self::FACET_QUERY, $options);
+    }
+
+    /**
+     * Get a facet multiquery instance
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Select_Component_Facet_MultiQuery
+     */
+    public function createFacetMultiQuery($options = null)
+    {
+        return $this->createFacet(self::FACET_MULTIQUERY, $options);
+    }
+
+    /**
+     * Get a facet range instance
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Select_Component_Facet_Range
+     */
+    public function createFacetRange($options = null)
+    {
+        return $this->createFacet(self::FACET_RANGE, $options);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Stats.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Stats.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Stats.php	(revision 7576)
@@ -0,0 +1,332 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Stats component
+ *
+ * @link http://wiki.apache.org/solr/StatsComponent
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_Stats extends Solarium_Query_Select_Component
+{
+
+    /**
+     * Component type
+     *
+     * @var string
+     */
+    protected $_type = Solarium_Query_Select::COMPONENT_STATS;
+
+    /**
+     * Stats facets for all fields
+     *
+     * @var array
+     */
+    protected $_facets = array();
+
+    /**
+     * Fields
+     *
+     * @var array
+     */
+    protected $_fields = array();
+
+    /**
+     * Initialize options
+     *
+     * Several options need some extra checks or setup work, for these options
+     * the setters are called.
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'field':
+                    $this->setFields($value);
+                    break;
+                case 'facet':
+                    $this->setFacets($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Create a field instance
+     *
+     * If you supply a string as the first arguments ($options) it will be used as the key for the field
+     * and it will be added to this query component.
+     * If you supply an options array/object that contains a key the field will also be added to the component.
+     *
+     * When no key is supplied the field cannot be added, in that case you will need to add it manually
+     * after setting the key, by using the addField method.
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Select_Component_Stats_Field
+     */
+    public function createField($options = null)
+    {
+        if (is_string($options)) {
+            $fq = new Solarium_Query_Select_Component_Stats_Field;
+            $fq->setKey($options);
+        } else {
+            $fq = new Solarium_Query_Select_Component_Stats_Field($options);
+        }
+
+        if ($fq->getKey() !== null) {
+            $this->addField($fq);
+        }
+
+        return $fq;
+    }
+
+    /**
+     * Add a field
+     *
+     * Supports a field instance or a config array, in that case a new
+     * field instance wil be created based on the options.
+     *
+     * @param Solarium_Query_Select_Component_Stats_Field|array $field
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function addField($field)
+    {
+        if (is_array($field)) {
+            $field = new Solarium_Query_Select_Component_Stats_Field($field);
+        }
+
+        $key = $field->getKey();
+
+        if (0 === strlen($key)) {
+            throw new Solarium_Exception('A field must have a key value');
+        }
+
+        //double add calls for the same field are ignored, but non-unique keys cause an exception
+        //@todo add trigger_error with a notice for double add calls?
+        if (array_key_exists($key, $this->_fields) && $this->_fields[$key] !== $field) {
+            throw new Solarium_Exception('A field must have a unique key value');
+        } else {
+            $this->_fields[$key] = $field;
+        }
+
+        return $this;
+    }
+
+    /**
+     * Add multiple fields
+     *
+     * @param array $fields
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function addFields(array $fields)
+    {
+        foreach ($fields AS $key => $field) {
+
+            // in case of a config array: add key to config
+            if (is_array($field) && !isset($field['key'])) {
+                $field['key'] = $key;
+            }
+
+            $this->addField($field);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Get a field
+     *
+     * @param string $key
+     * @return string
+     */
+    public function getField($key)
+    {
+        if (isset($this->_fields[$key])) {
+            return $this->_fields[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all fields
+     *
+     * @return array
+     */
+    public function getFields()
+    {
+        return $this->_fields;
+    }
+
+    /**
+     * Remove a single field
+     *
+     * You can remove a field by passing it's key, or by passing the field instance
+     *
+     * @param string|Solarium_Query_Select_Component_Stats_Field $field
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function removeField($field)
+    {
+        if (is_object($field)) {
+            $field = $field->getKey();
+        }
+
+        if (isset($this->_fields[$field])) {
+            unset($this->_fields[$field]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all fields
+     *
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function clearFields()
+    {
+        $this->_fields = array();
+        return $this;
+    }
+
+    /**
+     * Set multiple fields
+     *
+     * This overwrites any existing fields
+     *
+     * @param array $fields
+     */
+    public function setFields($fields)
+    {
+        $this->clearFields();
+        $this->addFields($fields);
+    }
+
+    /**
+     * Specify a facet to return in the resultset
+     *
+     * @param string $facet
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function addFacet($facet)
+    {
+       $this->_facets[$facet] = true;
+       return $this;
+    }
+
+    /**
+     * Specify multiple facets to return in the resultset
+     *
+     * @param string|array $facets can be an array or string with comma
+     * separated facetnames
+     *
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function addFacets($facets)
+    {
+        if (is_string($facets)) {
+            $facets = explode(',', $facets);
+            $facets = array_map('trim', $facets);
+        }
+
+        foreach ($facets AS $facet) {
+            $this->addFacet($facet);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove a facet from the facet list
+     *
+     * @param string $facet
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function removeFacet($facet)
+    {
+        if (isset($this->_facets[$facet])) {
+           unset($this->_facets[$facet]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all facets from the facet list.
+     *
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function clearFacets()
+    {
+        $this->_facets = array();
+        return $this;
+    }
+
+    /**
+     * Get the list of facets
+     *
+     * @return array
+     */
+    public function getFacets()
+    {
+        return array_keys($this->_facets);
+    }
+
+    /**
+     * Set multiple facets
+     *
+     * This overwrites any existing facets
+     *
+     * @param array $facets
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function setFacets($facets)
+    {
+        $this->clearFacets();
+        $this->addFacets($facets);
+
+        return $this;
+    }
+
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Highlighting/Field.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Highlighting/Field.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Highlighting/Field.php	(revision 7576)
@@ -0,0 +1,285 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Highlighting per-field settings
+ *
+ * @link http://wiki.apache.org/solr/HighlightingParameters
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_Highlighting_Field extends Solarium_Query_Select_Component
+{
+    /**
+     * Value for fragmenter option gap
+     */
+    const FRAGMENTER_GAP = 'gap';
+
+    /**
+     * Value for fragmenter option regex
+     */
+    const FRAGMENTER_REGEX = 'regex';
+
+    /**
+     * Get name option
+     *
+     * @return string|null
+     */
+    public function getName()
+    {
+        return $this->getOption('name');
+    }
+
+    /**
+     * Set name option
+     *
+     * @param string $name
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setName($name)
+    {
+        return $this->_setOption('name', $name);
+    }
+
+    /**
+     * Set snippets option
+     *
+     * Maximum number of snippets per field
+     *
+     * @param int $maximum
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setSnippets($maximum)
+    {
+        return $this->_setOption('snippets', $maximum);
+    }
+
+    /**
+     * Get snippets option
+     *
+     * @return int|null
+     */
+    public function getSnippets()
+    {
+        return $this->getOption('snippets');
+    }
+
+    /**
+     * Set fragsize option
+     *
+     * The size, in characters, of fragments to consider for highlighting
+     *
+     * @param int $size
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setFragSize($size)
+    {
+        return $this->_setOption('fragsize', $size);
+    }
+
+    /**
+     * Get fragsize option
+     *
+     * @return int|null
+     */
+    public function getFragSize()
+    {
+        return $this->getOption('fragsize');
+    }
+
+    /**
+     * Set mergeContiguous option
+     *
+     * Collapse contiguous fragments into a single fragment
+     *
+     * @param boolean $merge
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setMergeContiguous($merge)
+    {
+        return $this->_setOption('mergecontiguous', $merge);
+    }
+
+    /**
+     * Get mergeContiguous option
+     *
+     * @return boolean|null
+     */
+    public function getMergeContiguous()
+    {
+        return $this->getOption('mergecontiguous');
+    }
+
+    /**
+     * Set alternatefield option
+     *
+     * @param string $field
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setAlternateField($field)
+    {
+        return $this->_setOption('alternatefield', $field);
+    }
+
+    /**
+     * Get alternatefield option
+     *
+     * @return string|null
+     */
+    public function getAlternateField()
+    {
+        return $this->getOption('alternatefield');
+    }
+
+    /**
+     * Set formatter option
+     *
+     * @param string $formatter
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setFormatter($formatter = 'simple')
+    {
+        return $this->_setOption('formatter', $formatter);
+    }
+
+    /**
+     * Get formatter option
+     *
+     * @return string|null
+     */
+    public function getFormatter()
+    {
+        return $this->getOption('formatter');
+    }
+
+    /**
+     * Set simple prefix option
+     *
+     * Solr option h1.simple.pre
+     *
+     * @param string $prefix
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setSimplePrefix($prefix)
+    {
+        return $this->_setOption('simpleprefix', $prefix);
+    }
+
+    /**
+     * Get simple prefix option
+     *
+     * Solr option hl.simple.pre
+     *
+     * @return string|null
+     */
+    public function getSimplePrefix()
+    {
+        return $this->getOption('simpleprefix');
+    }
+
+    /**
+     * Set simple postfix option
+     *
+     * Solr option h1.simple.post
+     *
+     * @param string $postfix
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setSimplePostfix($postfix)
+    {
+        return $this->_setOption('simplepostfix', $postfix);
+    }
+
+    /**
+     * Get simple postfix option
+     *
+     * Solr option hl.simple.post
+     *
+     * @return string|null
+     */
+    public function getSimplePostfix()
+    {
+        return $this->getOption('simplepostfix');
+    }
+
+    /**
+     * Set fragmenter option
+     *
+     * Use one of the constants as value.
+     *
+     * @param string $fragmenter
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setFragmenter($fragmenter)
+    {
+        return $this->_setOption('fragmenter', $fragmenter);
+    }
+
+    /**
+     * Get fragmenter option
+     *
+     * @return string|null
+     */
+    public function getFragmenter()
+    {
+        return $this->getOption('fragmenter');
+    }
+
+    /**
+     * Set useFastVectorHighlighter option
+     *
+     * @param boolean $use
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setUseFastVectorHighlighter($use)
+    {
+        return $this->_setOption('usefastvectorhighlighter', $use);
+    }
+
+    /**
+     * Get useFastVectorHighlighter option
+     *
+     * @return boolean|null
+     */
+    public function getUseFastVectorHighlighter()
+    {
+        return $this->getOption('usefastvectorhighlighter');
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/MoreLikeThis.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/MoreLikeThis.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/MoreLikeThis.php	(revision 7576)
@@ -0,0 +1,297 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * MoreLikeThis component
+ *
+ * @link http://wiki.apache.org/solr/MoreLikeThis
+ * 
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_MoreLikeThis extends Solarium_Query_Select_Component
+{
+
+    /**
+     * Component type
+     * 
+     * @var string
+     */
+    protected $_type = Solarium_Query_Select::COMPONENT_MORELIKETHIS;
+
+    /**
+     * Set fields option
+     *
+     * The fields to use for similarity. NOTE: if possible, these should have a
+     * stored TermVector
+     *
+     * Separate multiple fields with commas.
+     *
+     * @param string $fields
+     * @return Solarium_Query_Select_Component_MoreLikeThis Provides fluent interface
+     */
+    public function setFields($fields)
+    {
+        return $this->_setOption('fields', $fields);
+    }
+
+    /**
+     * Get fields option
+     *
+     * @return string|null
+     */
+    public function getFields()
+    {
+        return $this->getOption('fields');
+    }
+
+    /**
+     * Set minimumtermfrequency option
+     *
+     * Minimum Term Frequency - the frequency below which terms will be ignored
+     * in the source doc.
+     *
+     * @param int $minimum
+     * @return Solarium_Query_Select_Component_MoreLikeThis Provides fluent interface
+     */
+    public function setMinimumTermFrequency($minimum)
+    {
+        return $this->_setOption('minimumtermfrequency', $minimum);
+    }
+
+    /**
+     * Get minimumtermfrequency option
+     *
+     * @return integer|null
+     */
+    public function getMinimumTermFrequency()
+    {
+        return $this->getOption('minimumtermfrequency');
+    }
+
+    /**
+     * Set minimumdocumentfrequency option
+     *
+     * Minimum Document Frequency - the frequency at which words will be
+     * ignored which do not occur in at least this many docs.
+     *
+     * @param int $minimum
+     * @return Solarium_Query_Select_Component_MoreLikeThis Provides fluent interface
+     */
+    public function setMinimumDocumentFrequency($minimum)
+    {
+        return $this->_setOption('minimumdocumentfrequency', $minimum);
+    }
+
+    /**
+     * Get minimumdocumentfrequency option
+     *
+     * @return integer|null
+     */
+    public function getMinimumDocumentFrequency()
+    {
+        return $this->getOption('minimumdocumentfrequency');
+    }
+
+    /**
+     * Set minimumwordlength option
+     *
+     * Minimum word length below which words will be ignored.
+     *
+     * @param int $minimum
+     * @return Solarium_Query_Select_Component_MoreLikeThis Provides fluent interface
+     */
+    public function setMinimumWordLength($minimum)
+    {
+        return $this->_setOption('minimumwordlength', $minimum);
+    }
+
+    /**
+     * Get minimumwordlength option
+     *
+     * @return integer|null
+     */
+    public function getMinimumWordLength()
+    {
+        return $this->getOption('minimumwordlength');
+    }
+
+    /**
+     * Set maximumwordlength option
+     *
+     * Maximum word length above which words will be ignored.
+     *
+     * @param int $maximum
+     * @return Solarium_Query_Select_Component_MoreLikeThis Provides fluent interface
+     */
+    public function setMaximumWordLength($maximum)
+    {
+        return $this->_setOption('maximumwordlength', $maximum);
+    }
+
+    /**
+     * Get maximumwordlength option
+     *
+     * @return integer|null
+     */
+    public function getMaximumWordLength()
+    {
+        return $this->getOption('maximumwordlength');
+    }
+
+    /**
+     * Set maximumqueryterms option
+     *
+     * Maximum number of query terms that will be included in any generated
+     * query.
+     *
+     * @param int $maximum
+     * @return Solarium_Query_Select_Component_MoreLikeThis Provides fluent interface
+     */
+    public function setMaximumQueryTerms($maximum)
+    {
+        return $this->_setOption('maximumqueryterms', $maximum);
+    }
+
+    /**
+     * Get maximumqueryterms option
+     *
+     * @return integer|null
+     */
+    public function getMaximumQueryTerms()
+    {
+        return $this->getOption('maximumqueryterms');
+    }
+
+    /**
+     * Set maximumnumberoftokens option
+     *
+     * Maximum number of tokens to parse in each example doc field that is not
+     * stored with TermVector support.
+     *
+     * @param int $maximum
+     * @return Solarium_Query_Select_Component_MoreLikeThis Provides fluent interface
+     */
+    public function setMaximumNumberOfTokens($maximum)
+    {
+        return $this->_setOption('maximumnumberoftokens', $maximum);
+    }
+
+    /**
+     * Get maximumnumberoftokens option
+     *
+     * @return integer|null
+     */
+    public function getMaximumNumberOfTokens()
+    {
+        return $this->getOption('maximumnumberoftokens');
+    }
+
+    /**
+     * Set boost option
+     *
+     * If true the query will be boosted by the interesting term relevance.
+     *
+     * @param boolean $boost
+     * @return Solarium_Query_Select_Component_MoreLikeThis Provides fluent interface
+     */
+    public function setBoost($boost)
+    {
+        return $this->_setOption('boost', $boost);
+    }
+
+    /**
+     * Get boost option
+     *
+     * @return boolean|null
+     */
+    public function getBoost()
+    {
+        return $this->getOption('boost');
+    }
+
+    /**
+     * Set queryfields option
+     *
+     * Query fields and their boosts using the same format as that used in
+     * DisMaxQParserPlugin. These fields must also be specified in fields.
+     *
+     * Separate multiple fields with commas.
+     *
+     * @param string $queryFields
+     * @return Solarium_Query_Select_Component_MoreLikeThis Provides fluent interface
+     */
+    public function setQueryFields($queryFields)
+    {
+        return $this->_setOption('queryfields', $queryFields);
+    }
+
+    /**
+     * Get queryfields option
+     *
+     * @return string|null
+     */
+    public function getQueryFields()
+    {
+        return $this->getOption('queryfields');
+    }
+
+    /**
+     * Set count option
+     *
+     * The number of similar documents to return for each result
+     *
+     * @param int $count
+     * @return Solarium_Query_Select_Component_MoreLikeThis Provides fluent interface
+     */
+    public function setCount($count)
+    {
+        return $this->_setOption('count', $count);
+    }
+
+    /**
+     * Get count option
+     *
+     * @return int|null
+     */
+    public function getCount()
+    {
+        return $this->getOption('count');
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Facet.php	(revision 7576)
@@ -0,0 +1,182 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Facet base class
+ *
+ * @link http://wiki.apache.org/solr/SimpleFacetParameters
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+abstract class Solarium_Query_Select_Component_Facet extends Solarium_Configurable
+{
+
+    /**
+     * Exclude tags for this facet
+     *
+     * @var array
+     */
+    protected $_excludes = array();
+
+    /**
+     * Must be implemented by the facet types and return one of the constants
+     * 
+     * @abstract
+     * @return string
+     */
+    abstract public function getType();
+
+    /**
+     * Initialize options
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'key':
+                    $this->setKey($value);
+                    break;
+                case 'exclude':
+                    if(!is_array($value)) $value = array($value);
+                    $this->setExcludes($value);
+                    unset($this->_options['exclude']);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Get key value
+     *
+     * @return string
+     */
+    public function getKey()
+    {
+        return $this->getOption('key');
+    }
+
+    /**
+     * Set key value
+     *
+     * @param string $value
+     * @return Solarium_Query_Select_Component_Facet Provides fluent interface
+     */
+    public function setKey($value)
+    {
+        return $this->_setOption('key', $value);
+    }
+
+    /**
+     * Add an exclude tag
+     *
+     * @param string $tag
+     * @return Solarium_Query_Select_Component_Facet Provides fluent interface
+     */
+    public function addExclude($tag)
+    {
+        $this->_excludes[$tag] = true;
+        return $this;
+    }
+
+    /**
+     * Add multiple exclude tags
+     *
+     * @param array $excludes
+     * @return Solarium_Query_Select_Component_Facet Provides fluent interface
+     */
+    public function addExcludes(array $excludes)
+    {
+        foreach ($excludes AS $exclude) {
+            $this->addExclude($exclude);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Get all excludes
+     *
+     * @return array
+     */
+    public function getExcludes()
+    {
+        return array_keys($this->_excludes);
+    }
+
+    /**
+     * Remove a single exclude tag
+     *
+     * @param string $exclude
+     * @return Solarium_Query_Select_Component_Facet Provides fluent interface
+     */
+    public function removeExclude($exclude)
+    {
+        if (isset($this->_excludes[$exclude])) {
+            unset($this->_excludes[$exclude]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all excludes
+     *
+     * @return Solarium_Query_Select_Facet Provides fluent interface
+     */
+    public function clearExcludes()
+    {
+        $this->_excludes = array();
+        return $this;
+    }
+
+    /**
+     * Set multiple excludes
+     *
+     * This overwrites any existing excludes
+     *
+     * @param array $excludes
+     */
+    public function setExcludes($excludes)
+    {
+        $this->clearExcludes();
+        $this->addExcludes($excludes);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/DisMax.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/DisMax.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/DisMax.php	(revision 7576)
@@ -0,0 +1,315 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * DisMax component
+ *
+ * @link http://wiki.apache.org/solr/DisMaxQParserPlugin
+ * 
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_DisMax extends Solarium_Query_Select_Component
+{
+
+    /**
+     * Component type
+     * 
+     * @var string
+     */
+    protected $_type = Solarium_Query_Select::COMPONENT_DISMAX;
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'queryparser' => 'dismax',
+    );
+
+    /**
+     * Set QueryAlternative option
+     *
+     * If specified, this query will be used (and parsed by default using
+     * standard query parsing syntax) when the main query string is not
+     * specified or blank.
+     *
+     * @param string $queryAlternative
+     * @return Solarium_Query_Select_Component_DisMax Provides fluent interface
+     */
+    public function setQueryAlternative($queryAlternative)
+    {
+        return $this->_setOption('queryalternative', $queryAlternative);
+    }
+
+    /**
+     * Get QueryAlternative option
+     *
+     * @return string|null
+     */
+    public function getQueryAlternative()
+    {
+        return $this->getOption('queryalternative');
+    }
+
+    /**
+     * Set QueryFields option
+     *
+     * List of fields and the "boosts" to associate with each of them when
+     * building DisjunctionMaxQueries from the user's query.
+     *
+     * The format supported is "fieldOne^2.3 fieldTwo fieldThree^0.4"
+     *
+     * @param string $queryFields
+     * @return Solarium_Query_Select_Component_DisMax Provides fluent interface
+     */
+    public function setQueryFields($queryFields)
+    {
+        return $this->_setOption('queryfields', $queryFields);
+    }
+
+    /**
+     * Get QueryFields option
+     *
+     * @return string|null
+     */
+    public function getQueryFields()
+    {
+        return $this->getOption('queryfields');
+    }
+
+    /**
+     * Set MinimumMatch option
+     *
+     * This option makes it possible to say that a certain minimum number of
+     * clauses must match. See Solr manual for details.
+     *
+     * @param string $minimumMatch
+     * @return Solarium_Query_Select_Component_DisMax Provides fluent interface
+     */
+    public function setMinimumMatch($minimumMatch)
+    {
+        return $this->_setOption('minimummatch', $minimumMatch);
+    }
+
+    /**
+     * Get MinimumMatch option
+     *
+     * @return string|null
+     */
+    public function getMinimumMatch()
+    {
+        return $this->getOption('minimummatch');
+    }
+
+    /**
+     * Set PhraseFields option
+     *
+     * This param can be used to "boost" the score of documents in cases
+     * where all of the terms in the "q" param appear in close proximity.
+     *
+     * Format is: "fieldA^1.0 fieldB^2.2"
+     *
+     * @param string $phraseFields
+     * @return Solarium_Query_Select_Component_DisMax Provides fluent interface
+     */
+    public function setPhraseFields($phraseFields)
+    {
+        return $this->_setOption('phrasefields', $phraseFields);
+    }
+
+    /**
+     * Get PhraseFields option
+     *
+     * @return string|null
+     */
+    public function getPhraseFields()
+    {
+        return $this->getOption('phrasefields');
+    }
+
+    /**
+     * Set PhraseSlop option
+     *
+     * Amount of slop on phrase queries built for "pf" fields
+     * (affects boosting)
+     *
+     * @param string $phraseSlop
+     * @return Solarium_Query_Select_Component_DisMax Provides fluent interface
+     */
+    public function setPhraseSlop($phraseSlop)
+    {
+        return $this->_setOption('phraseslop', $phraseSlop);
+    }
+
+    /**
+     * Get PhraseSlop option
+     *
+     * @return string|null
+     */
+    public function getPhraseSlop()
+    {
+        return $this->getOption('phraseslop');
+    }
+
+    /**
+     * Set QueryPhraseSlop option
+     *
+     * Amount of slop on phrase queries explicitly included in the user's
+     * query string (in qf fields; affects matching)
+     *
+     * @param string $queryPhraseSlop
+     * @return Solarium_Query_Select_Component_DisMax Provides fluent interface
+     */
+    public function setQueryPhraseSlop($queryPhraseSlop)
+    {
+        return $this->_setOption('queryphraseslop', $queryPhraseSlop);
+    }
+
+    /**
+     * Get QueryPhraseSlop option
+     *
+     * @return string|null
+     */
+    public function getQueryPhraseSlop()
+    {
+        return $this->getOption('queryphraseslop');
+    }
+
+    /**
+     * Set Tie option
+     *
+     * Float value to use as tiebreaker in DisjunctionMaxQueries
+     *
+     * @param float $tie
+     * @return Solarium_Query_Select_Component_DisMax Provides fluent interface
+     */
+    public function setTie($tie)
+    {
+        return $this->_setOption('tie', $tie);
+    }
+
+    /**
+     * Get Tie option
+     *
+     * @return float|null
+     */
+    public function getTie()
+    {
+        return $this->getOption('tie');
+    }
+
+    /**
+     * Set BoostQuery option
+     *
+     * A raw query string (in the SolrQuerySyntax) that will be included
+     * with the user's query to influence the score.
+     *
+     * @param string $boostQuery
+     * @return Solarium_Query_Select_Component_DisMax Provides fluent interface
+     */
+    public function setBoostQuery($boostQuery)
+    {
+        return $this->_setOption('boostquery', $boostQuery);
+    }
+
+    /**
+     * Get BoostQuery option
+     *
+     * @return string|null
+     */
+    public function getBoostQuery()
+    {
+        return $this->getOption('boostquery');
+    }
+
+    /**
+     * Set BoostFunctions option
+     *
+     * Functions (with optional boosts) that will be included in the
+     * user's query to influence the score.
+     *
+     * Format is: "funcA(arg1,arg2)^1.2 funcB(arg3,arg4)^2.2"
+     *
+     * @param string $boostFunctions
+     * @return Solarium_Query_Select_Component_DisMax Provides fluent interface
+     */
+    public function setBoostFunctions($boostFunctions)
+    {
+        return $this->_setOption('boostfunctions', $boostFunctions);
+    }
+
+    /**
+     * Get BoostFunctions option
+     *
+     * @return string|null
+     */
+    public function getBoostFunctions()
+    {
+        return $this->getOption('boostfunctions');
+    }
+
+    /**
+     * Set QueryParser option
+     *
+     * Can be used to enable edismax
+     *
+     * @since 2.1.0
+     *
+     * @param string $parser
+     * @return Solarium_Query_Select_Component_DisMax Provides fluent interface
+     */
+    public function setQueryParser($parser)
+    {
+        return $this->_setOption('queryparser', $parser);
+    }
+
+    /**
+     * Get QueryParser option
+     *
+     * @since 2.1.0
+     * 
+     * @return string
+     */
+    public function getQueryParser()
+    {
+        return $this->getOption('queryparser');
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Highlighting.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Highlighting.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Highlighting.php	(revision 7576)
@@ -0,0 +1,675 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Highlighting component
+ *
+ * @link http://wiki.apache.org/solr/HighlightingParameters
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_Highlighting extends Solarium_Query_Select_Component
+{
+    /**
+     * Value for fragmenter option gap
+     */
+    const FRAGMENTER_GAP = 'gap';
+
+    /**
+     * Value for fragmenter option regex
+     */
+    const FRAGMENTER_REGEX = 'regex';
+
+    /**
+     * Component type
+     *
+     * @var string
+     */
+    protected $_type = Solarium_Query_Select::COMPONENT_HIGHLIGHTING;
+
+    /**
+     * Array of fields for highlighting
+     *
+     * @var array
+     */
+    protected $_fields = array();
+
+    /**
+     * Initialize options
+     *
+     * The field option needs setup work
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'field':
+                    $this->addFields($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Get a field options object
+     *
+     * @param string $name
+     * @param boolean $autocreate
+     * @return Solarium_Query_Select_Component_Highlighting_Field
+     */
+    public function getField($name, $autocreate = true)
+    {
+        if (isset($this->_fields[$name])) {
+            return $this->_fields[$name];
+        } else if ($autocreate) {
+            $this->addField($name);
+            return $this->_fields[$name];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Add a field for highlighting
+     *
+     * @param string|array|Solarium_Query_Select_Component_Highlighting_Field $field
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function addField($field)
+    {
+        // autocreate object for string input
+        if (is_string($field)) {
+            $field = new Solarium_Query_Select_Component_Highlighting_Field(array('name' => $field));
+        } else if (is_array($field)) {
+            $field = new Solarium_Query_Select_Component_Highlighting_Field($field);
+        }
+
+        // validate field
+        if ($field->getName() === null) {
+            throw new Solarium_Exception('To add a highlighting field it needs to have at least a "name" setting');
+        }
+
+        $this->_fields[$field->getName()] = $field;
+        return $this;
+    }
+
+    /**
+     * Add multiple fields for highlighting
+     *
+     * @param string|array $fields can be an array of object instances or a string with comma
+     * separated fieldnames
+     *
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function addFields($fields)
+    {
+        if (is_string($fields)) {
+            $fields = explode(',', $fields);
+            $fields = array_map('trim', $fields);
+        }
+
+        foreach ($fields AS $key => $field) {
+
+            // in case of a config array without key: add key to config
+            if (is_array($field) && !isset($field['name'])) {
+                $field['name'] = $key;
+            }
+
+            $this->addField($field);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove a highlighting field
+     *
+     * @param string $field
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function removeField($field)
+    {
+        if (isset($this->_fields[$field])) {
+           unset($this->_fields[$field]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all fields
+     *
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function clearFields()
+    {
+        $this->_fields = array();
+        return $this;
+    }
+
+    /**
+     * Get the list of fields
+     *
+     * @return array
+     */
+    public function getFields()
+    {
+        return $this->_fields;
+    }
+
+    /**
+     * Set multiple fields
+     *
+     * This overwrites any existing fields
+     *
+     * @param array $fields
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setFields($fields)
+    {
+        $this->clearFields();
+        $this->addFields($fields);
+
+        return $this;
+    }
+
+    /**
+     * Set snippets option
+     *
+     * Maximum number of snippets per field
+     *
+     * @param int $maximum
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setSnippets($maximum)
+    {
+        return $this->_setOption('snippets', $maximum);
+    }
+
+    /**
+     * Get snippets option
+     *
+     * @return int|null
+     */
+    public function getSnippets()
+    {
+        return $this->getOption('snippets');
+    }
+
+    /**
+     * Set fragsize option
+     *
+     * The size, in characters, of fragments to consider for highlighting
+     *
+     * @param int $size
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setFragSize($size)
+    {
+        return $this->_setOption('fragsize', $size);
+    }
+
+    /**
+     * Get fragsize option
+     *
+     * @return int|null
+     */
+    public function getFragSize()
+    {
+        return $this->getOption('fragsize');
+    }
+
+    /**
+     * Set mergeContiguous option
+     *
+     * Collapse contiguous fragments into a single fragment
+     *
+     * @param boolean $merge
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setMergeContiguous($merge)
+    {
+        return $this->_setOption('mergecontiguous', $merge);
+    }
+
+    /**
+     * Get mergeContiguous option
+     *
+     * @return boolean|null
+     */
+    public function getMergeContiguous()
+    {
+        return $this->getOption('mergecontiguous');
+    }
+
+    /**
+     * Set requireFieldMatch option
+     *
+     * @param boolean $require
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setRequireFieldMatch($require)
+    {
+        return $this->_setOption('requirefieldmatch', $require);
+    }
+
+    /**
+     * Get requireFieldMatch option
+     *
+     * @return boolean|null
+     */
+    public function getRequireFieldMatch()
+    {
+        return $this->getOption('requirefieldmatch');
+    }
+
+    /**
+     * Set maxAnalyzedChars option
+     *
+     * How many characters into a document to look for suitable snippets
+     *
+     * @param int $chars
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setMaxAnalyzedChars($chars)
+    {
+        return $this->_setOption('maxanalyzedchars', $chars);
+    }
+
+    /**
+     * Get maxAnalyzedChars option
+     *
+     * @return int|null
+     */
+    public function getMaxAnalyzedChars()
+    {
+        return $this->getOption('maxanalyzedchars');
+    }
+
+    /**
+     * Set alternatefield option
+     *
+     * @param string $field
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setAlternateField($field)
+    {
+        return $this->_setOption('alternatefield', $field);
+    }
+
+    /**
+     * Get alternatefield option
+     *
+     * @return string|null
+     */
+    public function getAlternateField()
+    {
+        return $this->getOption('alternatefield');
+    }
+
+    /**
+     * Set maxAlternateFieldLength option
+     *
+     * @param int $length
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setMaxAlternateFieldLength($length)
+    {
+        return $this->_setOption('maxalternatefieldlength', $length);
+    }
+
+    /**
+     * Get maxAlternateFieldLength option
+     *
+     * @return int|null
+     */
+    public function getMaxAlternateFieldLength()
+    {
+        return $this->getOption('maxalternatefieldlength');
+    }
+
+    /**
+     * Set formatter option
+     *
+     * @param string $formatter
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setFormatter($formatter = 'simple')
+    {
+        return $this->_setOption('formatter', $formatter);
+    }
+
+    /**
+     * Get formatter option
+     *
+     * @return string|null
+     */
+    public function getFormatter()
+    {
+        return $this->getOption('formatter');
+    }
+
+    /**
+     * Set simple prefix option
+     *
+     * Solr option h1.simple.pre
+     *
+     * @param string $prefix
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setSimplePrefix($prefix)
+    {
+        return $this->_setOption('simpleprefix', $prefix);
+    }
+
+    /**
+     * Get simple prefix option
+     *
+     * Solr option hl.simple.pre
+     *
+     * @return string|null
+     */
+    public function getSimplePrefix()
+    {
+        return $this->getOption('simpleprefix');
+    }
+
+    /**
+     * Set simple postfix option
+     *
+     * Solr option h1.simple.post
+     *
+     * @param string $postfix
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setSimplePostfix($postfix)
+    {
+        return $this->_setOption('simplepostfix', $postfix);
+    }
+
+    /**
+     * Get simple postfix option
+     *
+     * Solr option hl.simple.post
+     *
+     * @return string|null
+     */
+    public function getSimplePostfix()
+    {
+        return $this->getOption('simplepostfix');
+    }
+
+    /**
+     * Set fragmenter option
+     *
+     * Use one of the constants as value.
+     *
+     * @param string $fragmenter
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setFragmenter($fragmenter)
+    {
+        return $this->_setOption('fragmenter', $fragmenter);
+    }
+
+    /**
+     * Get fragmenter option
+     *
+     * @return string|null
+     */
+    public function getFragmenter()
+    {
+        return $this->getOption('fragmenter');
+    }
+
+    /**
+     * Set fraglistbuilder option
+     *
+     * @param string $builder
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setFragListBuilder($builder)
+    {
+        return $this->_setOption('fraglistbuilder', $builder);
+    }
+
+    /**
+     * Get fraglistbuilder option
+     *
+     * @return string|null
+     */
+    public function getFragListBuilder()
+    {
+        return $this->getOption('fraglistbuilder');
+    }
+
+    /**
+     * Set fragmentsbuilder option
+     *
+     * @param string $builder
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setFragmentsBuilder($builder)
+    {
+        return $this->_setOption('fragmentsbuilder', $builder);
+    }
+
+    /**
+     * Get fragmentsbuilder option
+     *
+     * @return string|null
+     */
+    public function getFragmentsBuilder()
+    {
+        return $this->getOption('fragmentsbuilder');
+    }
+
+    /**
+     * Set useFastVectorHighlighter option
+     *
+     * @param boolean $use
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setUseFastVectorHighlighter($use)
+    {
+        return $this->_setOption('usefastvectorhighlighter', $use);
+    }
+
+    /**
+     * Get useFastVectorHighlighter option
+     *
+     * @return boolean|null
+     */
+    public function getUseFastVectorHighlighter()
+    {
+        return $this->getOption('usefastvectorhighlighter');
+    }
+
+    /**
+     * Set usePhraseHighlighter option
+     *
+     * @param boolean $use
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setUsePhraseHighlighter($use)
+    {
+        return $this->_setOption('usephrasehighlighter', $use);
+    }
+
+    /**
+     * Get usePhraseHighlighter option
+     *
+     * @return boolean|null
+     */
+    public function getUsePhraseHighlighter()
+    {
+        return $this->getOption('usephrasehighlighter');
+    }
+
+    /**
+     * Set HighlightMultiTerm option
+     *
+     * @param boolean $highlight
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setHighlightMultiTerm($highlight)
+    {
+        return $this->_setOption('highlightmultiterm', $highlight);
+    }
+
+    /**
+     * Get HighlightMultiTerm option
+     *
+     * @return boolean|null
+     */
+    public function getHighlightMultiTerm()
+    {
+        return $this->getOption('highlightmultiterm');
+    }
+
+    /**
+     * Set RegexSlop option
+     *
+     * @param float $slop
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setRegexSlop($slop)
+    {
+        return $this->_setOption('regexslop', $slop);
+    }
+
+    /**
+     * Get RegexSlop option
+     *
+     * @return float|null
+     */
+    public function getRegexSlop()
+    {
+        return $this->getOption('regexslop');
+    }
+
+    /**
+     * Set RegexPattern option
+     *
+     * @param string $pattern
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setRegexPattern($pattern)
+    {
+        return $this->_setOption('regexpattern', $pattern);
+    }
+
+    /**
+     * Get RegexPattern option
+     *
+     * @return string|null
+     */
+    public function getRegexPattern()
+    {
+        return $this->getOption('regexpattern');
+    }
+
+    /**
+     * Set RegexMaxAnalyzedChars option
+     *
+     * @param int $chars
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setRegexMaxAnalyzedChars($chars)
+    {
+        return $this->_setOption('regexmaxanalyzedchars', $chars);
+    }
+
+    /**
+     * Get RegexMaxAnalyzedChars option
+     *
+     * @return int|null
+     */
+    public function getRegexMaxAnalyzedChars()
+    {
+        return $this->getOption('regexmaxanalyzedchars');
+    }
+
+    /**
+     * Set highlight query option
+     *
+     * Overrides the q parameter for highlighting
+     *
+     * @param string $query
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setQuery($query)
+    {
+        return $this->_setOption('query', $query);
+    }
+
+    /**
+     * Get query option
+     *
+     * @return string|null
+     */
+    public function getQuery()
+    {
+        return $this->getOption('query');
+    }
+
+    /**
+     * Set phraselimit option
+     *
+     * @param int $maximum
+     * @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
+     */
+    public function setPhraseLimit($maximum)
+    {
+        return $this->_setOption('phraselimit', $maximum);
+    }
+
+    /**
+     * Get phraselimit option
+     *
+     * @return int|null
+     */
+    public function getPhraseLimit()
+    {
+        return $this->getOption('phraselimit');
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Debug.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Debug.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Debug.php	(revision 7576)
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Debug component
+ *
+ * @link http://wiki.apache.org/solr/CommonQueryParameters#Debugging
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_Debug extends Solarium_Query_Select_Component
+{
+
+    /**
+     * Component type
+     *
+     * @var string
+     */
+    protected $_type = Solarium_Query_Select::COMPONENT_DEBUG;
+
+    /**
+     * Get the explainOther option
+     *
+     * @return string|null
+     */
+    public function getExplainOther()
+    {
+        return $this->getOption('explainother');
+    }
+
+    /**
+     * Set the explainOther query
+     *
+     * @param string $query
+     * @return self Provides fluent interface
+     */
+    public function setExplainOther($query)
+    {
+        return $this->_setOption('explainother', $query);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/DistributedSearch.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/DistributedSearch.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/DistributedSearch.php	(revision 7576)
@@ -0,0 +1,210 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Distributed Search (sharding) component
+ *
+ * @link http://wiki.apache.org/solr/DistributedSearch
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_DistributedSearch extends Solarium_Query_Select_Component
+{
+
+    /**
+     * Component type
+     *
+     * @var string
+     */
+    protected $_type = Solarium_Query_Select::COMPONENT_DISTRIBUTEDSEARCH;
+
+    /**
+     * Request to be distributed across all shards in the list
+     *
+     * @var array
+     */
+    protected $_shards = array();
+
+    /**
+     * Initialize options
+     *
+     * Several options need some extra checks or setup work, for these options
+     * the setters are called.
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'shards':
+                    $this->setShards($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Add a shard
+     *
+     * @param string $key unique string
+     * @param string $shard  The syntax is host:port/base_url
+     * @return Solarium_Query_Select Provides fluent interface
+     * @link http://wiki.apache.org/solr/DistributedSearch
+     */
+    public function addShard($key, $shard)
+    {
+        $this->_shards[$key] = $shard;
+        return $this;
+    }
+
+    /**
+     * Add multiple shards
+     *
+     * Example usage:
+     * <code>
+     * $client = new Solarium_Client;
+     * $query = $client->createSelect();
+     * $distributedSearch = $query->getDistributedSearch();
+     * $distributedSearch->addShards(array(
+     *     'core0' => 'localhost:8983/solr/core0',
+     *     'core1' => 'localhost:8983/solr/core1'
+     * ));
+     * $result = $client->select($query);
+     * </code>
+     * @param array $shards
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function addShards(array $shards)
+    {
+        foreach ($shards as $key => $shard) {
+            $this->addShard($key, $shard);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove a shard
+     *
+     * @param string $key
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function removeShard($key)
+    {
+        if (isset($this->_shards[$key])) {
+            unset($this->_shards[$key]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all shards
+     *
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function clearShards()
+    {
+        $this->_shards = array();
+        return $this;
+    }
+
+    /**
+     * Set multiple shards
+     *
+     * This overwrites any existing shards
+     *
+     * Example usage:
+     * <code>
+     * $client = new Solarium_Client;
+     * $query = $client->createSelect();
+     * $distributedSearch = $query->getDistributedSearch();
+     * $distributedSearch->setShards(array(
+     *     'core0' => 'localhost:8983/solr/core0',
+     *     'core1' => 'localhost:8983/solr/core1'
+     * ));
+     * $result = $client->select($query);
+     * </code>
+     *
+     * @param array $shards Associative array of shards
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function setShards(array $shards)
+    {
+        $this->clearShards();
+        $this->addShards($shards);
+
+        return $this;
+    }
+
+    /**
+     * Get a list of the shards
+     *
+     * @return array
+     */
+    public function getShards()
+    {
+        return $this->_shards;
+    }
+
+    /**
+     *  A sharded request will go to the standard request handler
+     *  (not necessarily the original); this can be overridden via shards.qt
+     *
+     * @param string
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function setShardRequestHandler($handler)
+    {
+        $this->_setOption('shardhandler', $handler);
+        return $this;
+    }
+
+    /**
+     * Get a shard request handler (shards.qt)
+     *
+     * @param string
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function getShardRequestHandler()
+    {
+        return $this->getOption('shardhandler');
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Stats/Field.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Stats/Field.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component/Stats/Field.php	(revision 7576)
@@ -0,0 +1,187 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ *
+ * TODO
+ * Voorbeeld request:
+ * http://localhost:8983/solr/select?q=*:*&stats=true&stats.field=price&stats.field=popularity
+ *      &stats.twopass=true&rows=0&indent=true&stats.facet=inStock&f.price.stats.facet=price
+ *      &f.price.stats.facet=popularity
+ */
+
+/**
+ * Stats component field class
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component_Stats_Field extends Solarium_Configurable
+{
+
+    /**
+     * Field facets (for stats)
+     *
+     * @var array
+     */
+    protected $_facets = array();
+
+    /**
+     * Initialize options
+     *
+     * Several options need some extra checks or setup work, for these options
+     * the setters are called.
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'facet':
+                    $this->setFacets($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Get key value
+     *
+     * @return string
+     */
+    public function getKey()
+    {
+        return $this->getOption('key');
+    }
+
+    /**
+     * Set key value
+     *
+     * @param string $value
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function setKey($value)
+    {
+        return $this->_setOption('key', $value);
+    }
+
+    /**
+     * Specify a facet to return in the resultset
+     *
+     * @param string $facet
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function addFacet($facet)
+    {
+       $this->_facets[$facet] = true;
+       return $this;
+    }
+
+    /**
+     * Specify multiple facets to return in the resultset
+     *
+     * @param string|array $facets can be an array or string with comma
+     * separated facetnames
+     *
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function addFacets($facets)
+    {
+        if (is_string($facets)) {
+            $facets = explode(',', $facets);
+            $facets = array_map('trim', $facets);
+        }
+
+        foreach ($facets AS $facet) {
+            $this->addFacet($facet);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove a facet from the facet list
+     *
+     * @param string $facet
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function removeFacet($facet)
+    {
+        if (isset($this->_facets[$facet])) {
+           unset($this->_facets[$facet]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all facets from the facet list.
+     *
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function clearFacets()
+    {
+        $this->_facets = array();
+        return $this;
+    }
+
+    /**
+     * Get the list of facets
+     *
+     * @return array
+     */
+    public function getFacets()
+    {
+        return array_keys($this->_facets);
+    }
+
+    /**
+     * Set multiple facets
+     *
+     * This overwrites any existing facets
+     *
+     * @param array $facets
+     * @return Solarium_Query_Select_Component_Stats Provides fluent interface
+     */
+    public function setFacets($facets)
+    {
+        $this->clearFacets();
+        $this->addFacets($facets);
+
+        return $this;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select/Component.php	(revision 7576)
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Query component base class
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select_Component extends Solarium_Configurable
+{
+
+    /**
+     * Component type
+     *
+     * To be implemented in extending classes
+     *
+     * @var string
+     */
+    protected $_type = '';
+
+    /**
+     * Get component type
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return $this->_type;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Terms.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Terms.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Terms.php	(revision 7576)
@@ -0,0 +1,352 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Terms query
+ *
+ * A terms query provides access to the indexed terms in a field and the number of documents that match each term.
+ * This can be useful for doing auto-suggest or other things that operate at the term level instead of the search
+ * or document level. Retrieving terms in index order is very fast since the implementation directly uses Lucene's
+ * TermEnum to iterate over the term dictionary.
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Terms extends Solarium_Query
+{
+
+    /**
+     * Get type for this query
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Client::QUERYTYPE_TERMS;
+    }
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'resultclass' => 'Solarium_Result_Terms',
+        'handler' => 'terms',
+    );
+
+    /**
+     * Set the field name(s) to get the terms from
+     *
+     * For multiple fields use a comma-separated string
+     *
+     * @param string $value
+     * @return self Provides fluent interface
+     */
+    public function setFields($value)
+    {
+        return $this->_setOption('fields', $value);
+    }
+
+    /**
+     * Get the field name(s) to get the terms from
+     *
+     * @return string
+     */
+    public function getFields()
+    {
+        return $this->getOption('fields');
+    }
+
+    /**
+     * Set the lowerbound term to start at
+     *
+     * @param string $value
+     * @return self Provides fluent interface
+     */
+    public function setLowerbound($value)
+    {
+        return $this->_setOption('lowerbound', $value);
+    }
+
+    /**
+     * Get the lowerbound term to start at
+     *
+     * @return string
+     */
+    public function getLowerbound()
+    {
+        return $this->getOption('lowerbound');
+    }
+
+    /**
+     * Set lowerboundinclude
+     *
+     * @param boolean $value
+     * @return self Provides fluent interface
+     */
+    public function setLowerboundInclude($value)
+    {
+        return $this->_setOption('lowerboundinclude', $value);
+    }
+
+    /**
+     * Get lowerboundinclude
+     *
+     * @return boolean
+     */
+    public function getLowerboundInclude()
+    {
+        return $this->getOption('lowerboundinclude');
+    }
+
+    /**
+     * Set mincount (the minimum doc frequency for terms in order to be included)
+     *
+     * @param integer $value
+     * @return self Provides fluent interface
+     */
+    public function setMinCount($value)
+    {
+        return $this->_setOption('mincount', $value);
+    }
+
+    /**
+     * Get mincount
+     *
+     * @return integer
+     */
+    public function getMinCount()
+    {
+        return $this->getOption('mincount');
+    }
+
+    /**
+     * Set maxcount (the maximum doc frequency for terms in order to be included)
+     *
+     * @param integer $value
+     * @return self Provides fluent interface
+     */
+    public function setMaxCount($value)
+    {
+        return $this->_setOption('maxcount', $value);
+    }
+
+    /**
+     * Get maxcount
+     *
+     * @return integer
+     */
+    public function getMaxCount()
+    {
+        return $this->getOption('maxcount');
+    }
+
+    /**
+     * Set prefix for terms
+     *
+     * @param string $value
+     * @return self Provides fluent interface
+     */
+    public function setPrefix($value)
+    {
+        return $this->_setOption('prefix', $value);
+    }
+
+    /**
+     * Get maxcount
+     *
+     * @return string
+     */
+    public function getPrefix()
+    {
+        return $this->getOption('prefix');
+    }
+
+    /**
+     * Set regex to restrict terms
+     *
+     * @param string $value
+     * @return self Provides fluent interface
+     */
+    public function setRegex($value)
+    {
+        return $this->_setOption('regex', $value);
+    }
+
+    /**
+     * Get regex
+     *
+     * @return string
+     */
+    public function getRegex()
+    {
+        return $this->getOption('regex');
+    }
+
+    /**
+     * Set regex flags
+     *
+     * Use a comma-separated string for multiple entries
+     *
+     * @param string $value
+     * @return self Provides fluent interface
+     */
+    public function setRegexFlags($value)
+    {
+        return $this->_setOption('regexflags', $value);
+    }
+
+    /**
+     * Get regex flags
+     *
+     * @return string
+     */
+    public function getRegexFlags()
+    {
+        return $this->getOption('regexflags');
+    }
+
+    /**
+     * Set limit
+     *
+     * If < 0 all terms are included
+     *
+     * @param integer $value
+     * @return self Provides fluent interface
+     */
+    public function setLimit($value)
+    {
+        return $this->_setOption('limit', $value);
+    }
+
+    /**
+     * Get limit
+     *
+     * @return integer
+     */
+    public function getLimit()
+    {
+        return $this->getOption('limit');
+    }
+
+    /**
+     * Set the upperbound term to start at
+     *
+     * @param string $value
+     * @return self Provides fluent interface
+     */
+    public function setUpperbound($value)
+    {
+        return $this->_setOption('upperbound', $value);
+    }
+
+    /**
+     * Get the upperbound term to start at
+     *
+     * @return string
+     */
+    public function getUpperbound()
+    {
+        return $this->getOption('upperbound');
+    }
+
+    /**
+     * Set upperboundinclude
+     *
+     * @param boolean $value
+     * @return self Provides fluent interface
+     */
+    public function setUpperboundInclude($value)
+    {
+        return $this->_setOption('upperboundinclude', $value);
+    }
+
+    /**
+     * Get upperboundinclude
+     *
+     * @return boolean
+     */
+    public function getUpperboundInclude()
+    {
+        return $this->getOption('upperboundinclude');
+    }
+
+    /**
+     * Set raw option
+     *
+     * @param boolean $value
+     * @return self Provides fluent interface
+     */
+    public function setRaw($value)
+    {
+        return $this->_setOption('raw', $value);
+    }
+
+    /**
+     * Get raw option
+     *
+     * @return boolean
+     */
+    public function getRaw()
+    {
+        return $this->getOption('raw');
+    }
+
+    /**
+     * Set sort option
+     *
+     * @param string $value
+     * @return self Provides fluent interface
+     */
+    public function setSort($value)
+    {
+        return $this->_setOption('sort', $value);
+    }
+
+    /**
+     * Get sort option
+     *
+     * @return string
+     */
+    public function getSort()
+    {
+        return $this->getOption('sort');
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command.php	(revision 7576)
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Update query command base class
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+abstract class Solarium_Query_Update_Command extends Solarium_Configurable
+{
+
+    /**
+     * Returns command type, for use in adapters
+     *
+     * @return string
+     */
+    abstract public function getType();
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Rollback.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Rollback.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Rollback.php	(revision 7576)
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Update query rollback command
+ *
+ * For details see:
+ * @link http://wiki.apache.org/solr/UpdateXmlMessages#A.22rollback.22
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Update_Command_Rollback
+    extends Solarium_Query_Update_Command
+{
+    /**
+     * Get command type
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Query_Update::COMMAND_ROLLBACK;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Optimize.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Optimize.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Optimize.php	(revision 7576)
@@ -0,0 +1,124 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Update query optimize command
+ *
+ * For details about the Solr options see:
+ * @link http://wiki.apache.org/solr/UpdateXmlMessages#A.22commit.22_and_.22optimize.22
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Update_Command_Optimize
+    extends Solarium_Query_Update_Command
+{
+    /**
+     * Get command type
+     * 
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Query_Update::COMMAND_OPTIMIZE;
+    }
+
+    /**
+     * Get waitFlush option
+     *
+     * @return boolean
+     */
+    public function getWaitFlush()
+    {
+        return $this->getOption('waitflush');
+    }
+
+    /**
+     * Set waitFlush option
+     *
+     * @param boolean $waitFlush
+     * @return Solarium_Query_Update_Command_Optimize Provides fluent interface
+     */
+    public function setWaitFlush($waitFlush)
+    {
+        return $this->_setOption('waitflush', $waitFlush);
+    }
+
+    /**
+     * Get waitSearcher option
+     *
+     * @return boolean
+     */
+    public function getWaitSearcher()
+    {
+        return $this->getOption('waitsearcher');
+    }
+
+    /**
+     * Set waitSearcher option
+     *
+     * @param boolean $waitSearcher
+     * @return Solarium_Query_Update_Command_Optimize Provides fluent interface
+     */
+    public function setWaitSearcher($waitSearcher)
+    {
+        return $this->_setOption('waitsearcher', $waitSearcher);
+    }
+
+    /**
+     * Get maxSegments option
+     *
+     * @return boolean
+     */
+    public function getMaxSegments()
+    {
+        return $this->getOption('maxsegments');
+    }
+
+    /**
+     * Set maxSegments option
+     * 
+     * @param boolean $maxSegments
+     * @return Solarium_Query_Update_Command_Optimize Provides fluent interface
+     */
+    public function setMaxSegments($maxSegments)
+    {
+        return $this->_setOption('maxsegments', $maxSegments);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Delete.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Delete.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Delete.php	(revision 7576)
@@ -0,0 +1,173 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Update query delete command
+ *
+ * For details about the Solr options see:
+ * @link http://wiki.apache.org/solr/UpdateXmlMessages#A.22delete.22_by_ID_and_by_Query
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Update_Command_Delete extends Solarium_Query_Update_Command
+{
+
+    /**
+     * Ids to delete
+     *
+     * @var array
+     */
+    protected $_ids = array();
+
+    /**
+     * Delete queries
+     * 
+     * @var array
+     */
+    protected $_queries = array();
+
+    /**
+     * Get command type
+     * 
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Query_Update::COMMAND_DELETE;
+    }
+
+    /**
+     * Build ids/queries based on options
+     * 
+     * @return void
+     */
+    protected function _init()
+    {
+        $id = $this->getOption('id');
+        if (null !== $id) {
+            if (is_array($id)) {
+                $this->addIds($id);
+            } else {
+                $this->addId($id);
+            }
+        }
+        
+        $queries = $this->getOption('query');
+        if (null !== $queries) {
+            if (is_array($queries)) {
+                $this->addQueries($queries);
+            } else {
+                $this->addQuery($queries);
+            }
+        }
+    }
+
+    /**
+     * Add a single ID to the delete command
+     *
+     * @param int|string $id
+     * @return Solarium_Query_Update_Command_Delete Provides fluent interface
+     */
+    public function addId($id)
+    {
+        $this->_ids[] = $id;
+
+        return $this;
+    }
+
+    /**
+     * Add multiple IDs to the delete command
+     *
+     * @param array $ids
+     * @return Solarium_Query_Update_Command_Delete Provides fluent interface
+     */
+    public function addIds($ids)
+    {
+        $this->_ids = array_merge($this->_ids, $ids);
+
+        return $this;
+    }
+
+    /**
+     * Add a single query to the delete command
+     *
+     * @param string $query
+     * @return Solarium_Query_Update_Command_Delete Provides fluent interface
+     */
+    public function addQuery($query)
+    {
+        $this->_queries[] = $query;
+
+        return $this;
+    }
+
+    /**
+     * Add multiple queries to the delete command
+     *
+     * @param array $queries
+     * @return Solarium_Query_Update_Command_Delete Provides fluent interface
+     */
+    public function addQueries($queries)
+    {
+        $this->_queries = array_merge($this->_queries, $queries);
+
+        return $this;
+    }
+
+    /**
+     * Get all queries of this delete command
+     *
+     * @return array
+     */
+    public function getQueries()
+    {
+        return $this->_queries;
+    }
+
+    /**
+     * Get all qids of this delete command
+     *
+     * @return array
+     */
+    public function getIds()
+    {
+        return $this->_ids;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Add.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Add.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Add.php	(revision 7576)
@@ -0,0 +1,159 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Update query add command
+ *
+ * For details about the Solr options see:
+ * @link http://wiki.apache.org/solr/UpdateXmlMessages#add.2BAC8-update
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Update_Command_Add extends Solarium_Query_Update_Command
+{
+
+    /**
+     * Documents to add
+     *
+     * @var array
+     */
+    protected $_documents = array();
+
+    /**
+     * Get command type
+     * 
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Query_Update::COMMAND_ADD;
+    }
+
+    /**
+     * Add a single document
+     *
+     * @param object $document
+     * @return Solarium_Query_Update_Command_Add Provides fluent interface
+     */
+    public function addDocument($document)
+    {
+        $this->_documents[] = $document;
+
+        return $this;
+    }
+
+    /**
+     * Add multiple documents
+     *
+     * @param array|Traversable $documents
+     * @return Solarium_Query_Update_Command_Add Provides fluent interface
+     */
+    public function addDocuments($documents)
+    {
+        //if we don't have documents so far, accept arrays or Traversable objects as-is
+        if (empty($this->_documents)) {
+            $this->_documents = $documents;
+            return $this;
+        }
+
+        //if something Traversable is passed in, and there are existing documents, convert all to arrays before merging
+        if ($documents instanceof Traversable) {
+            $documents = iterator_to_array($documents);
+        }
+        if ($this->_documents instanceof Traversable) {
+            $this->_documents = array_merge(iterator_to_array($this->_documents), $documents);
+        } else {
+            $this->_documents = array_merge($this->_documents, $documents);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Get all documents
+     * 
+     * @return array
+     */
+    public function getDocuments()
+    {
+        return $this->_documents;
+    }
+
+    /**
+     * Set overwrite option
+     *
+     * @param boolean $overwrite
+     * @return Solarium_Query_Update_Command_Add Provides fluent interface
+     */
+    public function setOverwrite($overwrite)
+    {
+        return $this->_setOption('overwrite', $overwrite);
+    }
+
+    /**
+     * Get overwrite option
+     *
+     * @return boolean
+     */
+    public function getOverwrite()
+    {
+        return $this->getOption('overwrite');
+    }
+
+    /**
+     * Get commitWithin option
+     *
+     * @param boolean $commitWithin
+     * @return Solarium_Query_Update_Command_Add Provides fluent interface
+     */
+    public function setCommitWithin($commitWithin)
+    {
+        return $this->_setOption('commitwithin', $commitWithin);
+    }
+
+    /**
+     * Set commitWithin option
+     * 
+     * @return boolean
+     */
+    public function getCommitWithin()
+    {
+        return $this->getOption('commitwithin');
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Commit.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Commit.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update/Command/Commit.php	(revision 7576)
@@ -0,0 +1,124 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Update query commit command
+ *
+ * For details about the Solr options see:
+ * @link http://wiki.apache.org/solr/UpdateXmlMessages#A.22commit.22_and_.22optimize.22
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Update_Command_Commit extends Solarium_Query_Update_Command
+{
+
+    /**
+     * Get command type
+     * 
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Query_Update::COMMAND_COMMIT;
+    }
+
+    /**
+     * Get waitFlush option
+     * 
+     * @return boolean
+     */
+    public function getWaitFlush()
+    {
+        return $this->getOption('waitflush');
+    }
+
+    /**
+     * Set waitFlush option
+     * 
+     * @param boolean $waitFlush
+     * @return Solarium_Query_Update_Command_Commit Provides fluent interface
+     */
+    public function setWaitFlush($waitFlush)
+    {
+        return $this->_setOption('waitflush', $waitFlush);
+    }
+
+    /**
+     * Get waitSearcher option
+     *
+     * @return boolean
+     */
+    public function getWaitSearcher()
+    {
+        return $this->getOption('waitsearcher');
+    }
+
+    /**
+     * Set waitSearcher option
+     * 
+     * @param boolean $waitSearcher
+     * @return Solarium_Query_Update_Command_Commit Provides fluent interface
+     */
+    public function setWaitSearcher($waitSearcher)
+    {
+        return $this->_setOption('waitsearcher', $waitSearcher);
+    }
+
+    /**
+     * Get expungeDeletes option
+     *
+     * @return boolean
+     */
+    public function getExpungeDeletes()
+    {
+        return $this->getOption('expungedeletes');
+    }
+
+    /**
+     * Set expungeDeletes option
+     * 
+     * @param boolean $expungeDeletes
+     * @return Solarium_Query_Update_Command_Commit Provides fluent interface
+     */
+    public function setExpungeDeletes($expungeDeletes)
+    {
+        return $this->_setOption('expungedeletes', $expungeDeletes);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Analysis/Document.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Analysis/Document.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Analysis/Document.php	(revision 7576)
@@ -0,0 +1,110 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Analysis document query
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Analysis_Document extends Solarium_Query_Analysis
+{
+
+    /**
+     * Documents to analyze
+     *
+     * @var array
+     */
+    protected $_documents = array();
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'handler'       => 'analysis/document',
+        'resultclass'   => 'Solarium_Result_Analysis_Document',
+    );
+
+    /**
+     * Get type for this query
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Client::QUERYTYPE_ANALYSIS_DOCUMENT;
+    }
+
+    /**
+     * Add a single document
+     *
+     * @param object $document
+     * @return Solarium_Query_Analysis_Document Provides fluent interface
+     */
+    public function addDocument($document)
+    {
+        $this->_documents[] = $document;
+
+        return $this;
+    }
+
+    /**
+     * Add multiple documents
+     *
+     * @param array $documents
+     * @return Solarium_Query_Analysis_Document fluent interface
+     */
+    public function addDocuments($documents)
+    {
+        $this->_documents = array_merge($this->_documents, $documents);
+        return $this;
+    }
+
+    /**
+     * Get all documents
+     *
+     * @return array
+     */
+    public function getDocuments()
+    {
+        return $this->_documents;
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Analysis/Field.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Analysis/Field.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Analysis/Field.php	(revision 7576)
@@ -0,0 +1,137 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Analysis document query
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Analysis_Field extends Solarium_Query_Analysis
+{
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'handler'       => 'analysis/field',
+        'resultclass'   => 'Solarium_Result_Analysis_Field',
+    );
+    
+    /**
+     * Get type for this query
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Client::QUERYTYPE_ANALYSIS_FIELD;
+    }
+
+    /**
+     * Set the field value option
+     *
+     * The text that will be analyzed. The analysis will mimic the index-time analysis.
+     *
+     * @param string $value
+     * @return Solarium_Query_Analysis_Field Provides fluent interface
+     */
+    public function setFieldValue($value)
+    {
+        return $this->_setOption('fieldvalue', $value);
+    }
+
+    /**
+     * Get the field value option
+     *
+     * @return string
+     */
+    public function getFieldValue()
+    {
+        return $this->getOption('fieldvalue');
+    }
+
+    /**
+     * Set the field type option
+     *
+     * When present, the text will be analyzed based on the specified type
+     *
+     * @param string $type
+     * @return Solarium_Query_Analysis_Field Provides fluent interface
+     */
+    public function setFieldType($type)
+    {
+        return $this->_setOption('fieldtype', $type);
+    }
+
+    /**
+     * Get the fieldtype option
+     *
+     * @return string
+     */
+    public function getFieldType()
+    {
+        return $this->getOption('fieldtype');
+    }
+
+    /**
+     * Set the field name option
+     *
+     * When present, the text will be analyzed based on the type of this field name
+     *
+     * @param string $name
+     * @return Solarium_Query_Analysis_Field Provides fluent interface
+     */
+    public function setFieldName($name)
+    {
+        return $this->_setOption('fieldname', $name);
+    }
+
+    /**
+     * Get the fieldname option
+     *
+     * @return string
+     */
+    public function getFieldName()
+    {
+        return $this->getOption('fieldname');
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Ping.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Ping.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Ping.php	(revision 7576)
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Ping query
+ *
+ * Use a ping query to test Solr communication.
+ * A ping query has only two options, the path to use and the resultclass. See
+ * {@link Solarium_Query} for the methods to set these options.
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Ping extends Solarium_Query
+{
+
+    /**
+     * Get type for this query
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Client::QUERYTYPE_PING;
+    }
+
+    /**
+     * Default options
+     * 
+     * @var array
+     */
+    protected $_options = array(
+        'resultclass' => 'Solarium_Result_Ping',
+        'handler' => 'admin/ping',
+    );
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Helper.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Helper.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Helper.php	(revision 7576)
@@ -0,0 +1,415 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Query helper
+ *
+ * Generates small snippets for use in queries, filterqueries and sorting
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Helper
+{
+
+    /**
+     * Placeholder pattern for use in the assemble method
+     *
+     * @var string
+     */
+    protected $_placeHolderPattern = '/%(L|P|T|)([0-9]+)%/i';
+
+    /**
+     * Array of parts to use for assembling a query string
+     *
+     * @var array
+     */
+    protected $_assembleParts;
+
+    /**
+     * Counter to keep dereferenced params unique (within a single query instance)
+     *
+     * @var int
+     */
+    protected $_derefencedParamsLastKey = 0;
+
+    /**
+     * Solarium_Query instance, optional.
+     * Used for dereferenced params.
+     *
+     * @var Solarium_Query
+     */
+    protected $_query;
+
+    /**
+     * Constructor
+     *
+     * @param Solarium_Query $query
+     */
+    public function __construct($query = null)
+    {
+        $this->_query = $query;
+    }
+
+    /**
+     * Escape a term
+     *
+     * A term is a single word.
+     * All characters that have a special meaning in a Solr query are escaped.
+     *
+     * If you want to use the input as a phrase please use the {@link phrase()}
+     * method, because a phrase requires much less escaping.\
+     *
+     * @link http://lucene.apache.org/java/docs/queryparsersyntax.html#Escaping%20Special%20Characters
+     *
+     * @param string $input
+     * @return string
+     */
+    public function escapeTerm($input)
+    {
+        $pattern = '/(\+|-|&&|\|\||!|\(|\)|\{|}|\[|]|\^|"|~|\*|\?|:|\\\)/';
+
+        return preg_replace($pattern, '\\\$1', $input);
+    }
+
+    /**
+     * Escape a phrase
+     *
+     * A phrase is a group of words.
+     * Special characters will be escaped and the phrase will be surrounded by
+     * double quotes to group the input into a single phrase. So don't put
+     * quotes around the input.
+     *
+     * Do mind that you cannot build a complete query first and then pass it to
+     * this method, the whole query will be escaped. You need to escape only the
+     * 'content' of your query.
+     *
+     * @param string $input
+     * @return string
+     */
+    public function escapePhrase($input)
+    {
+        return '"' . preg_replace('/("|\\\)/', '\\\$1', $input) . '"';
+    }
+
+    /**
+     * Format a date to the expected formatting used in SOLR
+     *
+     * This format was derived to be standards compliant (ISO 8601)
+     * A date field shall be of the form 1995-12-31T23:59:59Z The trailing "Z" designates UTC time and is mandatory
+     *
+     * @see http://lucene.apache.org/solr/api/org/apache/solr/schema/DateField.html
+     *
+     * @param int|string|DateTime $input accepted formats: timestamp, date string or DateTime
+     * @return string|false false is returned in case of invalid input
+     */
+    public function formatDate($input)
+    {
+        switch(true){
+
+
+            // input of datetime object
+            case $input instanceof DateTime:
+                // no work needed
+                break;
+
+
+            // input of timestamp or date/time string
+            case is_string($input) || is_numeric($input):
+
+                // if date/time string: convert to timestamp first
+                if (is_string($input)) $input = strtotime($input);
+
+                // now try converting the timestamp to a datetime instance, on failure return false
+                try {
+                    $input = new DateTime('@' . $input);
+                } catch (Exception $e) {
+                    $input = false;
+                }
+                break;
+
+
+            // any other input formats can be added in additional cases here...
+            // case $input instanceof Zend_Date:
+
+
+            // unsupported input format
+            default:
+                $input = false;
+                break;
+        }
+
+
+        // handle the filtered input
+        if ($input) {
+            // when we get here the input is always a datetime object
+            $input->setTimezone(new DateTimeZone('UTC'));
+            $iso8601 = $input->format(DateTime::ISO8601);
+            $iso8601 = strstr($iso8601, '+', true); //strip timezone
+            $iso8601 .= 'Z';
+            return $iso8601;
+        } else {
+            // unsupported input
+            return false;
+        }
+    }
+
+    /**
+     * Render a range query
+     *
+     * From and to can be any type of data. For instance int, string or point.
+     *
+     * Example: rangeQuery('store', '45,-94', '46,-93')
+     * Returns: store:[45,-94 TO 46,-93]
+     *
+     * @param string $field
+     * @param string $from
+     * @param string $to
+     * @param boolean $inclusive
+     * @return string
+     */
+    public function rangeQuery($field, $from, $to, $inclusive = true)
+    {
+        if ($inclusive) {
+            return $field . ':[' . $from . ' TO ' . $to . ']';
+        } else {
+            return $field . ':{' . $from . ' TO ' . $to . '}';
+        }
+    }
+
+    /**
+     * Render a geofilt (distance) filter
+     *
+     * Find all entries within the distance of a certain point.
+     *
+     * @param  $pointX
+     * @param  $pointY
+     * @param  $field
+     * @param  $distance
+     * @return string
+     */
+    public function geofilt($pointX, $pointY, $field, $distance)
+    {
+        return $this->qparser(
+            'geofilt',
+            array(
+                'pt' => $pointX.','.$pointY,
+                'sfield' => $field,
+                'd' => $distance
+            )
+        );
+    }
+
+    /**
+     * Render a bbox (boundingbox) filter
+     *
+     * Exact distance calculations can be somewhat expensive and it can often
+     * make sense to use a quick approximation instead. The bbox filter is
+     * guaranteed to encompass all of the points of interest, but it may also
+     * include other points that are slightly outside of the required distance.
+     *
+     * @param string $pointX
+     * @param string $pointY
+     * @param string $field
+     * @param string $distance
+     * @return string
+     */
+    public function bbox($pointX, $pointY, $field, $distance)
+    {
+        return $this->qparser(
+            'bbox',
+            array(
+                'pt' => $pointX.','.$pointY,
+                'sfield' => $field,
+                'd' => $distance
+            )
+        );
+    }
+
+    /**
+     * Render a geodist function call
+     *
+     * geodist is a function query that yields the calculated distance.
+     * This gives the flexibility to do a number of interesting things,
+     * such as sorting by the distance (Solr can sort by any function query),
+     * or combining the distance with the relevancy score,
+     * such as boosting by the inverse of the distance.
+     *
+     * @param  $pointX
+     * @param  $pointY
+     * @param  $field
+     * @return string
+     */
+    public function geodist($pointX, $pointY, $field)
+    {
+        return $this->functionCall(
+            'geodist',
+            array($pointX, $pointY, $field)
+        );
+    }
+
+    /**
+     * Render a qparser plugin call
+     *
+     * @param string $name
+     * @param array $params
+     * @param boolean $dereferenced
+     * @return string
+     */
+    public function qparser($name, $params = array(), $dereferenced = false)
+    {
+        if ($dereferenced) {
+
+            if (!$this->_query) {
+                throw new Solarium_Exception(
+                    'Dereferenced params can only be used in a Solarium_Query_Helper instance retrieved from the query '
+                    . 'by using the getHelper() method, this instance was manually created'
+                );
+            }
+
+            foreach ($params as $paramKey => $paramValue) {
+                $this->_derefencedParamsLastKey++;
+                $derefKey = 'deref_' . $this->_derefencedParamsLastKey;
+                $this->_query->addParam($derefKey, $paramValue);
+                $params[$paramKey] = '$'.$derefKey;
+            }
+        }
+
+        $output = '{!'.$name;
+        foreach ($params as $key=>$value) {
+            $output .= ' ' . $key . '=' . $value;
+        }
+        $output .= '}';
+
+        return $output;
+    }
+
+    /**
+     * Render a functionCall
+     *
+     * @param string $name
+     * @param array $params
+     * @return string
+     */
+    public function functionCall($name, $params = array())
+    {
+        return $name . '(' . implode($params, ',') . ')';
+    }
+
+    /**
+     * Assemble a querystring with placeholders
+     *
+     * These placeholder modes are supported:
+     * %1% = no mode, will default to literal
+     * %L2% = literal
+     * %P3% = phrase-escaped
+     * %T4% = term-escaped
+     *
+     * Numbering starts at 1, so number 1 refers to the first entry
+     * of $parts (which has array key 0)
+     * You can use the same part multiple times, even in multiple modes.
+     * The mode letters are not case sensitive.
+     *
+     * The mode matching pattern can be customized by overriding the
+     * value of $this->_placeHolderPattern
+     *
+     * @since 2.1.0
+     *
+     * @param string $query
+     * @param array $parts Array of strings
+     * @return string
+     */
+    public function assemble($query, $parts)
+    {
+        $this->_assembleParts = $parts;
+
+        return preg_replace_callback(
+            $this->_placeHolderPattern,
+            array($this, '_renderPlaceHolder'),
+            $query
+        );
+    }
+
+    /**
+     * Render placeholders in a querystring
+     *
+     * @throws Solarium_Exception
+     * @param array $matches
+     * @return string
+     */
+    protected function _renderPlaceHolder($matches)
+    {
+        $partNumber = $matches[2];
+        $partMode = strtoupper($matches[1]);
+
+        if (isset($this->_assembleParts[$partNumber-1])) {
+            $value = $this->_assembleParts[$partNumber-1];
+        } else {
+            throw new Solarium_Exception('No value supplied for part #' . $partNumber . ' in query assembler');
+        }
+
+        switch($partMode)
+        {
+            case 'P':
+                $value = $this->escapePhrase($value);
+                break;
+            case 'T':
+                $value = $this->escapeTerm($value);
+                break;
+        }
+
+        return $value;
+    }
+
+    /**
+     * Render join localparams syntax
+     *
+     * @see http://wiki.apache.org/solr/Join
+     * @since 2.4.0
+     *
+     * @param string $from
+     * @param string $to
+     * @param boolean $dereferenced
+     * @return string
+     */
+    public function join($from, $to, $dereferenced = false)
+    {
+        return $this->qparser('join', array('from' => $from, 'to' => $to), $dereferenced);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/MoreLikeThis.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/MoreLikeThis.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/MoreLikeThis.php	(revision 7576)
@@ -0,0 +1,370 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer.
+ * Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @copyright Copyright 2011 Gasol Wu <gasol.wu@gmail.com>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * MoreLikeThis Query
+ *
+ * Can be used to select documents and/or facets from Solr. This querytype has
+ * lots of options and there are many Solarium subclasses for it.
+ * See the Solr documentation and the relevant Solarium classes for more info.
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_MoreLikeThis extends Solarium_Query_Select
+{
+
+    /**
+     * Get type for this query
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Client::QUERYTYPE_MORELIKETHIS;
+    }
+    
+    /**
+     * Default options
+     * 
+     * @var array
+     */
+    protected $_options = array(
+        'handler'       => 'mlt',
+        'resultclass'   => 'Solarium_Result_MoreLikeThis',
+        'documentclass' => 'Solarium_Document_ReadOnly',
+        'query'         => '*:*',
+        'start'         => 0,
+        'rows'          => 10,
+        'fields'        => '*,score',
+        'interestingTerms' => 'none',
+        'matchinclude'  => false,
+        'stream'        => false
+    );
+
+    /**
+     * Set query stream option
+     *
+     * Set to true to post query content instead of using the URL param
+     *
+     * @link http://wiki.apache.org/solr/ContentStream ContentStream
+     *
+     * @param boolean $stream
+     * @return Solarium_Query_MoreLikeThis Provides fluent interface
+     */
+    public function setQueryStream($stream)
+    {
+        return $this->_setOption('stream', $stream);
+    }
+
+    /**
+     * Get stream option
+     *
+     * @return boolean
+     */
+    public function getQueryStream()
+    {
+        return $this->getOption('stream');
+    }
+
+    /**
+     * Set the interestingTerms parameter.  Must be one of: none, list, details.
+     *
+     * @see http://wiki.apache.org/solr/MoreLikeThisHandler#Params
+     * @param string $term
+     * @return Solarium_Query_MoreLikeThis Provides fluent interface
+     */
+    public function setInterestingTerms($term)
+    {
+        return $this->_setOption('interestingTerms', $term);
+    }
+    
+    /**
+     * Get the interestingTerm parameter.
+     *
+     * @return string
+     */
+    public function getInterestingTerms() 
+    {
+        return $this->getOption('interestingTerms');
+    }
+    
+    /**
+     * Set the match.include parameter, which is either 'true' or 'false'.  
+     * 
+     * @see http://wiki.apache.org/solr/MoreLikeThisHandler#Params
+     *
+     * @param boolean $include
+     * @return Solarium_Query_MoreLikeThis Provides fluent interface
+     */
+    public function setMatchInclude($include)
+    {
+        return $this->_setOption('matchinclude', $include);
+    }
+    
+    /**
+     * Get the match.include parameter.
+     *
+     * @return string
+     */
+    public function getMatchInclude() 
+    {
+        return $this->getOption('matchinclude');
+    }
+
+    /**
+     * Set MLT fields option
+     *
+     * The fields to use for similarity. NOTE: if possible, these should have a
+     * stored TermVector
+     *
+     * Separate multiple fields with commas.
+     *
+     * @param string $fields
+     * @return Solarium_Query_MoreLikeThis Provides fluent interface
+     */
+    public function setMltFields($fields)
+    {
+        return $this->_setOption('mltfields', $fields);
+    }
+
+    /**
+     * Get MLT fields option
+     *
+     * @return string|null
+     */
+    public function getMltFields()
+    {
+        return $this->getOption('mltfields');
+    }
+
+    /**
+     * Set minimumtermfrequency option
+     *
+     * Minimum Term Frequency - the frequency below which terms will be ignored
+     * in the source doc.
+     *
+     * @param int $minimum
+     * @return Solarium_Query_MoreLikeThis Provides fluent interface
+     */
+    public function setMinimumTermFrequency($minimum)
+    {
+        return $this->_setOption('minimumtermfrequency', $minimum);
+    }
+
+    /**
+     * Get minimumtermfrequency option
+     *
+     * @return integer|null
+     */
+    public function getMinimumTermFrequency()
+    {
+        return $this->getOption('minimumtermfrequency');
+    }
+
+    /**
+     * Set minimumdocumentfrequency option
+     *
+     * Minimum Document Frequency - the frequency at which words will be
+     * ignored which do not occur in at least this many docs.
+     *
+     * @param int $minimum
+     * @return Solarium_Query_MoreLikeThis Provides fluent interface
+     */
+    public function setMinimumDocumentFrequency($minimum)
+    {
+        return $this->_setOption('minimumdocumentfrequency', $minimum);
+    }
+
+    /**
+     * Get minimumdocumentfrequency option
+     *
+     * @return integer|null
+     */
+    public function getMinimumDocumentFrequency()
+    {
+        return $this->getOption('minimumdocumentfrequency');
+    }
+
+    /**
+     * Set minimumwordlength option
+     *
+     * Minimum word length below which words will be ignored.
+     *
+     * @param int $minimum
+     * @return Solarium_Query_MoreLikeThis Provides fluent interface
+     */
+    public function setMinimumWordLength($minimum)
+    {
+        return $this->_setOption('minimumwordlength', $minimum);
+    }
+
+    /**
+     * Get minimumwordlength option
+     *
+     * @return integer|null
+     */
+    public function getMinimumWordLength()
+    {
+        return $this->getOption('minimumwordlength');
+    }
+
+    /**
+     * Set maximumwordlength option
+     *
+     * Maximum word length above which words will be ignored.
+     *
+     * @param int $maximum
+     * @return Solarium_Query_MoreLikeThis Provides fluent interface
+     */
+    public function setMaximumWordLength($maximum)
+    {
+        return $this->_setOption('maximumwordlength', $maximum);
+    }
+
+    /**
+     * Get maximumwordlength option
+     *
+     * @return integer|null
+     */
+    public function getMaximumWordLength()
+    {
+        return $this->getOption('maximumwordlength');
+    }
+
+    /**
+     * Set maximumqueryterms option
+     *
+     * Maximum number of query terms that will be included in any generated
+     * query.
+     *
+     * @param int $maximum
+     * @return Solarium_Query_MoreLikeThis Provides fluent interface
+     */
+    public function setMaximumQueryTerms($maximum)
+    {
+        return $this->_setOption('maximumqueryterms', $maximum);
+    }
+
+    /**
+     * Get maximumqueryterms option
+     *
+     * @return integer|null
+     */
+    public function getMaximumQueryTerms()
+    {
+        return $this->getOption('maximumqueryterms');
+    }
+
+    /**
+     * Set maximumnumberoftokens option
+     *
+     * Maximum number of tokens to parse in each example doc field that is not
+     * stored with TermVector support.
+     *
+     * @param int $maximum
+     * @return Solarium_Query_MoreLikeThis Provides fluent interface
+     */
+    public function setMaximumNumberOfTokens($maximum)
+    {
+        return $this->_setOption('maximumnumberoftokens', $maximum);
+    }
+
+    /**
+     * Get maximumnumberoftokens option
+     *
+     * @return integer|null
+     */
+    public function getMaximumNumberOfTokens()
+    {
+        return $this->getOption('maximumnumberoftokens');
+    }
+
+    /**
+     * Set boost option
+     *
+     * If true the query will be boosted by the interesting term relevance.
+     *
+     * @param boolean $boost
+     * @return Solarium_Query_MoreLikeThis Provides fluent interface
+     */
+    public function setBoost($boost)
+    {
+        return $this->_setOption('boost', $boost);
+    }
+
+    /**
+     * Get boost option
+     *
+     * @return boolean|null
+     */
+    public function getBoost()
+    {
+        return $this->getOption('boost');
+    }
+
+    /**
+     * Set queryfields option
+     *
+     * Query fields and their boosts using the same format as that used in
+     * DisMaxQParserPlugin. These fields must also be specified in fields.
+     *
+     * Separate multiple fields with commas.
+     *
+     * @param string $queryFields
+     * @return Solarium_Query_MoreLikeThis Provides fluent interface
+     */
+    public function setQueryFields($queryFields)
+    {
+        return $this->_setOption('queryfields', $queryFields);
+    }
+
+    /**
+     * Get queryfields option
+     *
+     * @return string|null
+     */
+    public function getQueryFields()
+    {
+        return $this->getOption('queryfields');
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Select.php	(revision 7576)
@@ -0,0 +1,975 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Select Query
+ *
+ * Can be used to select documents and/or facets from Solr. This querytype has
+ * lots of options and there are many Solarium subclasses for it.
+ * See the Solr documentation and the relevant Solarium classes for more info.
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Select extends Solarium_Query
+{
+
+    /**
+     * Solr sort mode descending
+     */
+    const SORT_DESC = 'desc';
+
+    /**
+     * Solr sort mode ascending
+     */
+    const SORT_ASC = 'asc';
+
+    /**
+     * Solr query operator AND
+     */
+    const QUERY_OPERATOR_AND = 'AND';
+
+    /**
+     * Solr query operator OR
+     */
+    const QUERY_OPERATOR_OR = 'OR';
+
+    /**
+     * Query component facetset
+     */
+    const COMPONENT_FACETSET = 'facetset';
+
+    /**
+     * Query component dismax
+     */
+    const COMPONENT_DISMAX = 'dismax';
+
+    /**
+     * Query component morelikethis
+     */
+    const COMPONENT_MORELIKETHIS = 'morelikethis';
+
+    /**
+     * Query component highlighting
+     */
+    const COMPONENT_HIGHLIGHTING = 'highlighting';
+
+    /**
+     * Query component spellcheck
+     */
+    const COMPONENT_SPELLCHECK = 'spellcheck';
+
+    /**
+     * Query component grouping
+     */
+    const COMPONENT_GROUPING = 'grouping';
+
+    /**
+     * Query component distributed search
+     */
+    const COMPONENT_DISTRIBUTEDSEARCH = 'distributedsearch';
+
+    /**
+     * Query component stats
+     */
+    const COMPONENT_STATS = 'stats';
+
+    /**
+     * Query component debug
+     */
+    const COMPONENT_DEBUG = 'debug';
+
+    /**
+     * Get type for this query
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Client::QUERYTYPE_SELECT;
+    }
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'handler'       => 'select',
+        'resultclass'   => 'Solarium_Result_Select',
+        'documentclass' => 'Solarium_Document_ReadOnly',
+        'query'         => '*:*',
+        'start'         => 0,
+        'rows'          => 10,
+        'fields'        => '*,score',
+    );
+
+    /**
+     * Default select query component types
+     *
+     * @var array
+     */
+    protected $_componentTypes = array(
+        self::COMPONENT_FACETSET => array(
+            'component' => 'Solarium_Query_Select_Component_FacetSet',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Select_Component_FacetSet',
+            'responseparser' => 'Solarium_Client_ResponseParser_Select_Component_FacetSet',
+        ),
+        self::COMPONENT_DISMAX => array(
+            'component' => 'Solarium_Query_Select_Component_DisMax',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Select_Component_DisMax',
+            'responseparser' => null,
+        ),
+        self::COMPONENT_MORELIKETHIS => array(
+            'component' => 'Solarium_Query_Select_Component_MoreLikeThis',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Select_Component_MoreLikeThis',
+            'responseparser' => 'Solarium_Client_ResponseParser_Select_Component_MoreLikeThis',
+        ),
+        self::COMPONENT_HIGHLIGHTING => array(
+            'component' => 'Solarium_Query_Select_Component_Highlighting',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Select_Component_Highlighting',
+            'responseparser' => 'Solarium_Client_ResponseParser_Select_Component_Highlighting',
+        ),
+        self::COMPONENT_GROUPING => array(
+            'component' => 'Solarium_Query_Select_Component_Grouping',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Select_Component_Grouping',
+            'responseparser' => 'Solarium_Client_ResponseParser_Select_Component_Grouping',
+        ),
+        self::COMPONENT_SPELLCHECK => array(
+            'component' => 'Solarium_Query_Select_Component_Spellcheck',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Select_Component_Spellcheck',
+            'responseparser' => 'Solarium_Client_ResponseParser_Select_Component_Spellcheck',
+        ),
+        self::COMPONENT_DISTRIBUTEDSEARCH => array(
+            'component' => 'Solarium_Query_Select_Component_DistributedSearch',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Select_Component_DistributedSearch',
+            'responseparser' => null,
+        ),
+        self::COMPONENT_STATS => array(
+            'component' => 'Solarium_Query_Select_Component_Stats',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Select_Component_Stats',
+            'responseparser' => 'Solarium_Client_ResponseParser_Select_Component_Stats',
+        ),
+        self::COMPONENT_DEBUG => array(
+            'component' => 'Solarium_Query_Select_Component_Debug',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Select_Component_Debug',
+            'responseparser' => 'Solarium_Client_ResponseParser_Select_Component_Debug',
+        ),
+    );
+
+    /**
+     * Fields to fetch
+     *
+     * @var array
+     */
+    protected $_fields = array();
+
+    /**
+     * Items to sort on
+     *
+     * @var array
+     */
+    protected $_sorts = array();
+
+    /**
+     * Filterqueries
+     *
+     * @var array
+     */
+    protected $_filterQueries = array();
+
+    /**
+     * Search components
+     *
+     * @var array
+     */
+    protected $_components = array();
+
+    /**
+     * Initialize options
+     *
+     * Several options need some extra checks or setup work, for these options
+     * the setters are called.
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'query':
+                    $this->setQuery($value);
+                    break;
+                case 'filterquery':
+                    $this->addFilterQueries($value);
+                    break;
+                case 'sort':
+                    $this->addSorts($value);
+                    break;
+                case 'fields':
+                    $this->addFields($value);
+                    break;
+                case 'rows':
+                    $this->setRows((int)$value);
+                    break;
+                case 'start':
+                    $this->setStart((int)$value);
+                    break;
+                case 'component':
+                    $this->_createComponents($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Set the query string
+     *
+     * Overwrites the current value. You are responsible for the correct
+     * escaping of user input.
+     *
+     * @param string $query
+     * @param array $bind Bind values for placeholders in the query string
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function setQuery($query, $bind = null)
+    {
+        if (!is_null($bind)) {
+            $query = $this->getHelper()->assemble($query, $bind);
+        }
+
+        return $this->_setOption('query', trim($query));
+    }
+
+    /**
+     * Get the query string
+     *
+     * @return string
+     */
+    public function getQuery()
+    {
+        return $this->getOption('query');
+    }
+
+    /**
+     * Set default query operator
+     *
+     * Use one of the constants as value
+     *
+     * @param string $operator
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function setQueryDefaultOperator($operator)
+    {
+        return $this->_setOption('querydefaultoperator', $operator);
+    }
+
+    /**
+     * Get the default query operator
+     *
+     * @return null|string
+     */
+    public function getQueryDefaultOperator()
+    {
+        return $this->getOption('querydefaultoperator');
+    }
+
+    /**
+     * Set default query field
+     *
+     * @param string $field
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function setQueryDefaultField($field)
+    {
+        return $this->_setOption('querydefaultfield', $field);
+    }
+
+    /**
+     * Get the default query field
+     *
+     * @return null|string
+     */
+    public function getQueryDefaultField()
+    {
+        return $this->getOption('querydefaultfield');
+    }
+
+    /**
+     * Set the start offset
+     *
+     * @param integer $start
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function setStart($start)
+    {
+        return $this->_setOption('start', $start);
+    }
+
+    /**
+     * Get the start offset
+     *
+     * @return integer
+     */
+    public function getStart()
+    {
+        return $this->getOption('start');
+    }
+
+    /**
+     * Set a custom resultclass
+     *
+     * @param string $value classname
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function setResultClass($value)
+    {
+        return $this->_setOption('resultclass', $value);
+    }
+
+    /**
+     * Get the current resultclass option
+     *
+     * The value is a classname, not an instance
+     *
+     * @return string
+     */
+    public function getResultClass()
+    {
+        return $this->getOption('resultclass');
+    }
+
+    /**
+     * Set a custom document class
+     *
+     * @param string $value classname
+     * @return Solarium_Query
+     */
+    public function setDocumentClass($value)
+    {
+        return $this->_setOption('documentclass', $value);
+    }
+
+    /**
+     * Get the current documentclass option
+     *
+     * The value is a classname, not an instance
+     *
+     * @return string
+     */
+    public function getDocumentClass()
+    {
+        return $this->getOption('documentclass');
+    }
+
+    /**
+     * Set the number of rows to fetch
+     *
+     * @param integer $rows
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function setRows($rows)
+    {
+        return $this->_setOption('rows', $rows);
+    }
+
+    /**
+     * Get the number of rows
+     *
+     * @return integer
+     */
+    public function getRows()
+    {
+        return $this->getOption('rows');
+    }
+
+    /**
+     * Specify a field to return in the resultset
+     *
+     * @param string $field
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function addField($field)
+    {
+       $this->_fields[$field] = true;
+       return $this;
+    }
+
+    /**
+     * Specify multiple fields to return in the resultset
+     *
+     * @param string|array $fields can be an array or string with comma
+     * separated fieldnames
+     *
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function addFields($fields)
+    {
+        if (is_string($fields)) {
+            $fields = explode(',', $fields);
+            $fields = array_map('trim', $fields);
+        }
+
+        foreach ($fields AS $field) {
+            $this->addField($field);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove a field from the field list
+     *
+     * @param string $field
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function removeField($field)
+    {
+        if (isset($this->_fields[$field])) {
+           unset($this->_fields[$field]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all fields from the field list.
+     *
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function clearFields()
+    {
+        $this->_fields = array();
+        return $this;
+    }
+
+    /**
+     * Get the list of fields
+     *
+     * @return array
+     */
+    public function getFields()
+    {
+        return array_keys($this->_fields);
+    }
+
+    /**
+     * Set multiple fields
+     *
+     * This overwrites any existing fields
+     *
+     * @param array $fields
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function setFields($fields)
+    {
+        $this->clearFields();
+        $this->addFields($fields);
+
+        return $this;
+    }
+
+    /**
+     * Add a sort
+     *
+     * @param string $sort
+     * @param string $order
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function addSort($sort, $order)
+    {
+        $this->_sorts[$sort] = $order;
+
+        return $this;
+    }
+
+    /**
+     * Add multiple sorts
+     *
+     * The input array must contain sort items as keys and the order as values.
+     *
+     * @param array $sorts
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function addSorts(array $sorts)
+    {
+        foreach ($sorts AS $sort => $order) {
+            $this->addSort($sort, $order);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove a sort
+     *
+     * @param string $sort
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function removeSort($sort)
+    {
+        if (isset($this->_sorts[$sort])) {
+            unset($this->_sorts[$sort]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all sorts
+     *
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function clearSorts()
+    {
+        $this->_sorts = array();
+        return $this;
+    }
+
+    /**
+     * Get a list of the sorts
+     *
+     * @return array
+     */
+    public function getSorts()
+    {
+        return $this->_sorts;
+    }
+
+    /**
+     * Set multiple sorts
+     *
+     * This overwrites any existing sorts
+     *
+     * @param array $sorts
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function setSorts($sorts)
+    {
+        $this->clearSorts();
+        $this->addSorts($sorts);
+
+        return $this;
+    }
+
+    /**
+     * Create a filterquery instance
+     *
+     * If you supply a string as the first arguments ($options) it will be used as the key for the filterquery
+     * and it will be added to this query.
+     * If you supply an options array/object that contains a key the filterquery will also be added to the query.
+     *
+     * When no key is supplied the filterquery cannot be added, in that case you will need to add it manually
+     * after setting the key, by using the addFilterQuery method.
+     *
+     * @param mixed $options
+     * @return Solarium_Query_Select_FilterQuery
+     */
+    public function createFilterQuery($options = null)
+    {
+        if (is_string($options)) {
+            $fq = new Solarium_Query_Select_FilterQuery;
+            $fq->setKey($options);
+        } else {
+            $fq = new Solarium_Query_Select_FilterQuery($options);
+        }
+
+        if ($fq->getKey() !== null) {
+            $this->addFilterQuery($fq);
+        }
+
+        return $fq;
+    }
+
+    /**
+     * Add a filter query
+     *
+     * Supports a filterquery instance or a config array, in that case a new
+     * filterquery instance wil be created based on the options.
+     *
+     * @param Solarium_Query_Select_FilterQuery|array $filterQuery
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function addFilterQuery($filterQuery)
+    {
+        if (is_array($filterQuery)) {
+            $filterQuery = new Solarium_Query_Select_FilterQuery($filterQuery);
+        }
+
+        $key = $filterQuery->getKey();
+
+        if (0 === strlen($key)) {
+            throw new Solarium_Exception('A filterquery must have a key value');
+        }
+
+        //double add calls for the same FQ are ignored, but non-unique keys cause an exception
+        //@todo add trigger_error with a notice for double add calls?
+        if (array_key_exists($key, $this->_filterQueries) && $this->_filterQueries[$key] !== $filterQuery) {
+            throw new Solarium_Exception('A filterquery must have a unique key value within a query');
+        } else {
+            $this->_filterQueries[$key] = $filterQuery;
+        }
+
+        return $this;
+    }
+
+    /**
+     * Add multiple filterqueries
+     *
+     * @param array $filterQueries
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function addFilterQueries(array $filterQueries)
+    {
+        foreach ($filterQueries AS $key => $filterQuery) {
+
+            // in case of a config array: add key to config
+            if (is_array($filterQuery) && !isset($filterQuery['key'])) {
+                $filterQuery['key'] = $key;
+            }
+
+            $this->addFilterQuery($filterQuery);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Get a filterquery
+     *
+     * @param string $key
+     * @return string
+     */
+    public function getFilterQuery($key)
+    {
+        if (isset($this->_filterQueries[$key])) {
+            return $this->_filterQueries[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all filterqueries
+     *
+     * @return array
+     */
+    public function getFilterQueries()
+    {
+        return $this->_filterQueries;
+    }
+
+    /**
+     * Remove a single filterquery
+     *
+     * You can remove a filterquery by passing it's key, or by passing the filterquery instance
+     *
+     * @param string|Solarium_Query_Select_FilterQuery $filterQuery
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function removeFilterQuery($filterQuery)
+    {
+        if (is_object($filterQuery)) {
+            $filterQuery = $filterQuery->getKey();
+        }
+
+        if (isset($this->_filterQueries[$filterQuery])) {
+            unset($this->_filterQueries[$filterQuery]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all filterqueries
+     *
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function clearFilterQueries()
+    {
+        $this->_filterQueries = array();
+        return $this;
+    }
+
+    /**
+     * Set multiple filterqueries
+     *
+     * This overwrites any existing filterqueries
+     *
+     * @param array $filterQueries
+     */
+    public function setFilterQueries($filterQueries)
+    {
+        $this->clearFilterQueries();
+        $this->addFilterQueries($filterQueries);
+    }
+
+    /**
+     * Get all registered component types
+     *
+     * @return array
+     */
+    public function getComponentTypes()
+    {
+        return $this->_componentTypes;
+    }
+
+    /**
+     * Register a component type
+     *
+     * @param string $key
+     * @param string $component
+     * @param string $requestBuilder
+     * @param string $responseParser
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function registerComponentType($key, $component, $requestBuilder=null, $responseParser=null)
+    {
+        $this->_componentTypes[$key] = array(
+            'component' => $component,
+            'requestbuilder' => $requestBuilder,
+            'responseparser' => $responseParser,
+        );
+
+        return $this;
+    }
+
+    /**
+     * Get all registered components
+     *
+     * @return array
+     */
+    public function getComponents()
+    {
+        return $this->_components;
+    }
+
+    /**
+     * Get a component instance by key
+     *
+     * You can optionally supply an autoload class to create a new component
+     * instance if there is no registered component for the given key yet.
+     *
+     * @param string $key Use one of the constants
+     * @param string $autoload Class to autoload if component needs to be created
+     * @param array $config Configuration to use for autoload
+     * @return object|null
+     */
+    public function getComponent($key, $autoload = false, $config = null)
+    {
+        if (isset($this->_components[$key])) {
+            return $this->_components[$key];
+        } else {
+            if ($autoload == true) {
+
+                if (!isset($this->_componentTypes[$key])) {
+                    throw new Solarium_Exception('Cannot autoload unknown component: ' . $key);
+                }
+
+                $className = $this->_componentTypes[$key]['component'];
+                $component = new $className($config);
+                $this->setComponent($key, $component);
+                return $component;
+            }
+            return null;
+        }
+    }
+
+    /**
+     * Set a component instance
+     *
+     * This overwrites any existing component registered with the same key.
+     *
+     * @param string $key
+     * @param object|null $value
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function setComponent($key, $value)
+    {
+        $this->_components[$key] = $value;
+        return $this;
+    }
+
+    /**
+     * Remove a component instance
+     *
+     * You can remove a component by passing it's key or the component instance
+     *
+     * @param string|Solarium_Query_Select_Component $component
+     * @return Solarium_Query_Select Provides fluent interface
+     */
+    public function removeComponent($component)
+    {
+        if (is_object($component)) {
+            foreach ($this->_components as $key => $instance) {
+                if ($instance === $component) {
+                    unset($this->_components[$key]);
+                    break;
+                }
+            }
+        } else {
+            if (isset($this->_components[$component])) {
+                unset($this->_components[$component]);
+            }
+        }
+        return $this;
+    }
+
+
+    /**
+     * Build component instances based on config
+     *
+     * @param array $configs
+     * @return void
+     */
+    protected function _createComponents($configs)
+    {
+        foreach ($configs AS $type => $config) {
+            $this->getComponent($type, true, $config);
+        }
+    }
+
+    /**
+     * Get a MoreLikeThis component instance
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Query_Select_Component_MoreLikeThis
+     */
+    public function getMoreLikeThis()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_MORELIKETHIS, true);
+    }
+
+    /**
+     * Get a FacetSet component instance
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Query_Select_Component_FacetSet
+     */
+    public function getFacetSet()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_FACETSET, true);
+    }
+
+    /**
+     * Get a DisMax component instance
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Query_Select_Component_DisMax
+     */
+    public function getDisMax()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_DISMAX, true);
+    }
+
+    /**
+     * Get a highlighting component instance
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Query_Select_Component_Highlighting
+     */
+    public function getHighlighting()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_HIGHLIGHTING, true);
+    }
+
+    /**
+     * Get a grouping component instance
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Query_Select_Component_Grouping
+     */
+    public function getGrouping()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_GROUPING, true);
+    }
+
+    /**
+     * Get a spellcheck component instance
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Query_Select_Component_Spellcheck
+     */
+    public function getSpellcheck()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_SPELLCHECK, true);
+    }
+
+    /**
+     * Get a DistributedSearch component instance
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Query_Select_Component_DistributedSearch
+     */
+    public function getDistributedSearch()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_DISTRIBUTEDSEARCH, true);
+    }
+
+    /**
+     * Get a Stats component instance
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Query_Select_Component_Stats
+     */
+    public function getStats()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_STATS, true);
+    }
+
+    /**
+     * Get a Debug component instance
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Query_Select_Component_Debug
+     */
+    public function getDebug()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_DEBUG, true);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Update.php	(revision 7576)
@@ -0,0 +1,435 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Update query
+ *
+ * Can be used to send multiple update commands to solr, e.g. add, delete,
+ * rollback, commit, optimize.
+ * Multiple commands of any type can be combined into a single update query.
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Update extends Solarium_Query
+{
+
+    /**
+     * Update command add
+     */
+    const COMMAND_ADD = 'add';
+
+    /**
+     * Update command delete
+     */
+    const COMMAND_DELETE = 'delete';
+
+    /**
+     * Update command commit
+     */
+    const COMMAND_COMMIT = 'commit';
+
+    /**
+     * Update command rollback
+     */
+    const COMMAND_ROLLBACK = 'rollback';
+
+    /**
+     * Update command optimize
+     */
+    const COMMAND_OPTIMIZE = 'optimize';
+
+    /**
+     * Update command types
+     *
+     * @var array
+     */
+    protected $_commandTypes = array(
+        self::COMMAND_ADD => 'Solarium_Query_Update_Command_Add',
+        self::COMMAND_DELETE => 'Solarium_Query_Update_Command_Delete',
+        self::COMMAND_COMMIT => 'Solarium_Query_Update_Command_Commit',
+        self::COMMAND_OPTIMIZE => 'Solarium_Query_Update_Command_Optimize',
+        self::COMMAND_ROLLBACK => 'Solarium_Query_Update_Command_Rollback',
+    );
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'handler'       => 'update',
+        'resultclass'   => 'Solarium_Result_Update',
+        'documentclass' => 'Solarium_Document_ReadWrite',
+    );
+
+    /**
+     * Array of commands
+     *
+     * The commands will be executed in the order of this array, this can be
+     * important in some cases. For instance a rollback.
+     *
+     * @var array
+     */
+    protected $_commands = array();
+
+    /**
+     * Get type for this query
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Client::QUERYTYPE_UPDATE;
+    }
+
+    /**
+     * Initialize options
+     *
+     * Several options need some extra checks or setup work, for these options
+     * the setters are called.
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        if (isset($this->_options['command'])) {
+            foreach ($this->_options['command'] as $key => $value) {
+
+                $type = $value['type'];
+
+                if ($type == self::COMMAND_ADD) {
+                    throw new Solarium_Exception(
+                        "Adding documents is not supported in configuration, use the API for this"
+                    );
+                }
+
+                $this->add($key, $this->createCommand($type, $value));
+            }
+        }
+
+    }
+
+    /**
+     * Create a command instance
+     *
+     * @throws Solarium_Exception
+     * @param string $type
+     * @param mixed $options
+     * @return Solarium_Query_Update_Command
+     */
+    public function createCommand($type, $options = null)
+    {
+        $type = strtolower($type);
+
+        if (!isset($this->_commandTypes[$type])) {
+            throw new Solarium_Exception("Update commandtype unknown: " . $type);
+        }
+
+        $class = $this->_commandTypes[$type];
+        return new $class($options);
+    }
+
+    /**
+     * Get all commands for this update query
+     *
+     * @return array
+     */
+    public function getCommands()
+    {
+        return $this->_commands;
+    }
+
+    /**
+     * Add a command to this update query
+     *
+     * The command must be an instance of one of the Solarium_Query_Update_*
+     * classes.
+     *
+     * @param string $key
+     * @param object $command
+     * @return Solarium_Query_Update Provides fluent interface
+     */
+    public function add($key, $command)
+    {
+        if (0 !== strlen($key)) {
+            $this->_commands[$key] = $command;
+        } else {
+            $this->_commands[] = $command;
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove a command
+     *
+     * You can remove a command by passing it's key or by passing the command instance
+     *
+     * @param string|Solarium_Query_Update_Command $command
+     * @return Solarium_Query_Update Provides fluent interface
+     */
+    public function remove($command)
+    {
+        if (is_object($command)) {
+            foreach ($this->_commands as $key => $instance) {
+                if ($instance === $command) {
+                    unset($this->_commands[$key]);
+                    break;
+                }
+            }
+        } else {
+            if (isset($this->_commands[$command])) {
+                unset($this->_commands[$command]);
+            }
+        }
+
+        return $this;
+    }
+
+    /**
+     * Convenience method for adding a rollback command
+     *
+     * If you need more control, like choosing a key for the command you need to
+     * create you own command instance and use the add method.
+     *
+     * @return Solarium_Query_Update Provides fluent interface
+     */
+    public function addRollback()
+    {
+        return $this->add(null, new Solarium_Query_Update_Command_Rollback);
+    }
+
+    /**
+     * Convenience method for adding a delete query command
+     *
+     * If you need more control, like choosing a key for the command you need to
+     * create you own command instance and use the add method.
+     *
+     * @param string $query
+     * @return Solarium_Query_Update Provides fluent interface
+     */
+    public function addDeleteQuery($query)
+    {
+        $delete = new Solarium_Query_Update_Command_Delete;
+        $delete->addQuery($query);
+
+        return $this->add(null, $delete);
+    }
+
+    /**
+     * Convenience method to add a multi delete query command
+     *
+     * If you need more control, like choosing a key for the command you need to
+     * create you own command instance and use the add method.
+     *
+     * @param array $queries
+     * @return Solarium_Query_Update Provides fluent interface
+     */
+    public function addDeleteQueries($queries)
+    {
+        $delete = new Solarium_Query_Update_Command_Delete;
+        $delete->addQueries($queries);
+
+        return $this->add(null, $delete);
+    }
+
+    /**
+     * Convenience method to add a delete by ID command
+     *
+     * If you need more control, like choosing a key for the command you need to
+     * create you own command instance and use the add method.
+     *
+     * @param int|string $id
+     * @return Solarium_Query_Update Provides fluent interface
+     */
+    public function addDeleteById($id)
+    {
+        $delete = new Solarium_Query_Update_Command_Delete;
+        $delete->addId($id);
+
+        return $this->add(null, $delete);
+    }
+
+    /**
+     * Convenience method to add a delete by IDs command
+     *
+     * If you need more control, like choosing a key for the command you need to
+     * create you own command instance and use the add method.
+     *
+     * @param array $ids
+     * @return Solarium_Query_Update Provides fluent interface
+     */
+    public function addDeleteByIds($ids)
+    {
+        $delete = new Solarium_Query_Update_Command_Delete;
+        $delete->addIds($ids);
+
+        return $this->add(null, $delete);
+    }
+
+    /**
+     * Convenience method to add a 'add document' command
+     *
+     * If you need more control, like choosing a key for the command you need to
+     * create you own command instance and use the add method.
+     *
+     * @param Solarium_Document_ReadWrite $document
+     * @param boolean $overwrite
+     * @param int $commitWithin
+     * @return Solarium_Query_Update Provides fluent interface
+     */
+    public function addDocument($document, $overwrite = null,
+                                $commitWithin = null)
+    {
+        return $this->addDocuments(array($document), $overwrite, $commitWithin);
+    }
+
+    /**
+     * Convenience method to add a 'add documents' command
+     *
+     * If you need more control, like choosing a key for the command you need to
+     * create you own command instance and use the add method.
+     *
+     * @param array $documents
+     * @param boolean $overwrite
+     * @param int $commitWithin
+     * @return Solarium_Query_Update Provides fluent interface
+     */
+    public function addDocuments($documents, $overwrite = null,
+                                 $commitWithin = null)
+    {
+        $add = new Solarium_Query_Update_Command_Add;
+        if (null !== $overwrite) $add->setOverwrite($overwrite);
+        if (null !== $commitWithin) $add->setCommitWithin($commitWithin);
+
+        $add->addDocuments($documents);
+        return $this->add(null, $add);
+    }
+
+    /**
+     * Convenience method to add a commit command
+     *
+     * If you need more control, like choosing a key for the command you need to
+     * create you own command instance and use the add method.
+     *
+     * @param boolean $waitFlush
+     * @param boolean $waitSearcher
+     * @param boolean $expungeDeletes
+     * @return Solarium_Query_Update Provides fluent interface
+     */
+    public function addCommit($waitFlush = null, $waitSearcher = null,
+                              $expungeDeletes = null)
+    {
+        $commit = new Solarium_Query_Update_Command_Commit();
+        if (null !== $waitFlush) $commit->setWaitFlush($waitFlush);
+        if (null !== $waitSearcher) $commit->setWaitSearcher($waitSearcher);
+        if (null !== $expungeDeletes)
+            $commit->setExpungeDeletes($expungeDeletes);
+
+        return $this->add(null, $commit);
+    }
+
+    /**
+     * Convenience method to add an optimize command
+     *
+     * If you need more control, like choosing a key for the command you need to
+     * create you own command instance and use the add method.
+     *
+     * @param boolean $waitFlush
+     * @param boolean $waitSearcher
+     * @param int $maxSegments
+     * @return Solarium_Query_Update Provides fluent interface
+     */
+   public function addOptimize($waitFlush = null, $waitSearcher = null,
+                               $maxSegments = null)
+   {
+       $optimize = new Solarium_Query_Update_Command_Optimize();
+       if (null !== $waitFlush) $optimize->setWaitFlush($waitFlush);
+       if (null !== $waitSearcher) $optimize->setWaitSearcher($waitSearcher);
+       if (null !== $maxSegments) $optimize->setMaxSegments($maxSegments);
+
+       return $this->add(null, $optimize);
+   }
+
+   /**
+    * Set a custom document class for use in the createDocument method
+    *
+    * This class should extend Solarium_Document_ReadWrite or
+    * at least be compatible with it's interface
+    *
+    * @param string $value classname
+    * @return Solarium_Query
+    */
+    public function setDocumentClass($value)
+    {
+        return $this->_setOption('documentclass', $value);
+    }
+
+    /**
+     * Get the current documentclass option
+     *
+     * The value is a classname, not an instance
+     *
+     * @return string
+     */
+    public function getDocumentClass()
+    {
+        return $this->getOption('documentclass');
+    }
+
+    /**
+     * Create a document object instance
+     *
+     * You can optionally directly supply the fields and boosts
+     * to get a ready-made document instance for direct use in an add command
+     *
+     * @since 2.1.0
+     *
+     * @param array $fields
+     * @param array $boosts
+     * @return Solarium_Document_ReadWrite
+     */
+    public function createDocument($fields = array(), $boosts = array())
+    {
+        $class = $this->getDocumentClass();
+
+        return new $class($fields, $boosts);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Analysis.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Analysis.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Analysis.php	(revision 7576)
@@ -0,0 +1,97 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Base class for Analysis queries
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+abstract class Solarium_Query_Analysis extends Solarium_Query
+{
+
+    /**
+     * Set the query string
+     *
+     * When present, the text that will be analyzed. The analysis will mimic the query-time analysis.
+     *
+     * @param string $query
+     * @param array $bind Optional bind values for placeholders in the query string
+     * @return Solarium_Query_Analysis Provides fluent interface
+     */
+    public function setQuery($query, $bind = null)
+    {
+        if (!is_null($bind)) {
+            $query = $this->getHelper()->assemble($query, $bind);
+        }
+
+        return $this->_setOption('query', trim($query));
+    }
+
+    /**
+     * Get the query string
+     *
+     * @return string
+     */
+    public function getQuery()
+    {
+        return $this->getOption('query');
+    }
+
+    /**
+     * Set the showmatch option
+     *
+     * @param boolean $show
+     * @return Solarium_Query_Analysis Provides fluent interface
+     */
+    public function setShowMatch($show)
+    {
+        return $this->_setOption('showmatch', $show);
+    }
+
+    /**
+     * Get the showmatch option
+     *
+     * @return mixed
+     */
+    public function getShowMatch()
+    {
+        return $this->getOption('showmatch');
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Suggester.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Suggester.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query/Suggester.php	(revision 7576)
@@ -0,0 +1,185 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Suggester Query
+ *
+ * Can be used for an autocomplete feature. See http://wiki.apache.org/solr/Suggester for more info.
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+class Solarium_Query_Suggester extends Solarium_Query
+{
+
+    /**
+     * Get type for this query
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return Solarium_Client::QUERYTYPE_SUGGESTER;
+    }
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'handler'       => 'suggest',
+        'resultclass'   => 'Solarium_Result_Suggester',
+        'termclass'     => 'Solarium_Result_Suggester_Term',
+    );
+
+    /**
+     * Set query option
+     *
+     * Query to spellcheck
+     *
+     * @param string $query
+     * @return self Provides fluent interface
+     */
+    public function setQuery($query)
+    {
+        return $this->_setOption('query', $query);
+    }
+
+    /**
+     * Get query option
+     *
+     * @return string|null
+     */
+    public function getQuery()
+    {
+        return $this->getOption('query');
+    }
+
+    /**
+     * Set dictionary option
+     *
+     * The name of the dictionary to use
+     *
+     * @param string $dictionary
+     * @return self Provides fluent interface
+     */
+    public function setDictionary($dictionary)
+    {
+        return $this->_setOption('dictionary', $dictionary);
+    }
+
+    /**
+     * Get dictionary option
+     *
+     * @return string|null
+     */
+    public function getDictionary()
+    {
+        return $this->getOption('dictionary');
+    }
+
+    /**
+     * Set count option
+     *
+     * The maximum number of suggestions to return
+     *
+     * @param int $count
+     * @return self Provides fluent interface
+     */
+    public function setCount($count)
+    {
+        return $this->_setOption('count', $count);
+    }
+
+    /**
+     * Get count option
+     *
+     * @return int|null
+     */
+    public function getCount()
+    {
+        return $this->getOption('count');
+    }
+
+    /**
+     * Set onlyMorePopular option
+     *
+     * Only return suggestions that result in more hits for the query than the existing query
+     *
+     * @param boolean $onlyMorePopular
+     * @return self Provides fluent interface
+     */
+    public function setOnlyMorePopular($onlyMorePopular)
+    {
+        return $this->_setOption('onlymorepopular', $onlyMorePopular);
+    }
+
+    /**
+     * Get onlyMorePopular option
+     *
+     * @return boolean|null
+     */
+    public function getOnlyMorePopular()
+    {
+        return $this->getOption('onlymorepopular');
+    }
+
+    /**
+     * Set collate option
+     *
+     * @param boolean $collate
+     * @return self Provides fluent interface
+     */
+    public function setCollate($collate)
+    {
+        return $this->_setOption('collate', $collate);
+    }
+
+    /**
+     * Get collate option
+     *
+     * @return boolean|null
+     */
+    public function getCollate()
+    {
+        return $this->getOption('collate');
+    }
+
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Configurable.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Configurable.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Configurable.php	(revision 7576)
@@ -0,0 +1,178 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * Base class for configurable classes
+ *
+ * All classes extending this class are  configurable using the constructor or
+ * setOption calls. This is the base for many Solarium classes, providing a
+ * uniform interface for various models.
+ *
+ * @package Solarium
+ */
+class Solarium_Configurable
+{
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+    );
+
+    /**
+     * Constructor
+     *
+     * If options are passed they will be merged with {@link $_options} using
+     * the {@link setOptions()} method.
+     *
+     * After handling the options the {@link _init()} method is called.
+     *
+     * @throws Solarium_Exception
+     * @param array|Zend_Config $options
+     * @return void
+     */
+    public function __construct($options = null)
+    {
+        if (null !== $options) {
+            $this->setOptions($options);
+        } else {
+            $this->_init();
+        }
+    }
+
+    /**
+     * Set options
+     *
+     * If $options is an object it will be converted into an array by called
+     * it's toArray method. This is compatible with the Zend_Config classes in
+     * Zend Framework, but can also easily be implemented in any other object.
+     *
+     * @throws Solarium_Exception
+     * @param array|Zend_Config $options
+     * @param boolean $overwrite True for overwriting existing options, false
+     *  for merging (new values overwrite old ones if needed)
+     *
+     * @return void
+     */
+    public function setOptions($options, $overwrite = false)
+    {
+        if (null !== $options) {
+            // first convert to array if needed
+            if (!is_array($options)) {
+                if (is_object($options)) {
+                    $options = $options->toArray();
+                } else {
+                    throw new Solarium_Exception('Options must be an array or a Zend_Config object');
+                }
+            }
+
+            if (true == $overwrite) {
+                $this->_options = $options;
+            } else {
+                $this->_options = array_merge($this->_options, $options);
+            }
+
+            // re-init for new options
+            $this->_init();
+        }
+    }
+
+    /**
+     * Initialization hook
+     *
+     * Can be used by classes for special behaviour. For instance some options
+     * have extra setup work in their 'set' method that also need to be called
+     * when the option is passed as a constructor argument.
+     *
+     * This hook is called by the constructor after saving the constructor
+     * arguments in {@link $_options}
+     *
+     * @internal This empty implementation can optionally be implemented in
+     *  descending classes. It's not an abstract method on purpose, there are
+     *  many cases where no initialization is needed.
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+
+    }
+
+    /**
+     * Set an option
+     *
+     * @param string $name
+     * @param mixed $value
+     * @return Solarium_Configurable
+     */
+    protected function _setOption($name, $value)
+    {
+        $this->_options[$name] = $value;
+
+        return $this;
+    }
+
+    /**
+     * Get an option value by name
+     *
+     * If the option is empty or not set a NULL value will be returned.
+     *
+     * @param string $name
+     * @return mixed
+     */
+    public function getOption($name)
+    {
+        if (isset($this->_options[$name])) {
+            return $this->_options[$name];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all options
+     *
+     * @return array
+     */
+    public function getOptions()
+    {
+        return $this->_options;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Query.php	(revision 7576)
@@ -0,0 +1,160 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+
+/**
+ * Base class for all query types, not intended for direct usage
+ *
+ * @package Solarium
+ * @subpackage Query
+ */
+abstract class Solarium_Query extends Solarium_Configurable
+{
+
+    /**
+     * Helper instance
+     *
+     * @var Solarium_Query_Helper
+     */
+    protected $_helper;
+
+    /**
+     * Extra query params (e.g. dereferenced params)
+     *
+     * @var array
+     */
+    protected $_params = array();
+
+    /**
+     * Get type for this query
+     *
+     * @return string
+     */
+    abstract public function getType();
+
+    /**
+     * Set handler option
+     *
+     * @param string $handler
+     * @return Solarium_Query Provides fluent interface
+     */
+    public function setHandler($handler)
+    {
+        return $this->_setOption('handler', $handler);
+    }
+
+    /**
+     * Get handler option
+     *
+     * @return string
+     */
+    public function getHandler()
+    {
+        return $this->getOption('handler');
+    }
+
+    /**
+     * Set resultclass option
+     *
+     * If you set a custom result class it must be available through autoloading
+     * or a manual require before calling this method. This is your
+     * responsibility.
+     *
+     * Also you need to make sure it extends the orginal result class of the
+     * query or has an identical API.
+     *
+     * @param string $classname
+     * @return Solarium_Query Provides fluent interface
+     */
+    public function setResultClass($classname)
+    {
+        return $this->_setOption('resultclass', $classname);
+    }
+
+    /**
+     * Get resultclass option
+     *
+     * @return string
+     */
+    public function getResultClass()
+    {
+        return $this->getOption('resultclass');
+    }
+
+    /**
+     * Get a helper instance
+     *
+     * Uses lazy loading: the helper is instantiated on first use
+     *
+     * @return Solarium_Query_Helper
+     */
+    public function getHelper()
+    {
+        if (null === $this->_helper) {
+            $this->_helper = new Solarium_Query_Helper($this);
+        }
+
+        return $this->_helper;
+    }
+
+    /**
+     * Add extra params to the request
+     *
+     * Only intended for internal use, for instance with dereferenced params.
+     * Therefore the params are limited in functionality. Only add and get
+     *
+     * @param string $name
+     * @param string $value
+     * @return self Provides fluent interface
+     */
+    public function addParam($name, $value)
+    {
+        $this->_params[$name] = $value;
+        return $this;
+    }
+
+    /**
+     * Get extra params
+     *
+     * @return array
+     */
+    public function getParams()
+    {
+        return $this->_params;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Version.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Version.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Version.php	(revision 7576)
@@ -0,0 +1,136 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * Version indicator
+ *
+ * This class can be used to check the library version within your code. This
+ * can be important if you rely on a minimal version for the features you use.
+ *
+ * @package Solarium
+ */
+class Solarium_Version
+{
+
+    /**
+     * Version number of the Solarium library
+     *
+     * The version is built up in this format: major.minor.mini
+     *
+     * A major release is used for significant release with architectural
+     * changes and changes that might break backwards compatibility
+     *
+     * A minor release adds and enhances features, and might also contain
+     * bugfixes. It should be backwards compatible, or the incompatibilities
+     * should be clearly documented with the release.
+     *
+     * A mini release only contains bugfixes to existing features and is always
+     * backwards compatible.
+     *
+     * If you develop your application to a specific Solarium version it is best
+     * to check for that exact major and minor version, leaving the mini version
+     * open to allow for upgrades in case of bugfixes.
+     *
+     * @see checkExact()
+     * @see checkMinimal()
+     *
+     * @var string
+     */
+    const VERSION = '2.4.0';
+
+
+    /**
+     * Check for an exact version
+     *
+     * This method can check for all three versioning levels, but they are
+     * optional. If you only care for major and minor versions you can use
+     * something like '1.0' as input. Or '1' if you only want to check a major
+     * version.
+     *
+     * For each level that is checked the input has to be exactly the same as
+     * the actual version. Some examples:
+     *
+     * The if the version is 1.2.3 the following checks would return true:
+     * - 1 (only major version is checked)
+     * - 1.2 (only major and minor version are checked)
+     * - 1.2.3 (full version is checked)
+     *
+     * These values will return false:
+     * - 1.0 (lower)
+     * - 1.2.4 (higher)
+     *
+     *
+     * @internal a string compare is used instead of version_compare because
+     *  version_compare returns false for a compare of 1.0.0 with 1.0
+     *
+     * @param string $version
+     * @return boolean
+     */
+    static public function checkExact($version)
+    {
+        return (substr(self::VERSION, 0, strlen($version)) == $version);
+    }
+
+
+    /**
+     * Check for a minimal version
+     *
+     * This method can check for all three versioning levels, but they are
+     * optional. If you only care for major and minor versions you can use
+     * something like '1.0' as input. Or '1' if you only want to check a major
+     * version.
+     *
+     * For each level that is checked the actual value needs to be the same or
+     * higher. Some examples:
+     *
+     * The if the version is 1.2.3 the following checks would return true:
+     * - 1.2.3 (the same)
+     * - 1 (the actual version is higher)
+     *
+     * These values will return false:
+     * - 2 (the actual version is lower)
+     * - 1.3 (the actual version is lower)
+     *
+     * @param string $version
+     * @return boolean
+     */
+    static public function checkMinimal($version)
+    {
+        return version_compare(self::VERSION, $version, '>=');
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Grouping.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Grouping.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Grouping.php	(revision 7576)
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Add select component Grouping to the request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Select_Component_Grouping
+{
+
+    /**
+     * Add request settings for Grouping
+     *
+     * @param Solarium_Query_Select_Component_Grouping $component
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Request
+     */
+    public function buildComponent($component, $request)
+    {
+        // enable grouping
+        $request->addParam('group', 'true');
+
+        $request->addParam('group.field', $component->getFields());
+        $request->addParam('group.query', $component->getQueries());
+        $request->addParam('group.limit', $component->getLimit());
+        $request->addParam('group.offset', $component->getOffset());
+        $request->addParam('group.sort', $component->getSort());
+        $request->addParam('group.main', $component->getMainResult());
+        $request->addParam('group.ngroups', $component->getNumberOfGroups());
+        $request->addParam('group.cache.percent', $component->getCachePercentage());
+        $request->addParam('group.truncate', $component->getTruncate());
+
+        return $request;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Spellcheck.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Spellcheck.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Spellcheck.php	(revision 7576)
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Add select component Spellcheck to the request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Select_Component_Spellcheck
+{
+
+    /**
+     * Add request settings for Spellcheck
+     *
+     * @param Solarium_Query_Select_Component_Spellcheck $component
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Request
+     */
+    public function buildComponent($component, $request)
+    {
+        // enable spellcheck
+        $request->addParam('spellcheck', 'true');
+
+        $request->addParam('spellcheck.q', $component->getQuery());
+        $request->addParam('spellcheck.build', $component->getBuild());
+        $request->addParam('spellcheck.reload', $component->getReload());
+        $request->addParam('spellcheck.dictionary', $component->getDictionary());
+        $request->addParam('spellcheck.count', $component->getCount());
+        $request->addParam('spellcheck.onlyMorePopular', $component->getOnlyMorePopular());
+        $request->addParam('spellcheck.extendedResults', $component->getExtendedResults());
+        $request->addParam('spellcheck.collate', $component->getCollate());
+        $request->addParam('spellcheck.maxCollations', $component->getMaxCollations());
+        $request->addParam('spellcheck.maxCollationTries', $component->getMaxCollationTries());
+        $request->addParam('spellcheck.maxCollationEvaluations', $component->getMaxCollationEvaluations());
+        $request->addParam('spellcheck.collateExtendedResults', $component->getCollateExtendedResults());
+        $request->addParam('spellcheck.accuracy', $component->getAccuracy());
+
+        return $request;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/FacetSet.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/FacetSet.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/FacetSet.php	(revision 7576)
@@ -0,0 +1,192 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Add select component FacetSet to the request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Select_Component_FacetSet extends Solarium_Client_RequestBuilder
+{
+
+    /**
+     * Add request settings for FacetSet
+     *
+     * @param Solarium_Query_Select_Component_FacetSet $component
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Request
+     */
+    public function buildComponent($component, $request)
+    {
+        $facets = $component->getFacets();
+        if (count($facets) !== 0) {
+
+            // enable faceting
+            $request->addParam('facet', 'true');
+
+            // global facet params
+            $request->addParam('facet.sort', $component->getSort());
+            $request->addParam('facet.prefix', $component->getPrefix());
+            $request->addParam('facet.missing', $component->getMissing());
+            $request->addParam('facet.mincount', $component->getMinCount());
+            $request->addParam('facet.limit', $component->getLimit());
+
+            foreach ($facets AS $facet) {
+                switch ($facet->getType())
+                {
+                    case Solarium_Query_Select_Component_FacetSet::FACET_FIELD:
+                        $this->addFacetField($request, $facet);
+                        break;
+                    case Solarium_Query_Select_Component_FacetSet::FACET_QUERY:
+                        $this->addFacetQuery($request, $facet);
+                        break;
+                    case Solarium_Query_Select_Component_FacetSet::FACET_MULTIQUERY:
+                        $this->addFacetMultiQuery($request, $facet);
+                        break;
+                    case Solarium_Query_Select_Component_FacetSet::FACET_RANGE:
+                        $this->addFacetRange($request, $facet);
+                        break;
+                    default:
+                        throw new Solarium_Exception('Unknown facet type');
+                }
+            }
+        }
+
+        return $request;
+    }
+
+    /**
+     * Add params for a field facet to request
+     *
+     * @param Solarium_Client_Request $request
+     * @param Solarium_Query_Select_Component_Facet_Field $facet
+     * @return void
+     */
+    public function addFacetField($request, $facet)
+    {
+        $field = $facet->getField();
+
+        $request->addParam(
+            'facet.field',
+            $this->renderLocalParams(
+                $field,
+                array('key' => $facet->getKey(), 'ex' => $facet->getExcludes())
+            )
+        );
+
+        $request->addParam("f.$field.facet.limit", $facet->getLimit());
+        $request->addParam("f.$field.facet.sort", $facet->getSort());
+        $request->addParam("f.$field.facet.prefix", $facet->getPrefix());
+        $request->addParam("f.$field.facet.offset", $facet->getOffset());
+        $request->addParam("f.$field.facet.mincount", $facet->getMinCount());
+        $request->addParam("f.$field.facet.missing", $facet->getMissing());
+        $request->addParam("f.$field.facet.method", $facet->getMethod());
+    }
+
+    /**
+     * Add params for a facet query to request
+     *
+     * @param Solarium_Client_Request $request
+     * @param Solarium_Query_Select_Component_Facet_Query $facet
+     * @return void
+     */
+    public function addFacetQuery($request, $facet)
+    {
+        $request->addParam(
+            'facet.query',
+            $this->renderLocalParams(
+                $facet->getQuery(),
+                array('key' => $facet->getKey(), 'ex' => $facet->getExcludes())
+            )
+        );
+    }
+
+    /**
+     * Add params for a multiquery facet to request
+     *
+     * @param Solarium_Client_Request $request
+     * @param Solarium_Query_Select_Component_Facet_MultiQuery $facet
+     * @return void
+     */
+    public function addFacetMultiQuery($request, $facet)
+    {
+        foreach ($facet->getQueries() AS $facetQuery) {
+            $this->addFacetQuery($request, $facetQuery);
+        }
+    }
+
+    /**
+     * Add params for a range facet to request
+     *
+     * @param Solarium_Client_Request $request
+     * @param Solarium_Query_Select_Component_Facet_Range $facet
+     * @return void
+     */
+    public function addFacetRange($request, $facet)
+    {
+        $field = $facet->getField();
+
+        $request->addParam(
+            'facet.range',
+            $this->renderLocalParams(
+                $field,
+                array('key' => $facet->getKey(), 'ex' => $facet->getExcludes())
+            )
+        );
+
+        $request->addParam("f.$field.facet.range.start", $facet->getStart());
+        $request->addParam("f.$field.facet.range.end", $facet->getEnd());
+        $request->addParam("f.$field.facet.range.gap", $facet->getGap());
+        $request->addParam("f.$field.facet.range.hardend", $facet->getHardend());
+
+        if (null !== $facet->getOther()) {
+            $other = explode(',', $facet->getOther());
+            foreach ($other AS $otherValue) {
+                $request->addParam("f.$field.facet.range.other", trim($otherValue));
+            }
+        }
+
+        if (null !== $facet->getOther()) {
+            $include = explode(',', $facet->getInclude());
+            foreach ($include AS $includeValue) {
+                $request->addParam("f.$field.facet.range.include", trim($includeValue));
+            }
+        }
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Stats.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Stats.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Stats.php	(revision 7576)
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Add select component stats to the request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Select_Component_Stats
+{
+
+    /**
+     * Add request settings for the stats component
+     *
+     * @param Solarium_Query_Select_Component_Stats $component
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Request
+     */
+    public function buildComponent($component, $request)
+    {
+        // enable stats
+        $request->addParam('stats', 'true');
+
+        // add fields
+        foreach ($component->getFields() as $field) {
+
+            $request->addParam('stats.field', $field->getKey());
+
+            // add field specific facet stats
+            foreach ($field->getFacets() as $facet) {
+                $request->addParam('f.'.$field->getKey().'.stats.facet', $facet);
+            }
+        }
+
+        // add facet stats for all fields
+        foreach ($component->getFacets() as $facet) {
+            $request->addParam('stats.facet', $facet);
+        }
+
+        return $request;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/MoreLikeThis.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/MoreLikeThis.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/MoreLikeThis.php	(revision 7576)
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Add select component morelikethis to the request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Select_Component_MoreLikeThis
+{
+
+    /**
+     * Add request settings for morelikethis
+     *
+     * @param Solarium_Query_Select_Component_MoreLikeThis $component
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Request
+     */
+    public function buildComponent($component, $request)
+    {
+        // enable morelikethis
+        $request->addParam('mlt', 'true');
+
+        $request->addParam('mlt.fl', $component->getFields());
+        $request->addParam('mlt.mintf', $component->getMinimumTermFrequency());
+        $request->addParam('mlt.mindf', $component->getMinimumDocumentFrequency());
+        $request->addParam('mlt.minwl', $component->getMinimumWordLength());
+        $request->addParam('mlt.maxwl', $component->getMaximumWordLength());
+        $request->addParam('mlt.maxqt', $component->getMaximumQueryTerms());
+        $request->addParam('mlt.maxntp', $component->getMaximumNumberOfTokens());
+        $request->addParam('mlt.boost', $component->getBoost());
+        $request->addParam('mlt.qf', $component->getQueryFields());
+        $request->addParam('mlt.count', $component->getCount());
+
+        return $request;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/DisMax.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/DisMax.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/DisMax.php	(revision 7576)
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Add select component dismax to the request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Select_Component_DisMax
+{
+
+    /**
+     * Add request settings for Dismax
+     *
+     * @param Solarium_Query_Select_Component_Dismax $component
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Request
+     */
+    public function buildComponent($component, $request)
+    {
+        // enable dismax
+        $request->addParam('defType', $component->getQueryParser());
+
+        $request->addParam('q.alt', $component->getQueryAlternative());
+        $request->addParam('qf', $component->getQueryFields());
+        $request->addParam('mm', $component->getMinimumMatch());
+        $request->addParam('pf', $component->getPhraseFields());
+        $request->addParam('ps', $component->getPhraseSlop());
+        $request->addParam('qs', $component->getQueryPhraseSlop());
+        $request->addParam('tie', $component->getTie());
+        $request->addParam('bq', $component->getBoostQuery());
+        $request->addParam('bf', $component->getBoostFunctions());
+
+        return $request;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Highlighting.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Highlighting.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Highlighting.php	(revision 7576)
@@ -0,0 +1,115 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Add select component Highlighting to the request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Select_Component_Highlighting
+{
+
+    /**
+     * Add request settings for Highlighting
+     *
+     * @param Solarium_Query_Select_Component_Highlighting $component
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Request
+     */
+    public function buildComponent(
+        Solarium_Query_Select_Component_Highlighting $component,
+        Solarium_Client_Request $request)
+    {
+        // enable highlighting
+        $request->addParam('hl', 'true');
+
+        // set global highlighting params
+        $request->addParam('hl.fl', implode(',', array_keys($component->getFields())));
+        $request->addParam('hl.snippets', $component->getSnippets());
+        $request->addParam('hl.fragsize', $component->getFragSize());
+        $request->addParam('hl.mergeContiguous', $component->getMergeContiguous());
+        $request->addParam('hl.requireFieldMatch', $component->getRequireFieldMatch());
+        $request->addParam('hl.maxAnalyzedChars', $component->getMaxAnalyzedChars());
+        $request->addParam('hl.alternateField', $component->getAlternateField());
+        $request->addParam('hl.maxAlternateFieldLength', $component->getMaxAlternateFieldLength());
+        $request->addParam('hl.formatter', $component->getFormatter());
+        $request->addParam('hl.simple.pre', $component->getSimplePrefix());
+        $request->addParam('hl.simple.post', $component->getSimplePostfix());
+        $request->addParam('hl.fragmenter', $component->getFragmenter());
+        $request->addParam('hl.fragListBuilder', $component->getFragListBuilder());
+        $request->addParam('hl.fragmentsBuilder', $component->getFragmentsBuilder());
+        $request->addParam('hl.useFastVectorHighlighter', $component->getUseFastVectorHighlighter());
+        $request->addParam('hl.usePhraseHighlighter', $component->getUsePhraseHighlighter());
+        $request->addParam('hl.highlightMultiTerm', $component->getHighlightMultiTerm());
+        $request->addParam('hl.regex.slop', $component->getRegexSlop());
+        $request->addParam('hl.regex.pattern', $component->getRegexPattern());
+        $request->addParam('hl.regex.maxAnalyzedChars', $component->getRegexMaxAnalyzedChars());
+        $request->addParam('hl.q', $component->getQuery());
+        $request->addParam('hl.phraseLimit', $component->getPhraseLimit());
+
+        // set per-field highlighting params
+        foreach ($component->getFields() as $field) {
+            $this->_addFieldParams($field, $request);
+        }
+
+        return $request;
+    }
+
+    /**
+     * Add per-field override options to the request
+     *
+     * @param Solarium_Query_Select_Component_Highlighting_Field $field
+     * @param Solarium_Client_Request $request
+     * @return void
+     */
+    protected function _addFieldParams($field, $request)
+    {
+        $prefix = 'f.' . $field->getName() . '.hl.';
+        $request->addParam($prefix.'snippets', $field->getSnippets());
+        $request->addParam($prefix.'fragsize', $field->getFragSize());
+        $request->addParam($prefix.'mergeContiguous', $field->getMergeContiguous());
+        $request->addParam($prefix.'alternateField', $field->getAlternateField());
+        $request->addParam($prefix.'formatter', $field->getFormatter());
+        $request->addParam($prefix.'simple.pre', $field->getSimplePrefix());
+        $request->addParam($prefix.'simple.post', $field->getSimplePostfix());
+        $request->addParam($prefix.'fragmenter', $field->getFragmenter());
+        $request->addParam($prefix.'useFastVectorHighlighter', $field->getUseFastVectorHighlighter());
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Debug.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Debug.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/Debug.php	(revision 7576)
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Add select component debug to the request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Select_Component_Debug
+{
+
+    /**
+     * Add request settings for the debug component
+     *
+     * @param Solarium_Query_Select_Component_Debug $component
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Request
+     */
+    public function buildComponent($component, $request)
+    {
+        $request->addParam('debugQuery', 'true');
+        $request->addParam('debug.explain.structured', 'true');
+        $request->addParam('explainOther', $component->getExplainOther());
+
+        return $request;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/DistributedSearch.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/DistributedSearch.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select/Component/DistributedSearch.php	(revision 7576)
@@ -0,0 +1,66 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Add select component distributedsearch to the request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Select_Component_DistributedSearch
+{
+
+    /**
+     * Add request settings for DistributedSearch
+     *
+     * @param Solarium_Query_Select_Component_DistributedSearch $component
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Request
+     */
+    public function buildComponent($component, $request)
+    {
+        // add shard fields to request
+        $shards = array_values($component->getShards());
+        if (count($shards)) {
+            $request->addParam('shards', implode(',', $shards));
+        }
+        $request->addParam('shards.qt', $component->getShardRequestHandler());
+
+        return $request;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Terms.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Terms.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Terms.php	(revision 7576)
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer.
+ * Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @copyright Copyright 2011 Gasol Wu <gasol.wu@gmail.com>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Build a Terms query request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Terms extends Solarium_Client_RequestBuilder
+{
+
+    /**
+     * Build request for a Terms query
+     *
+     * @param Solarium_Query_Terms $query
+     * @return Solarium_Client_Request
+     */
+    public function build($query)
+    {
+        $request = parent::build($query);
+        $request->addParam('terms', true);
+        $request->addParam('terms.lower', $query->getLowerbound());
+        $request->addParam('terms.lower.incl', $query->getLowerboundInclude());
+        $request->addParam('terms.mincount', $query->getMinCount());
+        $request->addParam('terms.maxcount', $query->getMaxCount());
+        $request->addParam('terms.prefix', $query->getPrefix());
+        $request->addParam('terms.regex', $query->getRegex());
+        $request->addParam('terms.limit', $query->getLimit());
+        $request->addParam('terms.upper', $query->getUpperbound());
+        $request->addParam('terms.upper.incl', $query->getUpperboundInclude());
+        $request->addParam('terms.raw', $query->getRaw());
+        $request->addParam('terms.sort', $query->getSort());
+
+        $fields = explode(',', $query->getFields());
+        foreach ($fields as $field) {
+            $request->addParam('terms.fl', trim($field));
+        }
+
+        if ($query->getRegexFlags() !== null) {
+            $flags = explode(',', $query->getRegexFlags());
+            foreach ($flags as $flag) {
+                $request->addParam('terms.regex.flag', trim($flag));
+            }
+        }
+
+        return $request;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Analysis/Document.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Analysis/Document.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Analysis/Document.php	(revision 7576)
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Build a document analysis request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Analysis_Document extends Solarium_Client_RequestBuilder_Analysis
+{
+
+    /**
+     * Build request for an analysis document query
+     *
+     * @param Solarium_Query_Analysis_Document $query
+     * @return Solarium_Client_Request
+     */
+    public function build($query)
+    {
+        $request = parent::build($query);
+        $request->setRawData($this->getRawData($query));
+        $request->setMethod(Solarium_Client_Request::METHOD_POST);
+        
+        return $request;
+    }
+
+    /**
+     * Create the raw post data (xml)
+     *
+     * @param Solarium_Query_Analysis_Document $query
+     * @return string
+     */
+    public function getRawData($query)
+    {
+        $xml = '<docs>';
+
+        foreach ($query->getDocuments() AS $doc) {
+            $xml .= '<doc>';
+
+            foreach ($doc->getFields() AS $name => $value) {
+                if (is_array($value)) {
+                    foreach ($value AS $multival) {
+                        $xml .= $this->_buildFieldXml($name, $multival);
+                    }
+                } else {
+                    $xml .= $this->_buildFieldXml($name, $value);
+                }
+            }
+
+            $xml .= '</doc>';
+        }
+
+        $xml .= '</docs>';
+        
+        return $xml;
+    }
+
+    /**
+     * Build XML for a field
+     *
+     * @param string $name
+     * @param mixed $value
+     * @return string
+     */
+    protected function _buildFieldXml($name, $value)
+    {
+        return '<field name="' . $name . '">' . htmlspecialchars($value, ENT_NOQUOTES, 'UTF-8') . '</field>';
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Analysis/Field.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Analysis/Field.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Analysis/Field.php	(revision 7576)
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Build a field analysis request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Analysis_Field extends Solarium_Client_RequestBuilder_Analysis
+{
+
+    /**
+     * Build request for an analysis field query
+     *
+     * @param Solarium_Query_Analysis_Field $query
+     * @return Solarium_Client_Request
+     */
+    public function build($query)
+    {
+        $request = parent::build($query);
+
+        $request->addParam('analysis.fieldvalue', $query->getFieldValue());
+        $request->addParam('analysis.fieldname', $query->getFieldName());
+        $request->addParam('analysis.fieldtype', $query->getFieldType());
+
+        return $request;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Ping.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Ping.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Ping.php	(revision 7576)
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Build a ping request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Ping extends Solarium_Client_RequestBuilder
+{
+
+    /**
+     * Build request for a ping query
+     *
+     * @param Solarium_Query_Ping $query
+     * @return Solarium_Client_Request
+     */
+    public function build($query)
+    {
+        $request = parent::build($query);
+        $request->setMethod(Solarium_Client_Request::METHOD_GET);
+
+        return $request;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/MoreLikeThis.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/MoreLikeThis.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/MoreLikeThis.php	(revision 7576)
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer.
+ * Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @copyright Copyright 2011 Gasol Wu <gasol.wu@gmail.com>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Build a MoreLikeThis request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_MoreLikeThis
+    extends Solarium_Client_RequestBuilder_Select
+{
+
+    /**
+     * Build request for a MoreLikeThis query
+     *
+     * @param Solarium_Query_MoreLikeThis $query
+     * @return Solarium_Client_Request
+     */
+    public function build($query)
+    {
+        $request = parent::build($query);
+        
+        // add mlt params to request
+        $request->addParam('mlt.interestingTerms', $query->getInterestingTerms());
+        $request->addParam('mlt.match.include', $query->getMatchInclude());
+        $request->addParam('mlt.match.offset', $query->getStart());
+        $request->addParam('mlt.fl', $query->getMltFields());
+        $request->addParam('mlt.mintf', $query->getMinimumTermFrequency());
+        $request->addParam('mlt.mindf', $query->getMinimumDocumentFrequency());
+        $request->addParam('mlt.minwl', $query->getMinimumWordLength());
+        $request->addParam('mlt.maxwl', $query->getMaximumWordLength());
+        $request->addParam('mlt.maxqt', $query->getMaximumQueryTerms());
+        $request->addParam('mlt.maxntp', $query->getMaximumNumberOfTokens());
+        $request->addParam('mlt.boost', $query->getBoost());
+        $request->addParam('mlt.qf', $query->getQueryFields());
+
+        // convert query to stream if necessary
+        if (true === $query->getQueryStream()) {
+            $request->removeParam('q');
+            $request->setRawData($query->getQuery());
+            $request->setMethod(Solarium_Client_Request::METHOD_POST);
+            $request->addHeader('Content-Type: text/plain; charset=utf-8');
+        }
+        
+        return $request;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Select.php	(revision 7576)
@@ -0,0 +1,100 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Build a select request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Select extends Solarium_Client_RequestBuilder
+{
+
+    /**
+     * Build request for a select query
+     *
+     * @param Solarium_Query_Select $query
+     * @return Solarium_Client_Request
+     */
+    public function build($query)
+    {
+        $request = parent::build($query);
+
+        // add basic params to request
+        $request->addParam('q', $query->getQuery());
+        $request->addParam('start', $query->getStart());
+        $request->addParam('rows', $query->getRows());
+        $request->addParam('fl', implode(',', $query->getFields()));
+        $request->addParam('q.op', $query->getQueryDefaultOperator());
+        $request->addParam('df', $query->getQueryDefaultField());
+
+        // add sort fields to request
+        $sort = array();
+        foreach ($query->getSorts() AS $field => $order) {
+            $sort[] = $field . ' ' . $order;
+        }
+        if (count($sort) !== 0) {
+            $request->addParam('sort', implode(',', $sort));
+        }
+
+        // add filterqueries to request
+        $filterQueries = $query->getFilterQueries();
+        if (count($filterQueries) !== 0) {
+            foreach ($filterQueries AS $filterQuery) {
+                $fq = $this->renderLocalParams(
+                    $filterQuery->getQuery(),
+                    array('tag' => $filterQuery->getTags())
+                );
+                $request->addParam('fq', $fq);
+            }
+        }
+
+        // add components to request
+        $types = $query->getComponentTypes();
+        foreach ($query->getComponents() as $component) {
+            $componentBuilderClass = $types[$component->getType()]['requestbuilder'];
+            if (!empty($componentBuilderClass)) {
+                $componentBuilder = new $componentBuilderClass;
+                $request = $componentBuilder->buildComponent($component, $request);
+            }
+        }
+
+        return $request;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Update.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Update.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Update.php	(revision 7576)
@@ -0,0 +1,228 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Build an update request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Update extends Solarium_Client_RequestBuilder
+{
+
+    /**
+     * Build request for an update query
+     *
+     * @param Solarium_Query_Update $query
+     * @return Solarium_Client_Request
+     */
+    public function build($query)
+    {
+        $request = parent::build($query);
+        $request->setMethod(Solarium_Client_Request::METHOD_POST);
+        $request->setRawData($this->getRawData($query));
+
+        return $request;
+    }
+
+    /**
+     * Generates raw POST data
+     *
+     * Each commandtype is delegated to a separate builder method.
+     *
+     * @param Solarium_Query_Update $query
+     * @throws Solarium_Exception
+     * @return string
+     */
+    public function getRawData($query)
+    {
+        $xml = '<update>';
+        foreach ($query->getCommands() AS $command) {
+            switch ($command->getType()) {
+                case Solarium_Query_Update::COMMAND_ADD:
+                    $xml .= $this->buildAddXml($command);
+                    break;
+                case Solarium_Query_Update::COMMAND_DELETE:
+                    $xml .= $this->buildDeleteXml($command);
+                    break;
+                case Solarium_Query_Update::COMMAND_OPTIMIZE:
+                    $xml .= $this->buildOptimizeXml($command);
+                    break;
+                case Solarium_Query_Update::COMMAND_COMMIT:
+                    $xml .= $this->buildCommitXml($command);
+                    break;
+                case Solarium_Query_Update::COMMAND_ROLLBACK:
+                    $xml .= $this->buildRollbackXml();
+                    break;
+                default:
+                    throw new Solarium_Exception('Unsupported command type');
+                    break;
+            }
+        }
+        $xml .= '</update>';
+
+        return $xml;
+    }
+
+    /**
+     * Build XML for an add command
+     *
+     * @param Solarium_Query_Update_Command_Add $command
+     * @return string
+     */
+    public function buildAddXml($command)
+    {
+        $xml = '<add';
+        $xml .= $this->boolAttrib('overwrite', $command->getOverwrite());
+        $xml .= $this->attrib('commitWithin', $command->getCommitWithin());
+        $xml .= '>';
+
+        foreach ($command->getDocuments() AS $doc) {
+            $xml .= '<doc';
+            $xml .= $this->attrib('boost', $doc->getBoost());
+            $xml .= '>';
+
+            foreach ($doc->getFields() AS $name => $value) {
+                $boost = $doc->getFieldBoost($name);
+                if (is_array($value)) {
+                    foreach ($value AS $multival) {
+                        $xml .= $this->_buildFieldXml($name, $boost, $multival);
+                    }
+                } else {
+                    $xml .= $this->_buildFieldXml($name, $boost, $value);
+                }
+            }
+
+            $xml .= '</doc>';
+        }
+
+        $xml .= '</add>';
+
+        return $xml;
+    }
+
+    /**
+     * Build XML for a field
+     *
+     * Used in the add command
+     *
+     * @param string $name
+     * @param float $boost
+     * @param mixed $value
+     * @return string
+     */
+    protected function _buildFieldXml($name, $boost, $value)
+    {
+        $xml = '<field name="' . $name . '"';
+        $xml .= $this->attrib('boost', $boost);
+        $xml .= '>' . htmlspecialchars($value, ENT_NOQUOTES, 'UTF-8');
+        $xml .= '</field>';
+
+        return $xml;
+    }
+
+    /**
+     * Build XML for a delete command
+     *
+     * @param Solarium_Query_Update_Command_Delete $command
+     * @return string
+     */
+    public function buildDeleteXml($command)
+    {
+        $xml = '<delete>';
+        foreach ($command->getIds() AS $id) {
+            $xml .= '<id>' . htmlspecialchars($id, ENT_NOQUOTES, 'UTF-8')
+                    . '</id>';
+        }
+        foreach ($command->getQueries() AS $query) {
+            $xml .= '<query>' . htmlspecialchars($query, ENT_NOQUOTES, 'UTF-8')
+                    . '</query>';
+        }
+        $xml .= '</delete>';
+
+        return $xml;
+    }
+
+    /**
+     * Build XML for an update command
+     *
+     * @param Solarium_Query_Update_Command_Optimize $command
+     * @return string
+     */
+    public function buildOptimizeXml($command)
+    {
+        $xml = '<optimize';
+        $xml .= $this->boolAttrib('waitFlush', $command->getWaitFlush());
+        $xml .= $this->boolAttrib('waitSearcher', $command->getWaitSearcher());
+        $xml .= $this->attrib('maxSegments', $command->getMaxSegments());
+        $xml .= '/>';
+
+        return $xml;
+    }
+
+    /**
+     * Build XML for a commit command
+     *
+     * @param Solarium_Query_Update_Command_Commit $command
+     * @return string
+     */
+    public function buildCommitXml($command)
+    {
+        $xml = '<commit';
+        $xml .= $this->boolAttrib('waitFlush', $command->getWaitFlush());
+        $xml .= $this->boolAttrib('waitSearcher', $command->getWaitSearcher());
+        $xml .= $this->boolAttrib(
+            'expungeDeletes',
+            $command->getExpungeDeletes()
+        );
+        $xml .= '/>';
+
+        return $xml;
+    }
+
+    /**
+     * Build XMl for a rollback command
+     *
+     * @return string
+     */
+    public function buildRollbackXml()
+    {
+        return '<rollback/>';
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Analysis.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Analysis.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Analysis.php	(revision 7576)
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Build an analysis request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Analysis extends Solarium_Client_RequestBuilder
+{
+
+    /**
+     * Build request for an analysis query
+     *
+     * @param Solarium_Query_Analysis $query
+     * @return Solarium_Client_Request
+     */
+    public function build($query)
+    {
+        $request = parent::build($query);
+        $request->addParam('analysis.query', $query->getQuery());
+        $request->addParam('analysis.showmatch', $query->getShowMatch());
+
+        return $request;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Suggester.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Suggester.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder/Suggester.php	(revision 7576)
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Build a Suggester query request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_RequestBuilder_Suggester extends Solarium_Client_RequestBuilder
+{
+
+    /**
+     * Build request for a Suggester query
+     *
+     * @param Solarium_Query_Suggester $query
+     * @return Solarium_Client_Request
+     */
+    public function build($query)
+    {
+        $request = parent::build($query);
+        $request->addParam('spellcheck', 'true');
+        $request->addParam('q', $query->getQuery());
+        $request->addParam('spellcheck.dictionary', $query->getDictionary());
+        $request->addParam('spellcheck.count', $query->getCount());
+        $request->addParam('spellcheck.onlyMorePopular', $query->getOnlyMorePopular());
+        $request->addParam('spellcheck.collate', $query->getCollate());
+
+        return $request;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter/Http.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter/Http.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter/Http.php	(revision 7576)
@@ -0,0 +1,149 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Basic HTTP adapter using a stream
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_Adapter_Http extends Solarium_Client_Adapter
+{
+
+    /**
+     * Handle Solr communication
+     *
+     * @throws Solarium_Exception
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Response
+     */
+    public function execute($request)
+    {
+        $context = $this->createContext($request);
+        $uri = $this->getBaseUri() . $request->getUri();
+
+        list($data, $headers) = $this->_getData($uri, $context);
+
+        $this->check($data, $headers);
+
+        return new Solarium_Client_Response($data, $headers);
+    }
+
+    /**
+     * Check result of a request
+     *
+     * @throws Solarium_Client_HttpException
+     * @param string $data
+     * @param array $headers
+     * @return void
+     */
+    public function check($data, $headers)
+    {
+        // if there is no data and there are no headers it's a total failure,
+        // a connection to the host was impossible.
+        if (false === $data && count($headers) == 0) {
+            throw new Solarium_Client_HttpException("HTTP request failed");
+        }
+    }
+
+    /**
+     * Create a stream context for a request
+     *
+     * @param Solarium_Client_Request $request
+     * @return resource
+     */
+    public function createContext($request)
+    {
+        $method = $request->getMethod();
+        $context = stream_context_create(
+            array('http' => array(
+                'method' => $method,
+                'timeout' => $this->getTimeout()
+            ))
+        );
+
+        if ($method == Solarium_Client_Request::METHOD_POST) {
+            $data = $request->getRawData();
+            if (null !== $data) {
+                stream_context_set_option(
+                    $context,
+                    'http',
+                    'content',
+                    $data
+                );
+
+                $request->addHeader('Content-Type: text/xml; charset=UTF-8');
+            }
+        }
+
+        $headers = $request->getHeaders();
+        if (count($headers) > 0) {
+            stream_context_set_option(
+                $context,
+                'http',
+                'header',
+                implode("\r\n", $headers)
+            );
+        }
+
+        return $context;
+    }
+
+    /**
+     * Execute request
+     *
+     * @param string $uri
+     * @param resource $context
+     * @return array
+     */
+    protected function _getData($uri, $context)
+    {
+        // @codeCoverageIgnoreStart
+        $data = @file_get_contents($uri, false, $context);
+
+        if (isset($http_response_header)) {
+            $headers = $http_response_header;
+        } else {
+            $headers = array();
+        }
+
+        return array($data, $headers);
+        // @codeCoverageIgnoreEnd
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter/ZendHttp.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter/ZendHttp.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter/ZendHttp.php	(revision 7576)
@@ -0,0 +1,182 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Adapter that uses a Zend_Http_Client
+ *
+ * The Zend Framework HTTP client has many great features and has lots of
+ * configuration options. For more info see the manual at
+ * {@link http://framework.zend.com/manual/en/zend.http.html}
+ *
+ * To use this adapter you need to have the Zend Framework available (autoloading)
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_Adapter_ZendHttp extends Solarium_Client_Adapter
+{
+
+    /**
+     * Zend Http instance for communication with Solr
+     *
+     * @var Zend_Http_Client
+     */
+    protected $_zendHttp;
+
+    /**
+     * Set options
+     *
+     * Overrides any existing values.
+     * 
+     * If the options array has an 'options' entry it is forwarded to the
+     * Zend_Http_Client. See the Zend_Http_Clientdocs for the many config
+     * options available.
+     *
+     * The $options param should be an array or an object that has a toArray
+     * method, like Zend_Config
+     *
+     * @param array|object $options
+     * @param boolean $overwrite
+     * @return Solarium_Client_Adapter_ZendHttp Provides fluent interface
+     */
+    public function setOptions($options, $overwrite = false)
+    {
+        parent::setOptions($options, $overwrite);
+
+        // forward options to zendHttp instance
+        if (null !== $this->_zendHttp) {
+
+            // forward timeout setting
+            $adapterOptions = array('timeout' => $this->getTimeout());
+
+            // forward adapter options if available
+            if (isset($this->_options['options'])) {
+                $adapterOptions = array_merge($adapterOptions, $this->_options['options']);
+            }
+            
+            $this->_zendHttp->setConfig($adapterOptions);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Set the Zend_Http_Client instance
+     *
+     * This method is optional, if you don't set a client it will be created
+     * upon first use, using default and/or custom options (the most common use
+     * case)
+     *
+     * @param Zend_Http_Client $zendHttp
+     * @return Solarium_Client_Adapter_ZendHttp Provides fluent interface
+     */
+    public function setZendHttp($zendHttp)
+    {
+        $this->_zendHttp = $zendHttp;
+        return $this;
+    }
+
+    /**
+     * Get the Zend_Http_Client instance
+     *
+     * If no instance is available yet it will be created automatically based on
+     * options.
+     *
+     * You can use this method to get a reference to the client instance to set
+     * options, get the last response and use many other features offered by the
+     * Zend_Http_Client API.
+     *
+     * @return Zend_Http_Client
+     */
+    public function getZendHttp()
+    {
+        if (null == $this->_zendHttp) {
+            $options = array('timeout' => $this->getOption('timeout'));
+
+            // forward zendhttp options
+            if (isset($this->_options['options'])) {
+                $options = array_merge(
+                    $options,
+                    $this->_options['options']
+                );
+            }
+
+            $this->_zendHttp = new Zend_Http_Client(null, $options);
+        }
+
+        return $this->_zendHttp;
+    }
+
+    /**
+     * Execute a Solr request using the Zend_Http_Client instance
+     *
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Response
+     */
+    public function execute($request)
+    {
+        $client = $this->getZendHttp();
+
+        $client->setMethod($request->getMethod());
+        $client->setUri($this->getBaseUri() . $request->getUri());
+        $client->setHeaders($request->getHeaders());
+        $client->setRawData($request->getRawData());
+
+        $response = $client->request();
+
+        // throw an exception in case of a HTTP error
+        if ($response->isError()) {
+            throw new Solarium_Client_HttpException(
+                $response->getMessage(),
+                $response->getStatus()
+            );
+        }
+
+        if ($request->getMethod() == Solarium_Client_Request::METHOD_HEAD) {
+            $data = '';
+        } else {
+            $data = $response->getBody();
+        }
+
+        // this is used because getHeaders doesn't return the HTTP header...
+        $headers = explode("\n", $response->getHeadersAsString());
+
+        return new Solarium_Client_Response($data, $headers);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter/PeclHttp.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter/PeclHttp.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter/PeclHttp.php	(revision 7576)
@@ -0,0 +1,166 @@
+<?php
+/**
+ * Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Gasol Wu <gasol.wu@gmail.com>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Pecl HTTP adapter
+ *
+ * @author Gasol Wu <gasol.wu@gmail.com>
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_Adapter_PeclHttp extends Solarium_Client_Adapter
+{
+
+    /**
+     * Initialization hook
+     *
+     * Checks the availability of pecl_http
+     */
+    protected function _init()
+    {
+        // @codeCoverageIgnoreStart
+        if (!class_exists('HttpRequest', false)) {
+           throw new Solarium_Exception('Pecl_http is not available, install it to use the PeclHttp adapter');
+        }
+
+        parent::_init();
+        // @codeCoverageIgnoreEnd
+    }
+
+    /**
+     * Execute a Solr request using the Pecl Http
+     *
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Response
+     */
+    public function execute($request)
+    {
+        $httpRequest = $this->toHttpRequest($request);
+
+        try {
+            $httpMessage = $httpRequest->send();
+        } catch (Exception $e) {
+            throw new Solarium_Client_HttpException($e->getMessage());
+        }
+
+        return new Solarium_Client_Response(
+            $httpMessage->getBody(),
+            $this->_toRawHeaders($httpMessage)
+        );
+    }
+
+    /**
+     * Convert key/value pair header to raw header.
+     *
+     * <code>
+     * //before
+     * $headers['Content-Type'] = 'text/plain';
+     *
+     * ...
+     *
+     * //after
+     * $headers[0] = 'Content-Type: text/plain';
+     * </code>
+     *
+     * @param $message HttpMessage
+     * @return array
+     */
+    protected function _toRawHeaders($message)
+    {
+        $headers[] = 'HTTP/' . $message->getHttpVersion()
+                   . ' ' . $message->getResponseCode()
+                   . ' ' . $message->getResponseStatus();
+
+        foreach ($message->getHeaders() as $header => $value) {
+            $headers[] = "$header: $value";
+        }
+
+        return $headers;
+    }
+
+    /**
+     *
+     * adapt Solarium_Client_Request to HttpRequest
+     *
+     * {@link http://us.php.net/manual/en/http.constants.php
+     *  HTTP Predefined Constant}
+     *
+     * @param Solarium_Client_Request $request
+     * @param HttpRequest
+     */
+    public function toHttpRequest($request)
+    {
+        $url = $this->getBaseUri() . $request->getUri();
+        $httpRequest = new HttpRequest($url);
+
+        $headers = array();
+        foreach ($request->getHeaders() as $headerLine) {
+            list($header, $value) = explode(':', $headerLine);
+            if ($header = trim($header)) {
+                $headers[$header] = trim($value);
+            }
+        }
+
+        switch($request->getMethod()) {
+        case Solarium_Client_Request::METHOD_GET:
+            $method = HTTP_METH_GET;
+            break;
+        case Solarium_Client_Request::METHOD_POST:
+            $method = HTTP_METH_POST;
+            $httpRequest->setBody($request->getRawData());
+            if (!isset($headers['Content-Type'])) {
+                $headers['Content-Type'] = 'text/xml; charset=utf-8';
+            }
+            break;
+        case Solarium_Client_Request::METHOD_HEAD:
+            $method = HTTP_METH_HEAD;
+            break;
+        default:
+            throw new Solarium_Exception(
+                'Unsupported method: ' . $request->getMethod()
+            );
+        }
+
+        $httpRequest->setMethod($method);
+        $httpRequest->setOptions(array('timeout' => $this->getTimeout()));
+        $httpRequest->setHeaders($headers);
+
+        return $httpRequest;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter/Curl.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter/Curl.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter/Curl.php	(revision 7576)
@@ -0,0 +1,202 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * cURL HTTP adapter
+ *
+ * @author Intervals <info@myintervals.com>
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_Adapter_Curl extends Solarium_Client_Adapter
+{
+
+    /**
+     * Initialization hook
+     *
+     * Checks the availability of Curl_http
+     */
+    protected function _init()
+    {
+        // @codeCoverageIgnoreStart
+        if (!function_exists('curl_init')) {
+           throw new Solarium_Exception('cURL is not available, install it to use the CurlHttp adapter');
+        }
+
+        parent::_init();
+        // @codeCoverageIgnoreEnd
+    }
+
+    /**
+     * Execute a Solr request using the cURL Http
+     *
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Response
+     */
+    public function execute($request)
+    {
+        return $this->_getData($request);
+    }
+
+    /**
+     * Execute request
+     *
+     * @param Solarium_Client_Request $request
+     * @return array
+     */
+    protected function _getData($request)
+    {
+        // @codeCoverageIgnoreStart
+        $handle = $this->createHandle($request);
+        $httpResponse = curl_exec($handle);
+
+        return $this->getResponse($handle, $httpResponse);
+        // @codeCoverageIgnoreEnd
+    }
+
+    /**
+     * Get the response for a curl handle
+     *
+     * @param resource $handle
+     * @param string $httpResponse
+     * @return Solarium_Client_Response
+     */
+    public function getResponse($handle, $httpResponse)
+    {
+        // @codeCoverageIgnoreStart
+        if ($httpResponse !== false) {
+            $data = $httpResponse;
+            $info = curl_getinfo($handle);
+            $headers = array();
+            $headers[] = 'HTTP/1.1 ' . $info['http_code']. ' OK';
+        } else {
+            $headers = array();
+            $data = '';
+        }
+
+        curl_close($handle);
+        $this->check($data, $headers);
+        return new Solarium_Client_Response($data, $headers);
+        // @codeCoverageIgnoreEnd
+    }
+
+    /**
+     * Create curl handle for a request
+     *
+     * @param Solarium_Client_Request $request
+     * @return resource
+     */
+    public function createHandle($request)
+    {
+        // @codeCoverageIgnoreStart
+        $uri = $this->getBaseUri() . $request->getUri();
+        $method = $request->getMethod();
+        $options = $this->_createOptions($request);
+
+        $handler = curl_init();
+        curl_setopt($handler, CURLOPT_URL, $uri);
+        curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
+        curl_setopt($handler, CURLOPT_FOLLOWLOCATION, true);
+        curl_setopt($handler, CURLOPT_TIMEOUT, $options['timeout']);
+
+        if (!isset($options['headers']['Content-Type'])) {
+            $options['headers']['Content-Type'] = 'text/xml; charset=utf-8';
+        }
+
+        if (count($options['headers'])) {
+            $headers = array();
+            foreach ($options['headers'] as $key => $value) {
+                $headers[] = $key . ": " . $value;
+            }
+            curl_setopt($handler, CURLOPT_HTTPHEADER, $headers);
+        }
+
+        if ($method == Solarium_Client_Request::METHOD_POST) {
+            curl_setopt($handler, CURLOPT_POST, true);
+            curl_setopt($handler, CURLOPT_POSTFIELDS, $request->getRawData());
+        } else if ($method == Solarium_Client_Request::METHOD_GET) {
+            curl_setopt($handler, CURLOPT_HTTPGET, true);
+        } else if ($method == Solarium_Client_Request::METHOD_HEAD) {
+            curl_setopt($handler, CURLOPT_CUSTOMREQUEST, 'HEAD');
+        } else {
+            throw new Solarium_Exception("unsupported method: $method");
+        }
+
+        return $handler;
+        // @codeCoverageIgnoreEnd
+    }
+
+    /**
+     * Create http request options from request.
+     *
+     * @param Solarium_Client_Request $request
+     * @return array
+     */
+    protected function _createOptions($request)
+    {
+        // @codeCoverageIgnoreStart
+        $options = array(
+            'timeout' => $this->getTimeout()
+        );
+        foreach ($request->getHeaders() as $headerLine) {
+            list($header, $value) = explode(':', $headerLine);
+            if ($header = trim($header)) {
+                $options['headers'][$header] = trim($value);
+            }
+        }
+        return $options;
+        // @codeCoverageIgnoreEnd
+    }
+
+    /**
+     * Check result of a request
+     *
+     * @throws Solarium_Client_HttpException
+     * @param string $data
+     * @param array $headers
+     * @return void
+     */
+    public function check($data, $headers)
+    {
+        // if there is no data and there are no headers it's a total failure,
+        // a connection to the host was impossible.
+        if (empty($data) && count($headers) == 0) {
+            throw new Solarium_Client_HttpException("HTTP request failed");
+        }
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser.php	(revision 7576)
@@ -0,0 +1,69 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Base class for handling Solr response data
+ *
+ * Most {@link Solarium_Client_Adapter} implementations will use HTTP for
+ * communicating with Solr. While the HTTP part is adapter-specific, the parsing
+ * of the response into Solarium_Result classes is not. This abstract class is
+ * the base for several response handlers that do just that for the various
+ * querytypes.
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+abstract class Solarium_Client_ResponseParser
+{
+
+    /**
+     * Get a Solarium_Result instance for the given data
+     *
+     * When this method is called the actual response parsing is started.
+     *
+     * @internal Must be implemented in descendents because this parsing is
+     *  query specific.
+     *
+     * @abstract
+     *
+     * @param Solarium_Result $result
+     * @return mixed
+     */
+    abstract function parse($result);
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/HttpException.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/HttpException.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/HttpException.php	(revision 7576)
@@ -0,0 +1,100 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Solarium client HTTP exception
+ *
+ * This exception class exists to make it easy to catch HTTP errors.
+ * HTTP errors usually mean your Solr settings or Solr input (e.g. query)
+ * contain an error.
+ *
+ * The getMessage method returns an error description that includes the status
+ * message and code.
+ *
+ * The getCode method will return the HTTP response code returned by the server
+ * (if available).
+ *
+ * The getStatusMessage method will return the HTTP status message.
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_HttpException extends Solarium_Exception
+{
+
+    /**
+     * HTTP status message
+     *
+     * @var string
+     */
+    protected $_statusMessage;
+
+    /**
+     * Exception constructor
+     *
+     * The input message is a HTTP status message. Because an exception with the
+     * message 'Not Found' is not very clear it this message is tranformed to a
+     * more descriptive text. The original message is available using the
+     * {@link getStatusMessage} method.
+     *
+     * @param string $statusMessage
+     * @param int|null $code
+     */
+    public function __construct($statusMessage, $code = null)
+    {
+        $this->_statusMessage = $statusMessage;
+
+        $message = 'Solr HTTP error: ' . $statusMessage;
+        if (null !== $code) {
+             $message .= ' (' . $code . ')';
+        }
+
+        parent::__construct($message, $code);
+    }
+
+    /**
+     * Get the HTTP status message
+     *
+     * @return string
+     */
+    public function getStatusMessage()
+    {
+        return $this->_statusMessage;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Response.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Response.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Response.php	(revision 7576)
@@ -0,0 +1,160 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Class for describing a response
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_Response
+{
+
+    /**
+     * Headers
+     *
+     * @var array
+     */
+    protected $_headers;
+
+    /**
+     * Body
+     *
+     * @var string
+     */
+    protected $_body;
+
+    /**
+     * HTTP response code
+     *
+     * @var int
+     */
+    protected $_statusCode;
+
+    /**
+     * HTTP response message
+     *
+     * @var string
+     */
+    protected $_statusMessage;
+
+    /**
+     * Constructor
+     *
+     * @param string $body
+     * @param array $headers
+     */
+    public function __construct($body, $headers = array())
+    {
+        $this->_body = $body;
+        $this->_headers = $headers;
+
+        $this->_setHeaders($headers);
+    }
+
+    /**
+     * Get body data
+     *
+     * @return string
+     */
+    public function getBody()
+    {
+        return $this->_body;
+    }
+
+    /**
+     * Get response headers
+     *
+     * @return array
+     */
+    public function getHeaders()
+    {
+        return $this->_headers;
+    }
+
+    /**
+     * Get status code
+     *
+     * @return int
+     */
+    public function getStatusCode()
+    {
+        return $this->_statusCode;
+    }
+
+    /**
+     * Get status message
+     *
+     * @return string
+     */
+    public function getStatusMessage()
+    {
+        return $this->_statusMessage;
+    }
+
+    /**
+     * Set headers
+     *
+     * @param array $headers
+     * @return void
+     */
+    public function _setHeaders($headers)
+    {
+        $this->_headers = $headers;
+
+        // get the status header
+        $statusHeader = null;
+        foreach ($headers AS $header) {
+            if (substr($header, 0, 4) == 'HTTP') {
+                $statusHeader = $header;
+                break;
+            }
+        }
+
+        if (null == $statusHeader) {
+            throw new Solarium_Client_HttpException("No HTTP status found");
+        }
+
+        // parse header like "$statusInfo[1]" into code and message
+        // $statusInfo[1] = the HTTP response code
+        // $statusInfo[2] = the response message
+        $statusInfo = explode(' ', $statusHeader, 3);
+        $this->_statusCode = $statusInfo[1];
+        $this->_statusMessage = $statusInfo[2];
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/RequestBuilder.php	(revision 7576)
@@ -0,0 +1,130 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Class for building Solarium client requests
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+abstract class Solarium_Client_RequestBuilder
+{
+
+    /**
+     * Build request for a select query
+     *
+     * @param Solarium_Query $query
+     * @return Solarium_Client_Request
+     */
+    public function build($query)
+    {
+        $request = new Solarium_Client_Request;
+        $request->setHandler($query->getHandler());
+        $request->addParams($query->getParams());
+        $request->addParam('wt', 'json');
+
+        return $request;
+    }
+
+    /**
+     * Render a param with localParams
+     *
+     * LocalParams can be use in various Solr GET params.
+     * @link http://wiki.apache.org/solr/LocalParams
+     *
+     * @param string $value
+     * @param array $localParams in key => value format
+     * @return string with Solr localparams syntax
+     */
+    public function renderLocalParams($value, $localParams = array())
+    {
+        $params = '';
+        foreach ($localParams AS $paramName => $paramValue) {
+            if (empty($paramValue)) continue;
+
+            if (is_array($paramValue)) {
+                $paramValue = implode($paramValue, ',');
+            }
+
+            $params .= $paramName . '=' . $paramValue . ' ';
+        }
+
+        if ($params !== '') {
+            $value = '{!' . trim($params) . '}' . $value;
+        }
+
+        return $value;
+    }
+
+    /**
+    * Render a boolean attribute
+    *
+    * For use in building XML messages
+    *
+    * @param string $name
+    * @param boolean $value
+    * @return string
+    */
+    public function boolAttrib($name, $value)
+    {
+        if (null !== $value) {
+            $value = (true == $value) ? 'true' : 'false';
+            return $this->attrib($name, $value);
+        } else {
+            return '';
+        }
+    }
+
+    /**
+    * Render an attribute
+    *
+    * For use in building XML messages
+    *
+    * @param string $name
+    * @param striung $value
+    * @return string
+    */
+    public function attrib($name, $value)
+    {
+        if (null !== $value) {
+            return ' ' . $name . '="' . $value . '"';
+        } else {
+            return '';
+        }
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Adapter.php	(revision 7576)
@@ -0,0 +1,231 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Base class for all adapters
+ *
+ * The goal of an adapter is to accept a query, execute it and return the right
+ * result object. This is actually quite a complex task as it involves the
+ * handling of all Solr communication.
+ *
+ * The adapter structure allows for varying implementations of this task.
+ *
+ * Most adapters will use some sort of HTTP client. In that case the
+ * Solarium_Client_Request request builders and Solarium_Client_Response
+ * response parsers can be used to simplify HTTP communication.
+ * See {@link Solarium_Client_Adapter_Http} as an example.
+ *
+ * However an adapter may also implement all logic by itself if needed.
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+abstract class Solarium_Client_Adapter extends Solarium_Configurable
+{
+    /**
+     * Default options
+     *
+     * The defaults match a standard Solr example instance as distributed by
+     * the Apache Lucene Solr project.
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'host'    => '127.0.0.1',
+        'port'    => 8983,
+        'path'    => '/solr',
+        'core'    => null,
+        'timeout' => 5,
+    );
+
+    /**
+     * Initialization hook
+     *
+     * In this case the path needs to be cleaned of trailing slashes.
+     * @see setPath()
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'path':
+                    $this->setPath($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Set host option
+     *
+     * @param string $host This can be a hostname or an IP address
+     * @return Solarium_Client Provides fluent interface
+     */
+    public function setHost($host)
+    {
+        return $this->_setOption('host', $host);
+    }
+
+    /**
+     * Get host option
+     *
+     * @return string
+     */
+    public function getHost()
+    {
+        return $this->getOption('host');
+    }
+
+    /**
+     * Set port option
+     *
+     * @param int $port Common values are 80, 8080 and 8983
+     * @return Solarium_Client Provides fluent interface
+     */
+    public function setPort($port)
+    {
+        return $this->_setOption('port', $port);
+    }
+
+    /**
+     * Get port option
+     *
+     * @return int
+     */
+    public function getPort()
+    {
+        return $this->getOption('port');
+    }
+
+    /**
+     * Set path option
+     *
+     * If the path has a trailing slash it will be removed.
+     *
+     * @param string $path
+     * @return Solarium_Client Provides fluent interface
+     */
+    public function setPath($path)
+    {
+        if (substr($path, -1) == '/') $path = substr($path, 0, -1);
+
+        return $this->_setOption('path', $path);
+    }
+
+    /**
+     * Get path option
+     *
+     * @return string
+     */
+    public function getPath()
+    {
+        return $this->getOption('path');
+    }
+
+    /**
+     * Set core option
+     *
+     * @param string $core
+     * @return Solarium_Client Provides fluent interface
+     */
+    public function setCore($core)
+    {
+        return $this->_setOption('core', $core);
+    }
+
+    /**
+     * Get core option
+     *
+     * @return string
+     */
+    public function getCore()
+    {
+        return $this->getOption('core');
+    }
+
+    /**
+     * Set timeout option
+     *
+     * @param int $timeout
+     * @return Solarium_Client Provides fluent interface
+     */
+    public function setTimeout($timeout)
+    {
+        return $this->_setOption('timeout', $timeout);
+    }
+
+    /**
+     * Get timeout option
+     *
+     * @return string
+     */
+    public function getTimeout()
+    {
+        return $this->getOption('timeout');
+    }
+
+    /**
+     * Execute a request
+     *
+     * Abstract method to require an implementation inside all adapters.
+     *
+     * @abstract
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Response
+     */
+    abstract public function execute($request);
+
+    /**
+     * Get the base url for all requests
+     *
+     * Based on host, path, port and core options.
+     *
+     * @return string
+     */
+    public function getBaseUri()
+    {
+        $uri = 'http://' . $this->getHost() . ':' . $this->getPort() . $this->getPath() . '/';
+
+        $core = $this->getCore();
+        if (!empty($core)) {
+            $uri .= $core.'/';
+        }
+
+        return $uri;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Grouping.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Grouping.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Grouping.php	(revision 7576)
@@ -0,0 +1,134 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse select component Grouping result from the data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Select_Component_Grouping
+{
+
+    /**
+     * Parse result data into result objects
+     *
+     * @param Solarium_Query_Select $query
+     * @param Solarium_Query_Select_Component_Grouping $grouping
+     * @param array $data
+     * @return Solarium_Result_Select_Grouping
+     */
+    public function parse($query, $grouping, $data)
+    {
+        $groups = array();
+
+        if (isset($data['grouped'])) {
+
+            // parse field groups
+            foreach ($grouping->getFields() as $field) {
+                if (isset($data['grouped'][$field])) {
+                    $result = $data['grouped'][$field];
+
+                    $matches = (isset($result['matches'])) ? $result['matches'] : null;
+                    $groupCount = (isset($result['ngroups'])) ? $result['ngroups'] : null;
+                    $valueGroups = array();
+                    foreach ($result['groups'] as $valueGroupResult) {
+
+                        $value = (isset($valueGroupResult['groupValue'])) ?
+                                $valueGroupResult['groupValue'] : null;
+
+                        $numFound = (isset($valueGroupResult['doclist']['numFound'])) ?
+                                $valueGroupResult['doclist']['numFound'] : null;
+
+                        $start = (isset($valueGroupResult['doclist']['start'])) ?
+                                $valueGroupResult['doclist']['start'] : null;
+
+                        // create document instances
+                        $documentClass = $query->getOption('documentclass');
+                        $documents = array();
+                        if (isset($valueGroupResult['doclist']['docs']) &&
+                            is_array($valueGroupResult['doclist']['docs'])) {
+
+                            foreach ($valueGroupResult['doclist']['docs'] as $doc) {
+                                $documents[] = new $documentClass($doc);
+                            }
+                        }
+
+                        $valueGroups[] = new Solarium_Result_Select_Grouping_ValueGroup(
+                            $value, $numFound, $start, $documents
+                        );
+                    }
+
+                    $groups[$field] = new Solarium_Result_Select_Grouping_FieldGroup(
+                        $matches, $groupCount, $valueGroups
+                    );
+                }
+            }
+
+            // parse query groups
+            foreach ($grouping->getQueries() as $groupQuery) {
+                if (isset($data['grouped'][$groupQuery])) {
+                    $result = $data['grouped'][$groupQuery];
+
+                    // get statistics
+                    $matches = (isset($result['matches'])) ? $result['matches'] : null;
+                    $numFound = (isset($result['doclist']['numFound'])) ? $result['doclist']['numFound'] : null;
+                    $start = (isset($result['doclist']['start'])) ? $result['doclist']['start'] : null;
+                    $maxScore = (isset($result['doclist']['maxScore'])) ? $result['doclist']['maxScore'] : null;
+
+                    // create document instances
+                    $documentClass = $query->getOption('documentclass');
+                    $documents = array();
+                    if (isset($result['doclist']['docs']) && is_array($result['doclist']['docs'])) {
+                        foreach ($result['doclist']['docs'] as $doc) {
+                            $documents[] = new $documentClass($doc);
+                        }
+                    }
+
+                    // create a group result object
+                    $group = new Solarium_Result_Select_Grouping_QueryGroup(
+                        $matches, $numFound, $start, $maxScore, $documents
+                    );
+                    $groups[$groupQuery] = $group;
+                }
+            }
+        }
+
+        return new Solarium_Result_Select_Grouping($groups);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Spellcheck.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Spellcheck.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Spellcheck.php	(revision 7576)
@@ -0,0 +1,176 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse select component Highlighting result from the data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Select_Component_Spellcheck
+{
+
+    /**
+     * Parse result data into result objects
+     *
+     * @param Solarium_Query_Select $query
+     * @param Solarium_Query_Select_Component_Spellcheck $spellcheck
+     * @param array $data
+     * @return Solarium_Result_Select_Spellcheck|null
+     */
+    public function parse($query, $spellcheck, $data)
+    {
+        $results = array();
+        if (
+            isset($data['spellcheck']['suggestions']) &&
+            is_array($data['spellcheck']['suggestions']) &&
+            count($data['spellcheck']['suggestions']) > 0
+        ) {
+
+            $spellcheckResults = $data['spellcheck']['suggestions'];
+
+            $suggestions = array();
+            $correctlySpelled = null;
+            $collation = null;
+
+            $index = 0;
+            while (isset($spellcheckResults[$index]) && isset($spellcheckResults[$index+1])) {
+                $key = $spellcheckResults[$index];
+                $value = $spellcheckResults[$index+1];
+
+                switch ($key) {
+                    case 'correctlySpelled':
+                        $correctlySpelled = $value;
+                        break;
+                    case 'collation':
+                        $collation = $this->_parseCollation($value);
+                        break;
+                    default:
+                        $suggestions[] = $this->_parseSuggestion($key, $value);
+                }
+
+                $index +=2;
+            }
+
+            return new Solarium_Result_Select_Spellcheck($suggestions, $collation, $correctlySpelled);
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Parse collation data into a result object
+     *
+     * @param array $values
+     * @return Solarium_Result_Select_Spellcheck_Collation
+     */
+    protected function _parseCollation($values)
+    {
+        if (is_string($values)) {
+
+            return new Solarium_Result_Select_Spellcheck_Collation($values, null, array());
+
+        } else {
+
+            $query = null;
+            $hits = null;
+            $correctionResult = null;
+
+            $index = 0;
+            while (isset($values[$index]) && isset($values[$index+1])) {
+                $key = $values[$index];
+                $value = $values[$index+1];
+
+                switch ($key) {
+                    case 'collationQuery':
+                        $query = $value;
+                        break;
+                    case 'hits':
+                        $hits = $value;
+                        break;
+                    case 'misspellingsAndCorrections':
+                        $correctionResult = $value;
+                        break;
+                }
+
+                $index +=2;
+            }
+
+            $corrections = array();
+            if ($correctionResult !== null) {
+                $index = 0;
+                while (isset($correctionResult[$index]) && isset($correctionResult[$index+1])) {
+                    $input = $correctionResult[$index];
+                    $correction = $correctionResult[$index+1];
+
+                    $corrections[$input] = $correction;
+                    $index += 2;
+                }
+            }
+
+            return new Solarium_Result_Select_Spellcheck_Collation($query, $hits, $corrections);
+        }
+    }
+
+    /**
+     * Parse suggestion data into a result object
+     *
+     * @param string $key
+     * @param array $value
+     * @return Solarium_Result_Select_Spellcheck_Suggestion
+     */
+    protected function _parseSuggestion($key, $value)
+    {
+        $numFound = (isset($value['numFound'])) ? $value['numFound'] : null;
+        $startOffset = (isset($value['startOffset'])) ? $value['startOffset'] : null;
+        $endOffset = (isset($value['endOffset'])) ? $value['endOffset'] : null;
+        $originalFrequency = (isset($value['origFreq'])) ? $value['origFreq'] : null;
+
+        if (is_string($value['suggestion'][0])) {
+            $word = $value['suggestion'][0];
+            $frequency = null;
+        } else {
+            $word = $value['suggestion'][0]['word'];
+            $frequency = $value['suggestion'][0]['freq'];
+        }
+
+        return new Solarium_Result_Select_Spellcheck_Suggestion(
+            $numFound, $startOffset, $endOffset, $originalFrequency, $word, $frequency
+        );
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/FacetSet.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/FacetSet.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/FacetSet.php	(revision 7576)
@@ -0,0 +1,189 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse select component FacetSet result from the data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Select_Component_FacetSet
+{
+
+    /**
+     * Parse result data into result objects
+     *
+     * @param Solarium_Query_Select $query
+     * @param Solarium_Query_Select_Component_FacetSet $facetSet
+     * @param array $data
+     * @return Solarium_Result_Select_FacetSet
+     */
+    public function parse($query, $facetSet, $data)
+    {
+        $facets = array();
+        foreach ($facetSet->getFacets() AS $key => $facet) {
+            switch ($facet->getType()) {
+                case Solarium_Query_Select_Component_FacetSet::FACET_FIELD:
+                    $result = $this->_facetField($facet, $data);
+                    break;
+                case Solarium_Query_Select_Component_FacetSet::FACET_QUERY:
+                    $result = $this->_facetQuery($facet, $data);
+                    break;
+                case Solarium_Query_Select_Component_FacetSet::FACET_MULTIQUERY:
+                    $result = $this->_facetMultiQuery($facet, $data);
+                    break;
+                case Solarium_Query_Select_Component_FacetSet::FACET_RANGE:
+                    $result = $this->_facetRange($facet, $data);
+                    break;
+                default:
+                    throw new Solarium_Exception('Unknown facet type');
+            }
+
+            if($result !== null) $facets[$key] = $result;
+        }
+
+        return $this->_createFacetSet($facets);
+    }
+
+    /**
+     * Create a facetset result object
+     *
+     * @param array $facets
+     * @return Solarium_Result_Select_FacetSet
+     */
+    protected function _createFacetSet($facets)
+    {
+        return new Solarium_Result_Select_FacetSet($facets);
+    }
+
+    /**
+     * Add a facet result for a field facet
+     *
+     * @param Solarium_Query_Select_Component_Facet_Field $facet
+     * @param array $data
+     * @return void
+     */
+    protected function _facetField($facet, $data)
+    {
+        $key = $facet->getKey();
+        if (isset($data['facet_counts']['facet_fields'][$key])) {
+
+            $values = array_chunk(
+                $data['facet_counts']['facet_fields'][$key],
+                2
+            );
+
+            $facetValues = array();
+            foreach ($values AS $value) {
+                $facetValues[$value[0]] = $value[1];
+            }
+
+            return new Solarium_Result_Select_Facet_Field($facetValues);
+        }
+    }
+
+    /**
+     * Add a facet result for a facet query
+     *
+     * @param Solarium_Query_Select_Component_Facet_Query $facet
+     * @param array $data
+     * @return void
+     */
+    protected function _facetQuery($facet, $data)
+    {
+        $key = $facet->getKey();
+        if (isset($data['facet_counts']['facet_queries'][$key])) {
+
+            $value = $data['facet_counts']['facet_queries'][$key];
+            return new Solarium_Result_Select_Facet_Query($value);
+        }
+    }
+
+    /**
+     * Add a facet result for a multiquery facet
+     *
+     * @param Solarium_Query_Select_Component_Facet_MultiQuery $facet
+     * @param array $data
+     * @return void
+     */
+    protected function _facetMultiQuery($facet, $data)
+    {
+        $values = array();
+        foreach ($facet->getQueries() AS $query) {
+            $key = $query->getKey();
+            if (isset($data['facet_counts']['facet_queries'][$key])) {
+                $count = $data['facet_counts']['facet_queries'][$key];
+                $values[$key] = $count;
+            }
+        }
+
+        if (count($values) > 0) {
+            return new Solarium_Result_Select_Facet_MultiQuery($values);
+        }
+    }
+
+
+    /**
+     * Add a facet result for a range facet
+     *
+     * @param Solarium_Query_Select_Component_Facet_Range $facet
+     * @param array $data
+     * @return void
+     */
+    protected function _facetRange($facet, $data)
+    {
+        $key = $facet->getKey();
+        if (isset($data['facet_counts']['facet_ranges'][$key])) {
+
+            $data = $data['facet_counts']['facet_ranges'][$key];
+            $before = (isset($data['before'])) ? $data['before'] : null;
+            $after = (isset($data['after'])) ? $data['after'] : null;
+            $between = (isset($data['between'])) ? $data['between'] : null;
+
+            $offset = 0;
+            $counts = array();
+            while (isset($data['counts'][$offset]) && isset($data['counts'][$offset+1])) {
+                $counts[$data['counts'][$offset]] = $data['counts'][$offset+1];
+                $offset += 2;
+            }
+
+            return new Solarium_Result_Select_Facet_Range($counts, $before, $after, $between);
+        }
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Stats.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Stats.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Stats.php	(revision 7576)
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse select component Stats result from the data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Select_Component_Stats
+{
+
+    /**
+     * Parse result data into result objects
+     *
+     * @param Solarium_Query_Select $query
+     * @param Solarium_Query_Select_Component_Stats $stats
+     * @param array $data
+     * @return Solarium_Result_Select_Stats
+     */
+    public function parse($query, $stats, $data)
+    {
+        $results = array();
+        if (isset($data['stats']['stats_fields'])) {
+
+            $statResults = $data['stats']['stats_fields'];
+            foreach ($statResults AS $field => $stats) {
+                if (isset($stats['facets'])) {
+                    foreach ($stats['facets'] as $facetField => $values) {
+                        foreach ($values as $value => $valueStats) {
+                            $stats['facets'][$facetField][$value] = new Solarium_Result_Select_Stats_FacetValue(
+                                $value, $valueStats
+                            );
+                        }
+                    }
+                }
+
+                $results[$field] = new Solarium_Result_Select_Stats_Result($field, $stats);
+            }
+        }
+
+        return new Solarium_Result_Select_Stats($results);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/MoreLikeThis.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/MoreLikeThis.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/MoreLikeThis.php	(revision 7576)
@@ -0,0 +1,82 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse select component MoreLikeThis result from the data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Select_Component_MoreLikeThis
+{
+
+    /**
+     * Parse result data into result objects
+     *
+     * @param Solarium_Query_Select $query
+     * @param Solarium_Query_Select_Component_MoreLikeThis $moreLikeThis
+     * @param array $data
+     * @return Solarium_Result_Select_MoreLikeThis
+     */
+    public function parse($query, $moreLikeThis, $data)
+    {
+        $results = array();
+        if (isset($data['moreLikeThis'])) {
+
+            $documentClass = $query->getOption('documentclass');
+
+            $searchResults = $data['moreLikeThis'];
+            foreach ($searchResults AS $key => $result) {
+
+                // create document instances
+                $docs = array();
+                foreach ($result['docs'] AS $fields) {
+                    $docs[] = new $documentClass($fields);
+                }
+
+                $results[$key] = new Solarium_Result_Select_MoreLikeThis_Result(
+                    $result['numFound'],
+                    $result['maxScore'],
+                    $docs
+                );
+            }
+        }
+
+        return new Solarium_Result_Select_MoreLikeThis($results);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Highlighting.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Highlighting.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Highlighting.php	(revision 7576)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse select component Highlighting result from the data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Select_Component_Highlighting
+{
+
+    /**
+     * Parse result data into result objects
+     *
+     * @param Solarium_Query_Select $query
+     * @param Solarium_Query_Select_Component_Highlighting $highlighting
+     * @param array $data
+     * @return Solarium_Result_Select_Highlighting
+     */
+    public function parse($query, $highlighting, $data)
+    {
+        $results = array();
+        if (isset($data['highlighting'])) {
+
+            $highlightResults = $data['highlighting'];
+            foreach ($highlightResults AS $key => $result) {
+                $results[$key] = new Solarium_Result_Select_Highlighting_Result(
+                    $result
+                );
+            }
+        }
+
+        return new Solarium_Result_Select_Highlighting($results);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Debug.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Debug.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select/Component/Debug.php	(revision 7576)
@@ -0,0 +1,175 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse select component Debug result from the data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Select_Component_Debug
+{
+
+    /**
+     * Parse result data into result objects
+     *
+     * @param Solarium_Query_Select $query
+     * @param Solarium_Query_Select_Component_Debug $component
+     * @param array $data
+     * @return Solarium_Result_Select_Debug|null
+     */
+    public function parse($query, $component, $data)
+    {
+        $result = null;
+
+        if (isset($data['debug'])) {
+            $debug = $data['debug'];
+
+            // get basic values from data
+            $queryString = (isset($debug['querystring'])) ? $debug['querystring'] : '';
+            $parsedQuery = (isset($debug['parsedquery'])) ? $debug['parsedquery'] : '';
+            $queryParser = (isset($debug['QParser'])) ? $debug['QParser'] : '';
+            $otherQuery = (isset($debug['otherQuery'])) ? $debug['otherQuery'] : '';
+
+            // parse explain data
+            if (isset($debug['explain']) && is_array($debug['explain'])) {
+                $explain = $this->_parseDocumentSet($debug['explain']);
+            } else {
+                $explain = new Solarium_Result_Select_Debug_DocumentSet(array());
+            }
+
+            // parse explainOther data
+            if (isset($debug['explainOther']) && is_array($debug['explainOther'])) {
+                $explainOther = $this->_parseDocumentSet($debug['explainOther']);
+            } else {
+                $explainOther = new Solarium_Result_Select_Debug_DocumentSet(array());
+            }
+
+            // parse timing data
+            $timing = null;
+            if (isset($debug['timing']) && is_array($debug['timing'])) {
+                $time = null;
+                $timingPhases = array();
+                foreach ($debug['timing'] as $key => $timingData) {
+                    switch($key) {
+                        case 'time':
+                            $time = $timingData;
+                            break;
+                        default:
+                            $timingPhases[$key] = $this->_parseTimingPhase($key, $timingData);
+                    }
+                }
+                $timing = new Solarium_Result_Select_Debug_Timing($time, $timingPhases);
+            }
+
+            // create result object
+            $result = new Solarium_Result_Select_Debug(
+                $queryString,
+                $parsedQuery,
+                $queryParser,
+                $otherQuery,
+                $explain,
+                $explainOther,
+                $timing
+            );
+        }
+
+        return $result;
+    }
+
+    /**
+     * Parse data into a documentset
+     *
+     * Used for explain and explainOther
+     *
+     * @param array $data
+     * @return Solarium_Result_Select_Debug_DocumentSet
+     */
+    protected function _parseDocumentSet($data)
+    {
+        $docs = array();
+        foreach ($data as $key => $documentData) {
+
+            $details = array();
+            if (isset($documentData['details']) && is_array($documentData['details'])) {
+                foreach ($documentData['details'] as $detailData) {
+                    $details[] = new Solarium_Result_Select_Debug_Detail(
+                        $detailData['match'],
+                        $detailData['value'],
+                        $detailData['description']
+                    );
+                }
+            }
+
+            $docs[$key] = new Solarium_Result_Select_Debug_Document(
+                $key,
+                $documentData['match'],
+                $documentData['value'],
+                $documentData['description'],
+                $details
+            );
+        }
+
+        return new Solarium_Result_Select_Debug_DocumentSet($docs);
+    }
+
+    /**
+     * Parse raw timing phase data into a result class
+     *
+     * @param string $name
+     * @param array $data
+     * @return Solarium_Result_Select_Debug_TimingPhase
+     */
+    protected function _parseTimingPhase($name, $data)
+    {
+        $time = 0.0;
+        $classes = array();
+        foreach ($data as $key => $timingData) {
+            switch($key) {
+                case 'time':
+                    $time = $timingData;
+                    break;
+                default:
+                    $classes[$key] = $timingData['time'];
+            }
+        }
+
+        return new Solarium_Result_Select_Debug_TimingPhase($name, $time, $classes);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Terms.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Terms.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Terms.php	(revision 7576)
@@ -0,0 +1,86 @@
+<?php
+/**
+ * Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Gasol Wu <gasol.wu@gmail.com>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse MoreLikeThis response data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Terms extends Solarium_Client_ResponseParser
+{
+
+    /**
+     * Get result data for the response
+     *
+     * @param Solarium_Result_Terms $result
+     * @return array
+     */
+    public function parse($result)
+    {
+        $termResults = array();
+
+        $data = $result->getData();
+        $field = $result->getQuery()->getFields();
+        $fields = explode(',', $field);
+        foreach ($fields as $field) {
+            $field = trim($field);
+            if (isset($data['terms'][$field])) {
+                $terms = $data['terms'][$field];
+                for ($i = 0; $i < count($terms); $i += 2) {
+                    $termResults[$field][$terms[$i]] = $terms[$i + 1];
+                }
+            }
+        }
+
+        $status = null;
+        $queryTime = null;
+        if (isset($data['responseHeader'])) {
+            $status = $data['responseHeader']['status'];
+            $queryTime = $data['responseHeader']['QTime'];
+        }
+
+        return array(
+            'status' => $status,
+            'queryTime' => $queryTime,
+            'results' => $termResults,
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Analysis/Document.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Analysis/Document.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Analysis/Document.php	(revision 7576)
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse document analysis response data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Analysis_Document extends Solarium_Client_ResponseParser_Analysis_Field
+{
+
+    /**
+     * Parse implementation
+     *
+     * @param array $data
+     * @return array
+     */
+    protected function _parseAnalysis($data)
+    {
+        $documents = array();
+        foreach ($data as $documentKey => $documentData) {
+            $fields = $this->_parseTypes($documentData);
+            $documents[] = new Solarium_Result_Analysis_List($documentKey, $fields);
+        }
+
+        return $documents;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Analysis/Field.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Analysis/Field.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Analysis/Field.php	(revision 7576)
@@ -0,0 +1,150 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse document analysis response data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Analysis_Field extends Solarium_Client_ResponseParser
+{
+
+    /**
+     * Parse response data
+     *
+     * @param Solarium_Result $result
+     * @return array
+     */
+    public function parse($result)
+    {
+        $data = $result->getData();
+
+        if (isset($data['analysis'])) {
+            $items = $this->_parseAnalysis($data['analysis']);
+        } else {
+            $items = array();
+        }
+
+        return array(
+            'status' => $data['responseHeader']['status'],
+            'queryTime' => $data['responseHeader']['QTime'],
+            'items' => $items
+        );
+    }
+
+    /**
+     * Parser
+     *
+     * @param array $data
+     * @return array
+     */
+    protected function _parseAnalysis($data)
+    {
+        $types = array();
+        foreach ($data as $documentKey => $documentData) {
+            $fields = $this->_parseTypes($documentData);
+            $types[] = new Solarium_Result_Analysis_List($documentKey, $fields);
+        }
+
+        return $types;
+    }
+
+    /**
+     * Parse analysis types and items
+     *
+     * @param array $typeData
+     * @return array
+     */
+    protected function _parseTypes($typeData)
+    {
+        $results = array();
+        foreach ($typeData as $fieldKey => $fieldData) {
+
+            $types = array();
+            foreach ($fieldData as $typeKey => $typeData) {
+
+                // fix for extra level for key fields
+                if (count($typeData) == 1) {
+                    $typeData = current($typeData);
+                }
+
+                $counter = 0;
+                $classes = array();
+                while (isset($typeData[$counter]) && isset($typeData[$counter+1])) {
+                    $class = $typeData[$counter];
+                    $analysis = $typeData[$counter+1];
+
+                    if (is_string($analysis)) {
+
+                        $item = new Solarium_Result_Analysis_Item(
+                            array(
+                                'text' => $analysis,
+                                'start' => null,
+                                'end' => null,
+                                'position' => null,
+                                'positionHistory' => null,
+                                'type' => null,
+                            )
+                        );
+
+                        $classes[] = new Solarium_Result_Analysis_List($class, array($item));
+
+                    } else {
+
+                        $items = array();
+                        foreach ($analysis as $itemData) {
+                            $items[] = new Solarium_Result_Analysis_Item($itemData);
+                        }
+
+                        $classes[] = new Solarium_Result_Analysis_List($class, $items);
+                    }
+
+                    $counter += 2;
+                }
+
+                $types[] = new Solarium_Result_Analysis_List($typeKey, $classes);
+            }
+
+            $results[] = new Solarium_Result_Analysis_Types($fieldKey, $types);
+        }
+
+        return $results;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/MoreLikeThis.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/MoreLikeThis.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/MoreLikeThis.php	(revision 7576)
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Gasol Wu <gasol.wu@gmail.com>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse MoreLikeThis response data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_MoreLikeThis extends Solarium_Client_ResponseParser_Select
+{
+
+    /**
+     * Get result data for the response
+     *
+     * @param Solarium_Result_MoreLikeThis $result
+     * @return array
+     */
+    public function parse($result)
+    {
+        $data = $result->getData();
+        $query = $result->getQuery();
+
+        $parseResult = parent::parse($result);
+        if (isset($data['interestingTerms']) && 'none' != $query->getInterestingTerms()) {
+            $terms = $data['interestingTerms'];
+            if ('details' == $query->getInterestingTerms()) {
+                $tempTerms = array();
+                for ($i = 0; $i < count($terms); $i += 2) {
+                    $tempTerms[$terms[$i]] = $terms[$i + 1];
+                }
+                $terms = $tempTerms;
+            }
+            $parseResult['interestingTerms'] = $terms;
+        }
+
+        if (isset($data['match']['docs'][0]) && true == $query->getMatchInclude()) {
+            $matchData = $data['match']['docs'][0];
+
+            $documentClass = $query->getOption('documentclass');
+            $fields = (array)$matchData;
+            $parseResult['match'] = new $documentClass($fields);
+        }
+
+        return $parseResult;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Select.php	(revision 7576)
@@ -0,0 +1,102 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse select response data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Select extends Solarium_Client_ResponseParser
+{
+
+    /**
+     * Get result data for the response
+     *
+     * @param Solarium_Result_Select $result
+     * @return array
+     */
+    public function parse($result)
+    {
+        $data = $result->getData();
+        $query = $result->getQuery();
+
+        // create document instances
+        $documentClass = $query->getOption('documentclass');
+        $documents = array();
+        if (isset($data['response']['docs'])) {
+            foreach ($data['response']['docs'] AS $doc) {
+                $fields = (array)$doc;
+                $documents[] = new $documentClass($fields);
+            }
+        }
+
+        // component results
+        $components = array();
+        $types = $query->getComponentTypes();
+        foreach ($query->getComponents() as $component) {
+            $componentParserClass = $types[$component->getType()]['responseparser'];
+            if (!empty($componentParserClass)) {
+                $componentParser = new $componentParserClass;
+                $components[$component->getType()] = $componentParser->parse($query, $component, $data);
+            }
+        }
+
+        if (isset($data['response']['numFound'])) {
+            $numFound = $data['response']['numFound'];
+        } else {
+            $numFound = null;
+        }
+
+        $status = null;
+        $queryTime = null;
+        if (isset($data['responseHeader'])) {
+            $status = $data['responseHeader']['status'];
+            $queryTime = $data['responseHeader']['QTime'];
+        }
+
+        return array(
+            'status' => $status,
+            'queryTime' => $queryTime,
+            'numfound' => $numFound,
+            'documents' => $documents,
+            'components' => $components,
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Update.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Update.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Update.php	(revision 7576)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse update response data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Update extends Solarium_Client_ResponseParser
+{
+
+    /**
+     * Parse response data
+     *
+     * @param Solarium_Result_Update $result
+     * @return array
+     */
+    public function parse($result)
+    {
+        $data = $result->getData();
+
+        $status = null;
+        $queryTime = null;
+        if (isset($data['responseHeader'])) {
+            $status = $data['responseHeader']['status'];
+            $queryTime = $data['responseHeader']['QTime'];
+        }
+
+        return array(
+            'status' => $status,
+            'queryTime' => $queryTime,
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Suggester.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Suggester.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/ResponseParser/Suggester.php	(revision 7576)
@@ -0,0 +1,98 @@
+<?php
+/**
+ * Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Gasol Wu <gasol.wu@gmail.com>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Parse Suggester response data
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_ResponseParser_Suggester extends Solarium_Client_ResponseParser
+{
+
+    /**
+     * Get result data for the response
+     *
+     * @param Solarium_Result_Terms $result
+     * @return array
+     */
+    public function parse($result)
+    {
+        $data = $result->getData();
+        $query = $result->getQuery();
+
+        $status = null;
+        $queryTime = null;
+        if (isset($data['responseHeader'])) {
+            $status = $data['responseHeader']['status'];
+            $queryTime = $data['responseHeader']['QTime'];
+        }
+
+        $suggestions = array();
+        $collation = null;
+
+        if (isset($data['spellcheck']['suggestions']) && is_array($data['spellcheck']['suggestions'])) {
+            $suggestResults = $data['spellcheck']['suggestions'];
+            $termClass = $query->getOption('termclass');
+            for ($i = 0; $i < count($suggestResults); $i += 2) {
+                $term = $suggestResults[$i];
+                $termData = $suggestResults[$i+1];
+
+                if ($term == 'collation'&& $i == count($suggestResults)-2) {
+                    $collation = $termData;
+                } else {
+                    $suggestions[$term] = new $termClass(
+                        $termData['numFound'],
+                        $termData['startOffset'],
+                        $termData['endOffset'],
+                        $termData['suggestion']
+                    );
+                }
+            }
+        }
+
+        return array(
+            'status' => $status,
+            'queryTime' => $queryTime,
+            'results' => $suggestions,
+            'collation' => $collation,
+        );
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Request.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Request.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Client/Request.php	(revision 7576)
@@ -0,0 +1,409 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+
+/**
+ * Class for describing a request
+ *
+ * @package Solarium
+ * @subpackage Client
+ */
+class Solarium_Client_Request extends Solarium_Configurable
+{
+
+    /**
+     * Request GET method
+     */
+    const METHOD_GET     = 'GET';
+
+    /**
+     * Request POST method
+     */
+    const METHOD_POST    = 'POST';
+
+    /**
+     * Request HEAD method
+     */
+    const METHOD_HEAD    = 'HEAD';
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'method' => self::METHOD_GET,
+    );
+
+    /**
+     * Request headers
+     */
+    protected $_headers = array();
+
+    /**
+     * Request params
+     *
+     * Multivalue params are supported using a multidimensional array:
+     * 'fq' => array('cat:1','published:1')
+     *
+     * @var array
+     */
+    protected $_params = array();
+
+    /**
+     * Raw POST data
+     *
+     * @var string
+     */
+    protected $_rawData;
+
+    /**
+     * Initialization hook
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'rawdata':
+                    $this->setRawData($value);
+                    break;
+                case 'param':
+                    $this->setParams($value);
+                    break;
+                case 'header':
+                    $this->setHeaders($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Set request handler
+     *
+     * @param string $handler
+     * @return Solarium_Client_Request
+     */
+    public function setHandler($handler)
+    {
+        $this->_setOption('handler', $handler);
+        return $this;
+    }
+
+    /**
+     * Get request handler
+     *
+     * @return string
+     */
+    public function getHandler()
+    {
+        return $this->getOption('handler');
+    }
+
+    /**
+     * Set request method
+     *
+     * Use one of the constants as value
+     *
+     * @param string $method
+     * @return Solarium_Client_Request
+     */
+    public function setMethod($method)
+    {
+        $this->_setOption('method', $method);
+        return $this;
+    }
+
+    /**
+     * Get request method
+     *
+     * @return string
+     */
+    public function getMethod()
+    {
+        return $this->getOption('method');
+    }
+
+    /**
+     * Get a param value
+     *
+     * @param string $key
+     * @return string|array
+     */
+    public function getParam($key)
+    {
+        if (isset($this->_params[$key])) {
+            return $this->_params[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all params
+     *
+     * @return array
+     */
+    public function getParams()
+    {
+        return $this->_params;
+    }
+
+    /**
+     * Set request params
+     *
+     * @param array $params
+     * @return Solarium_Client_Request
+     */
+    public function setParams($params)
+    {
+        $this->clearParams();
+        $this->addParams($params);
+        return $this;
+    }
+
+    /**
+     * Add a request param
+     *
+     * If you add a request param that already exists the param will be converted into a multivalue param,
+     * unless you set the overwrite param to true.
+     *
+     * Empty params are not added to the request. If you want to empty a param disable it you should use
+     * remove param instead.
+     *
+     * @param string $key
+     * @param string|array $value
+     * @param boolean $overwrite
+     * @return Solarium_Client_Request
+     */
+    public function addParam($key, $value, $overwrite = false)
+    {
+        if ($value !== null) {
+            if (!$overwrite && isset($this->_params[$key])) {
+                if (!is_array($this->_params[$key])) {
+                    $this->_params[$key] = array($this->_params[$key]);
+                }
+                $this->_params[$key][] = $value;
+            } else {
+                // not all solr handlers support 0/1 as boolean values...
+                if($value === true) $value = 'true';
+                if($value === false) $value = 'false';
+
+                $this->_params[$key] = $value;
+            }
+        }
+
+        return $this;
+    }
+
+    /**
+     * Add multiple params to the request
+     *
+     * @param array $params
+     * @param boolean $overwrite
+     * @return Solarium_Client_Request
+     */
+    public function addParams($params, $overwrite = false)
+    {
+        foreach ($params as $key => $value) {
+            $this->addParam($key, $value, $overwrite);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove a param by key
+     *
+     * @param string $key
+     * @return Solarium_Client_Request
+     */
+    public function removeParam($key)
+    {
+        if (isset($this->_params[$key])) {
+            unset($this->_params[$key]);
+        }
+        return $this;
+    }
+
+    /**
+     * Clear all request params
+     *
+     * @return Solarium_Client_Request
+     */
+    public function clearParams()
+    {
+        $this->_params = array();
+        return $this;
+    }
+
+    /**
+     * Get raw POST data
+     *
+     * @return null
+     */
+    public function getRawData()
+    {
+        return $this->_rawData;
+    }
+
+    /**
+     * Set raw POST data
+     *
+     * This string must be safely encoded.
+     *
+     * @param string $data
+     * @return Solarium_Client_Request
+     */
+    public function setRawData($data)
+    {
+        $this->_rawData = $data;
+        return $this;
+    }
+
+    /**
+     * Get all request headers
+     *
+     * @return array
+     */
+    public function getHeaders()
+    {
+        return $this->_headers;
+    }
+
+    /**
+     * Set request headers
+     *
+     * @param array $headers
+     * @return Solarium_Client_Request
+     */
+    public function setHeaders($headers)
+    {
+        $this->clearHeaders();
+        $this->addHeaders($headers);
+        return $this;
+    }
+
+    /**
+     * Add a request header
+     *
+     * @param string|array $value
+     * @return Solarium_Client_Request
+     */
+    public function addHeader($value)
+    {
+        $this->_headers[] = $value;
+
+        return $this;
+    }
+
+    /**
+     * Add multiple headers to the request
+     *
+     * @param array $headers
+     * @return Solarium_Client_Request
+     */
+    public function addHeaders($headers)
+    {
+        foreach ($headers as $header) {
+            $this->addHeader($header);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Clear all request headers
+     *
+     * @return Solarium_Client_Request
+     */
+    public function clearHeaders()
+    {
+        $this->_headers = array();
+        return $this;
+    }
+
+    /**
+     * Get an URI for this request
+     *
+     * @return string
+     */
+    public function getUri()
+    {
+        return $this->getHandler() . '?' . $this->getQueryString();
+    }
+
+    /**
+     * Get the query string for this request
+     *
+     * @return string
+     */
+    public function getQueryString()
+    {
+        $queryString = '';
+        if (count($this->_params) > 0) {
+            $queryString = http_build_query($this->_params, null, '&');
+            $queryString = preg_replace(
+                '/%5B(?:[0-9]|[1-9][0-9]+)%5D=/',
+                '=',
+                $queryString
+            );
+        }
+
+        return $queryString;
+    }
+
+    /**
+     * Magic method enables a object to be transformed to a string
+     *
+     * Get a summary showing significant variables in the object
+     * note: uri resource is decoded for readability
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        $output = __CLASS__ . '::toString' . "\n"
+                . 'method: ' . $this->getMethod() . "\n"
+                . 'header: ' . print_r($this->getHeaders(), 1) //don't add newline when using print_r
+                . 'resource: ' . $this->getUri() . "\n"
+                . 'resource urldecoded: ' . urldecode($this->getUri()) . "\n"
+                . 'raw data: ' . $this->getRawData() . "\n";
+
+        return $output;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Document/ReadOnly.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Document/ReadOnly.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Document/ReadOnly.php	(revision 7576)
@@ -0,0 +1,179 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Document
+ */
+
+/**
+ * Read-only Solr document
+ *
+ * This is the default Solr document type returned by a select query. You can
+ * access the fields as object properties or iterate over all fields.
+ *
+ * @package Solarium
+ * @subpackage Document
+ */
+class Solarium_Document_ReadOnly
+    implements IteratorAggregate, Countable, ArrayAccess
+{
+
+    /**
+     * All fields in this document
+     *
+     * @var array
+     */
+    protected $_fields;
+
+
+    /**
+     * Constructor
+     *
+     * @param array $fields
+     */
+    public function __construct(array $fields)
+    {
+        $this->_fields = $fields;
+    }
+
+
+    /**
+     * Get all fields
+     *
+     * @return array
+     */
+    public function getFields()
+    {
+        return $this->_fields;
+    }
+
+    /**
+     * Get field value by name
+     *
+     * Magic access method for accessing fields as properties of this document
+     * object, by field name.
+     *
+     * @param string $name
+     * @return mixed
+     */
+    public function __get($name)
+    {
+        if (!isset($this->_fields[$name])) {
+            return null;
+        }
+
+        return $this->_fields[$name];
+    }
+    
+    /**
+     * Set field value
+     *
+     * Magic method for setting a field as property of this object. Since this
+     * is a readonly document an exception will be thrown to prevent this.
+     *
+     * @param string $name
+     * @param string $value
+     * @return void
+     */
+    public function __set($name, $value)
+    {
+        throw new Solarium_Exception('A readonly document cannot be altered');
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_fields);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_fields);
+    }
+
+    /**
+     * ArrayAccess implementation
+     *
+     * @param miex $offset
+     * @param mixed $value
+     * @return void
+     */
+    public function offsetSet($offset, $value)
+    {
+        $this->__set($offset, $value);
+    }
+
+    /**
+     * ArrayAccess implementation
+     *
+     * @param mixed $offset
+     * @return bool
+     */
+    public function offsetExists($offset)
+    {
+        return ($this->__get($offset) !== null);
+    }
+
+    /**
+     * ArrayAccess implementation
+     *
+     * @param mixed $offset
+     * @return void
+     */
+    public function offsetUnset($offset)
+    {
+        $this->__set($offset, null);
+    }
+
+    /**
+     * ArrayAccess implementation
+     *
+     * @param mixed $offset
+     * @return mixed|null
+     */
+    public function offsetGet($offset)
+    {
+        return $this->__get($offset);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Document/ReadWrite.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Document/ReadWrite.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Document/ReadWrite.php	(revision 7576)
@@ -0,0 +1,252 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Document
+ */
+
+/**
+ * Read/Write Solr document
+ *
+ * This document type is used for update queries. It has all of the features of
+ * the readonly document and it also allows for updating or adding fields and
+ * boosts.
+ *
+ * While it is possible to use this document type for a select, alter it and use
+ * it in an update query (effectively the 'edit' that Solr doesn't have) this
+ * is not recommended. Most Solr indexes have fields that are indexed and not
+ * stored. You will loose that data because it is impossible to retrieve it from
+ * Solr. Always update from the original data source.
+ *
+ * @package Solarium
+ * @subpackage Document
+ */
+class Solarium_Document_ReadWrite extends Solarium_Document_ReadOnly
+{
+
+    /**
+     * Document boost value
+     *
+     * @var float
+     */
+    protected $_boost = null;
+
+    /**
+     * Field boosts
+     *
+     * Using fieldname as the key and the boost as the value
+     * 
+     * @var array
+     */
+    protected $_fieldBoosts;
+
+    /**
+     * Constructor
+     *
+     * @param array $fields
+     * @param array $boosts
+     */
+    public function __construct($fields = array(), $boosts = array())
+    {
+        $this->_fields = $fields;
+        $this->_fieldBoosts = $boosts;
+    }
+
+    /**
+     * Add a field value
+     *
+     * If a field already has a value it will be converted
+     * to a multivalue field.
+     *
+     * @param string $key
+     * @param mixed $value
+     * @param float $boost
+     * @return Solarium_Document_ReadWrite Provides fluent interface
+     */
+    public function addField($key, $value, $boost = null)
+    {
+        if (!isset($this->_fields[$key])) {
+            $this->setField($key, $value, $boost);
+        } else {
+            // convert single value to array if needed
+            if (!is_array($this->_fields[$key])) {
+                $this->_fields[$key] = array($this->_fields[$key]);
+            }
+
+            $this->_fields[$key][] = $value;
+            $this->setFieldBoost($key, $boost);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Set a field value
+     *
+     * If a field already has a value it will be overwritten. You cannot use
+     * this method for a multivalue field.
+     * If you supply NULL as the value the field will be removed
+     *
+     * @param string $key
+     * @param mixed $value
+     * @param float $boost
+     * @return Solarium_Document_ReadWrite Provides fluent interface
+     */
+    public function setField($key, $value, $boost = null)
+    {
+        if ($value === null) {
+            $this->removeField($key);
+        } else {
+            $this->_fields[$key] = $value;
+            $this->setFieldBoost($key, $boost);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove a field
+     *
+     * @param string $key
+     * @return Solarium_Document_ReadWrite Provides fluent interface
+     */
+    public function removeField($key)
+    {
+        if (isset($this->_fields[$key])) {
+            unset($this->_fields[$key]);
+        }
+
+        if (isset($this->_fieldBoosts[$key])) {
+            unset($this->_fieldBoosts[$key]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Get the boost value for a field
+     *
+     * @param string $key
+     * @return float
+     */
+    public function getFieldBoost($key)
+    {
+        if (isset($this->_fieldBoosts[$key])) {
+            return $this->_fieldBoosts[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Set the boost value for a field
+     *
+     * @param string $key
+     * @param float $boost
+     * @return Solarium_Document_ReadWrite Provides fluent interface
+     */
+    public function setFieldBoost($key, $boost)
+    {
+        $this->_fieldBoosts[$key] = $boost;
+        return $this;
+    }
+
+    /**
+     * Set the document boost value
+     *
+     * @param float $boost
+     * @return Solarium_Document_ReadWrite Provides fluent interface
+     */
+    public function setBoost($boost)
+    {
+        $this->_boost = $boost;
+        return $this;
+    }
+
+    /**
+     * Get the document boost value
+     *
+     * @return float
+     */
+    public function getBoost()
+    {
+        return $this->_boost;
+    }
+
+    /**
+     * Clear all fields
+     *
+     * @return Solarium_Document_ReadWrite Provides fluent interface
+     **/
+    public function clear()
+    {
+        $this->_fields = array();
+        $this->_fieldBoosts = array();
+        
+        return $this;
+    }
+
+    /**
+     * Set field value
+     *
+     * Magic method for setting fields as properties of this document
+     * object, by field name.
+     *
+     * If you supply NULL as the value the field will be removed
+     * If you supply an array a multivalue field will be created.
+     * In all cases any existing (multi)value will be overwritten.
+     *
+     * @param string $name
+     * @param string|null $value
+     * @return void
+     */
+    public function __set($name, $value)
+    {
+        $this->setField($name, $value);
+    }
+
+    /**
+     * Unset field value
+     *
+     * Magic method for removing fields by unsetting object properties
+     *
+     * @param string $name
+     * @return void
+     */
+    public function __unset($name)
+    {
+        $this->removeField($name);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/PrefetchIterator.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/PrefetchIterator.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/PrefetchIterator.php	(revision 7576)
@@ -0,0 +1,219 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * Prefetch plugin
+ *
+ * This plugin can be used to create an 'endless' iterator over a complete resultset. The iterator will take care of
+ * fetching the data in sets (sequential prefetching).
+ *
+ * @package Solarium
+ * @subpackage Plugin
+ */
+class Solarium_Plugin_PrefetchIterator extends Solarium_Plugin_Abstract implements Iterator, Countable
+{
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'prefetch' => 100,
+    );
+
+    /**
+     * Query instance to execute
+     *
+     * @var Solarium_Query_Select
+     */
+    protected $_query;
+
+    /**
+     * Start position (offset)
+     *
+     * @var int
+     */
+    protected $_start = 0;
+
+    /**
+     * Last resultset from the query instance
+     *
+     * @var Solarium_Result_Select
+     */
+    protected $_result;
+
+    /**
+     * Iterator position
+     *
+     * @var int
+     */
+    protected $_position;
+
+    /**
+     * Documents from the last resultset
+     *
+     * @var array
+     */
+    protected $_documents;
+
+    /**
+     * Set prefetch option
+     *
+     * @param integer $value
+     * @return self Provides fluent interface
+     */
+    public function setPrefetch($value)
+    {
+        return $this->_setOption('prefetch', $value);
+    }
+
+    /**
+     * Get prefetch option
+     *
+     * @return integer
+     */
+    public function getPrefetch()
+    {
+        return $this->getOption('prefetch');
+    }
+
+    /**
+     * Set query to use for prefetching
+     *
+     * @param Solarium_Query_Select $query
+     * @return self Provides fluent interface
+     */
+    public function setQuery($query)
+    {
+        $this->_query = $query;
+        return $this;
+    }
+
+    /**
+     * Get the query object used
+     *
+     * @return Solarium_Query_Select
+     */
+    public function getQuery()
+    {
+        return $this->_query;
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        // if no results are available yet, get them now
+        if (null == $this->_result) $this->_fetchNext();
+
+        return $this->_result->getNumFound();
+    }
+
+    /**
+     * Iterator implementation
+     */
+    function rewind()
+    {
+        $this->_position = 0;
+
+        // this condition prevent useless re-fetching of data if a count is done before the iterator is used
+        if ($this->_start !== $this->_options['prefetch']) {
+            $this->_start = 0;
+        }
+    }
+
+    /**
+     * Iterator implementation
+     */
+    function current()
+    {
+        $adjustedIndex = $this->_position % $this->_options['prefetch'];
+        return $this->_documents[$adjustedIndex];
+    }
+
+    /**
+     * Iterator implementation
+     *
+     * @return int
+     */
+    function key()
+    {
+        return $this->_position;
+    }
+
+    /**
+     * Iterator implementation
+     */
+    function next()
+    {
+        ++$this->_position;
+    }
+
+    /**
+     * Iterator implementation
+     *
+     * @return boolean
+     */
+    function valid()
+    {
+        $adjustedIndex = $this->_position % $this->_options['prefetch'];
+
+        // this condition prevent useless re-fetching of data if a count is done before the iterator is used
+        if ($adjustedIndex == 0 && ($this->_position !== 0 || null == $this->_result)) {
+            $this->_fetchNext();
+        }
+
+        return isset($this->_documents[$adjustedIndex]);
+    }
+
+    /**
+     * Fetch the next set of results
+     *
+     * @return void
+     */
+    protected function _fetchNext()
+    {
+        $this->_query->setStart($this->_start)->setRows($this->getPrefetch());
+        $this->_result = $this->_client->execute($this->_query);
+        $this->_documents = $this->_result->getDocuments();
+        $this->_start += $this->getPrefetch();
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/BufferedAdd.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/BufferedAdd.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/BufferedAdd.php	(revision 7576)
@@ -0,0 +1,227 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * Buffered add plugin
+ *
+ * If you need to add (or update) a big number of documents to Solr it's much more efficient to do so in batches.
+ * This plugin makes this as easy as possible.
+ *
+ * @package Solarium
+ * @subpackage Plugin
+ */
+class Solarium_Plugin_BufferedAdd extends Solarium_Plugin_Abstract
+{
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'buffersize' => 100,
+    );
+
+    /**
+     * Update query instance
+     *
+     * @var Solarium_Query_Update
+     */
+    protected $_updateQuery;
+
+    /**
+     * Buffered documents
+     *
+     * @var array
+     */
+    protected $_buffer = array();
+
+    /**
+     * Plugin init function
+     *
+     * This is an extension point for plugin implementations.
+     * Will be called as soon as $this->_client and options have been set.
+     *
+     * @return void
+     */
+    protected function _initPlugin()
+    {
+        $this->_updateQuery = $this->_client->createUpdate();
+    }
+
+    /**
+     * Set buffer size option
+     *
+     * @param int $size
+     * @return Solarium_Configurable
+     */
+    public function setBufferSize($size)
+    {
+        return $this->_setOption('buffersize', $size);
+    }
+
+    /**
+     * Get buffer size option value
+     *
+     * @return int
+     */
+    public function getBufferSize()
+    {
+        return $this->getOption('buffersize');
+    }
+
+    /**
+     * Create a document object instance and add it to the buffer
+     *
+     * @param array $fields
+     * @param array $boosts
+     * @return self Provides fluent interface
+     */
+    public function createDocument($fields, $boosts = array())
+    {
+        $doc = $this->_updateQuery->createDocument($fields, $boosts);
+        $this->addDocument($doc);
+
+        return $this;
+    }
+
+    /**
+     * Add a document
+     *
+     * @param Solarium_Document_ReadOnly $document
+     * @return self Provides fluent interface
+     */
+    public function addDocument($document)
+    {
+        $this->_buffer[] = $document;
+        if (count($this->_buffer) == $this->_options['buffersize']) {
+            $this->flush();
+        }
+
+        return $this;
+    }
+
+    /**
+     * Add multiple documents
+     *
+     * @param array
+     * @return self Provides fluent interface
+     */
+    public function addDocuments($documents)
+    {
+        foreach ($documents as $document) {
+            $this->addDocument($document);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Get all documents currently in the buffer
+     *
+     * Any previously flushed documents will not be included!
+     *
+     * @return array
+     */
+    public function getDocuments()
+    {
+        return $this->_buffer;
+    }
+
+    /**
+     * Clear any buffered documents
+     *
+     * @return self Provides fluent interface
+     */
+    public function clear()
+    {
+        $this->_updateQuery = $this->_client->createUpdate();
+        $this->_buffer = array();
+        return $this;
+    }
+
+    /**
+     * Flush any buffered documents to Solr
+     *
+     * @param boolean $overwrite
+     * @param int $commitWithin
+     * @return boolean|Solarium_Result_Update
+     */
+    public function flush($overwrite = null, $commitWithin = null)
+    {
+        if (count($this->_buffer) == 0) {
+            // nothing to do
+            return false;
+        }
+
+        $this->_client->triggerEvent('BufferedAddFlushStart', array($this->_buffer));
+
+        $this->_updateQuery->addDocuments($this->_buffer, $overwrite, $commitWithin);
+        $result = $this->_client->update($this->_updateQuery);
+        $this->clear();
+
+        $this->_client->triggerEvent('BufferedAddFlushEnd', array($result));
+
+        return $result;
+    }
+
+    /**
+     * Commit changes
+     *
+     * Any remaining documents in the buffer will also be flushed
+     *
+     * @param boolean $overwrite
+     * @param boolean $waitFlush
+     * @param boolean $waitSearcher
+     * @param boolean $expungeDeletes
+     * @return Solarium_Result_Update
+     */
+    public function commit($overwrite = null, $waitFlush = null, $waitSearcher = null, $expungeDeletes = null)
+    {
+        $this->_client->triggerEvent('BufferedAddCommitStart', array($this->_buffer));
+
+        $this->_updateQuery->addDocuments($this->_buffer, $overwrite);
+        $this->_updateQuery->addCommit($waitFlush, $waitSearcher, $expungeDeletes);
+        $result = $this->_client->update($this->_updateQuery);
+        $this->clear();
+
+        $this->_client->triggerEvent('BufferedAddCommitEnd', array($result));
+
+        return $result;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/CustomizeRequest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/CustomizeRequest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/CustomizeRequest.php	(revision 7576)
@@ -0,0 +1,265 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * CustomizeRequest plugin
+ *
+ * You can use this plugin to customize the requests generated for Solarium queries by adding or overwriting
+ * params and/or headers.
+ *
+ * @package Solarium
+ * @subpackage Plugin
+ */
+class Solarium_Plugin_CustomizeRequest extends Solarium_Plugin_Abstract
+{
+
+    /**
+     * Holds customizations added to this plugin
+     *
+     * @var array
+     */
+    protected $_customizations = array();
+
+    /**
+     * Initialize options
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'customization':
+                    $this->addCustomizations($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Create a Customization instance
+     *
+     * If you supply a string as the first arguments ($options) it will be used as the key for the Customization
+     * and it will be added to this plugin.
+     * If you supply an options array/object that contains a key the Customization will also be added to the plugin.
+     *
+     * When no key is supplied the Customization cannot be added, in that case you will need to add it manually
+     * after setting the key, by using the addCustomization method.
+     *
+     * @param mixed $options
+     * @return Solarium_Plugin_CustomizeRequest_Customization
+     */
+    public function createCustomization($options = null)
+    {
+        if (is_string($options)) {
+            $fq = new Solarium_Plugin_CustomizeRequest_Customization;
+            $fq->setKey($options);
+        } else {
+            $fq = new Solarium_Plugin_CustomizeRequest_Customization($options);
+        }
+
+        if ($fq->getKey() !== null) {
+            $this->addCustomization($fq);
+        }
+
+        return $fq;
+    }
+
+    /**
+     * Add a customization
+     *
+     * Supports a Customization instance or a config array, in that case a new
+     * Customization instance wil be created based on the options.
+     *
+     * @param Solarium_Plugin_CustomizeRequest_Customization|array $customization
+     * @return Solarium_Plugin_CustomizeRequest Provides fluent interface
+     */
+    public function addCustomization($customization)
+    {
+        if (is_array($customization)) {
+            $customization = new Solarium_Plugin_CustomizeRequest_Customization($customization);
+        }
+
+        $key = $customization->getKey();
+
+        // check for non-empty key
+        if (0 === strlen($key)) {
+            throw new Solarium_Exception('A Customization must have a key value');
+        }
+
+        // check for a unique key
+        if (array_key_exists($key, $this->_customizations)) {
+            //double add calls for the same customization are ignored, others cause an exception
+            if ($this->_customizations[$key] !== $customization) {
+                throw new Solarium_Exception('A Customization must have a unique key value');
+            }
+        }
+
+        $this->_customizations[$key] = $customization;
+
+        return $this;
+    }
+
+    /**
+     * Add multiple Customizations
+     *
+     * @param array $customizations
+     * @return Solarium_Plugin_CustomizeRequest Provides fluent interface
+     */
+    public function addCustomizations(array $customizations)
+    {
+        foreach ($customizations AS $key => $customization) {
+
+            // in case of a config array: add key to config
+            if (is_array($customization) && !isset($customization['key'])) {
+                $customization['key'] = $key;
+            }
+
+            $this->addCustomization($customization);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Get a Customization
+     *
+     * @param string $key
+     * @return string
+     */
+    public function getCustomization($key)
+    {
+        if (isset($this->_customizations[$key])) {
+            return $this->_customizations[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all Customizations
+     *
+     * @return array
+     */
+    public function getCustomizations()
+    {
+        return $this->_customizations;
+    }
+
+    /**
+     * Remove a single Customization
+     *
+     * You can remove a Customization by passing it's key, or by passing the Customization instance
+     *
+     * @param string|Solarium_Plugin_CustomizeRequest_Customization $customization
+     * @return Solarium_Plugin_CustomizeRequest Provides fluent interface
+     */
+    public function removeCustomization($customization)
+    {
+        if (is_object($customization)) {
+            $customization = $customization->getKey();
+        }
+
+        if (isset($this->_customizations[$customization])) {
+            unset($this->_customizations[$customization]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Remove all Customizations
+     *
+     * @return Solarium_Plugin_CustomizeRequest Provides fluent interface
+     */
+    public function clearCustomizations()
+    {
+        $this->_customizations = array();
+        return $this;
+    }
+
+    /**
+     * Set multiple Customizations
+     *
+     * This overwrites any existing Customizations
+     *
+     * @param array $customizations
+     */
+    public function setCustomizations($customizations)
+    {
+        $this->clearCustomizations();
+        $this->addCustomizations($customizations);
+    }
+
+    /**
+     * Event hook to customize the request object
+     *
+     * @param Solarium_Query $query
+     * @param Solarium_Client_Request $request
+     * @return void
+     */
+    public function postCreateRequest($query, $request)
+    {
+        foreach ($this->getCustomizations() as $key => $customization) {
+
+            // first validate
+            if (!$customization->isValid()) {
+                throw new Solarium_Exception('Request customization with key "' . $key . '" is invalid');
+            }
+
+            // apply to request, depending on type
+            switch ($customization->getType()) {
+                case Solarium_Plugin_CustomizeRequest_Customization::TYPE_PARAM:
+                    $request->addParam(
+                        $customization->getName(),
+                        $customization->getValue(),
+                        $customization->getOverwrite()
+                    );
+                    break;
+                case Solarium_Plugin_CustomizeRequest_Customization::TYPE_HEADER:
+                    $request->addHeader($customization->getName() . ': ' . $customization->getValue());
+                    break;
+            }
+
+            // remove single-use customizations after use
+            if (!$customization->getPersistent()) {
+                $this->removeCustomization($key);
+            }
+        }
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/ParallelExecution.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/ParallelExecution.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/ParallelExecution.php	(revision 7576)
@@ -0,0 +1,178 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * ParallelExecution plugin
+ *
+ * You can use this plugin to run multiple queries parallel. This functionality depends on the curl adapter so you
+ * do need to have curl available in your PHP environment.
+ *
+ * While query execution is parallel, the results only become available as soon as all requests have finished. So the
+ * time of the slowest query will be the effective execution time for all queries.
+ *
+ * @package Solarium
+ * @subpackage Plugin
+ */
+
+class Solarium_Plugin_ParallelExecution extends Solarium_Plugin_Abstract
+{
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'curlmultiselecttimeout' => 0.1,
+    );
+
+    /**
+     * Queries (and optionally clients) to execute
+     *
+     * @var array
+     */
+    protected $_queries = array();
+
+    /**
+     * Add a query to execute
+     *
+     * @param string $key
+     * @param Solarium_Query $query
+     * @param null|Solarium_Client $client
+     * @return Solarium_Plugin_ParallelExecution
+     */
+    public function addQuery($key, $query, $client = null)
+    {
+        if($client == null) $client = $this->_client;
+
+        $this->_queries[$key] = array(
+            'query' => $query,
+            'client' => $client,
+        );
+
+        return $this;
+    }
+
+    /**
+     * Get queries (and coupled client instances)
+     *
+     * @return array
+     */
+    public function getQueries()
+    {
+        return $this->_queries;
+    }
+
+    /**
+     * Clear all queries
+     *
+     * @return self Provides fluent interface
+     */
+    public function clearQueries()
+    {
+        $this->_queries = array();
+        return $this;
+    }
+
+    // @codeCoverageIgnoreStart
+
+    /**
+     * Execute queries parallel
+     *
+     * Use an array of Solarium_Query objects as input. The keys of the array are important, as they are also used in
+     * the result array. You can mix all querytypes in the input array.
+     *
+     * @param array $queries (deprecated, use addQuery instead)
+     * @return array
+     */
+    public function execute($queries = null)
+    {
+        // this is for backwards compatibility
+        if (is_array($queries)) {
+            foreach ($queries as $key => $query) {
+                $this->addQuery($key, $query);
+            }
+        }
+
+        // create handles and add all handles to the multihandle
+        $multiHandle = curl_multi_init();
+        $handles = array();
+        foreach ($this->_queries as $key => $data) {
+            $request = $this->_client->createRequest($data['query']);
+            $adapter = $data['client']->setAdapter('Solarium_Client_Adapter_Curl')->getAdapter();
+            $handle = $adapter->createHandle($request);
+            curl_multi_add_handle($multiHandle, $handle);
+            $handles[$key] = $handle;
+        }
+
+        // executing multihandle (all requests)
+        $this->_client->triggerEvent('ParallelExecutionStart');
+
+        do {
+            $mrc = curl_multi_exec($multiHandle, $active);
+        } while ($mrc == CURLM_CALL_MULTI_PERFORM);
+
+        $timeout = $this->getOption('curlmultiselecttimeout');
+        while ($active && $mrc == CURLM_OK) {
+            if (curl_multi_select($multiHandle, $timeout) != -1) {
+                do {
+                    $mrc = curl_multi_exec($multiHandle, $active);
+                } while ($mrc == CURLM_CALL_MULTI_PERFORM);
+            }
+        }
+
+        $this->_client->triggerEvent('ParallelExecutionEnd');
+
+        // get the results
+        $results = array();
+        foreach ($handles as $key => $handle) {
+            try {
+                curl_multi_remove_handle($multiHandle, $handle);
+                $response = $adapter->getResponse($handle, curl_multi_getcontent($handle));
+                $results[$key] = $this->_client->createResult($this->_queries[$key]['query'], $response);
+            } catch(Solarium_Client_HttpException $e) {
+                $results[$key] = $e;
+            }
+        }
+
+        curl_multi_close($multiHandle);
+
+        return $results;
+    }
+
+    // @codeCoverageIgnoreEnd
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/PostBigRequest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/PostBigRequest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/PostBigRequest.php	(revision 7576)
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * PostBigRequest plugin
+ *
+ * If you reach the url/header length limit of your servlet container your queries will fail.
+ * You can increase the limit in the servlet container, but if that's not possible this plugin can automatically
+ * convert big GET requests into POST requests. A POST request (usually) has a much higher limit.
+ *
+ * The default maximum querystring length is 1024. This doesn't include the base url or headers.
+ * For most servlet setups this limit leaves enough room for that extra data. Adjust the limit if needed.
+ *
+ * @package Solarium
+ * @subpackage Plugin
+ */
+class Solarium_Plugin_PostBigRequest extends Solarium_Plugin_Abstract
+{
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'maxquerystringlength' => 1024,
+    );
+
+    /**
+     * Set maxquerystringlength enabled option
+     *
+     * @param integer $value
+     * @return self Provides fluent interface
+     */
+    public function setMaxQueryStringLength($value)
+    {
+        return $this->_setOption('maxquerystringlength', $value);
+    }
+
+    /**
+     * Get maxquerystringlength option
+     *
+     * @return integer
+     */
+    public function getMaxQueryStringLength()
+    {
+        return $this->getOption('maxquerystringlength');
+    }
+
+    /**
+     * Event hook to adjust client settings just before query execution
+     *
+     * @param Solarium_Query $query
+     * @param Solarium_Client_Request $request
+     * @return void
+     */
+    public function postCreateRequest($query, $request)
+    {
+        $queryString = $request->getQueryString();
+        if ($request->getMethod() == Solarium_Client_Request::METHOD_GET &&
+            strlen($queryString) > $this->getMaxQueryStringLength()) {
+
+            $request->setMethod(Solarium_Client_Request::METHOD_POST);
+            $request->setRawData($queryString);
+            $request->clearParams();
+            $request->addHeader('Content-Type: application/x-www-form-urlencoded');
+        }
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/Loadbalancer/WeightedRandomChoice.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/Loadbalancer/WeightedRandomChoice.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/Loadbalancer/WeightedRandomChoice.php	(revision 7576)
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * Weighted random choice class
+ *
+ * For use in the loadbalancer plugin
+ *
+ * @package Solarium
+ * @subpackage Plugin
+ */
+class Solarium_Plugin_Loadbalancer_WeightedRandomChoice
+{
+
+    /**
+     * Total weight of all choices
+     *
+     * @var int
+     */
+    protected $_totalWeight = 0;
+
+    /**
+     * Choices total lookup array
+     *
+     * @var array
+     */
+    protected $_lookup = array();
+
+    /**
+     * Values lookup array
+     *
+     * @var array
+     */
+    protected $_values = array();
+
+    /**
+     * Constructor
+     *
+     * @param array $choices
+     */
+    public function __construct($choices)
+    {
+        $i = 0;
+        foreach ($choices AS $key => $weight) {
+            if ($weight <=0) throw new Solarium_Exception('Weight must be greater than zero');
+
+            $this->_totalWeight += $weight;
+            $this->_lookup[$i] = $this->_totalWeight;
+            $this->_values[$i] = $key;
+
+            $i++;
+        }
+    }
+
+    /**
+     * Get a (weighted) random entry
+     *
+     * @param array $excludes Keys to exclude
+     * @return string
+     */
+    public function getRandom($excludes = array())
+    {
+        if (count($excludes) == count($this->_values)) {
+            throw new Solarium_Exception('No more server entries available');
+        }
+
+        // continue until a non-excluded value is found
+        // @todo optimize?
+        $result = null;
+        while (1) {
+            $result = $this->_values[$this->_getKey()];
+            if(!in_array($result, $excludes)) break;
+        }
+
+        return $result;
+    }
+
+    /**
+     * Get a (weighted) random entry key
+     *
+     * @return int
+     */
+    protected function _getKey()
+    {
+        $random = mt_rand(1, $this->_totalWeight);
+        $high = count($this->_lookup)-1;
+        $low = 0;
+
+        while ( $low < $high ) {
+            $probe = (int)(($high + $low) / 2);
+            if ($this->_lookup[$probe] < $random) {
+                $low = $probe + 1;
+            } else if ($this->_lookup[$probe] > $random) {
+                $high = $probe - 1;
+            } else {
+                return $probe;
+            }
+        }
+
+        if ($this->_lookup[$low] >= $random) {
+            return $low;
+        } else {
+            return $low+1;
+        }
+
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/Abstract.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/Abstract.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/Abstract.php	(revision 7576)
@@ -0,0 +1,192 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * Base class for plugins
+ *
+ * @package Solarium
+ * @subpackage Plugin
+ */
+abstract class Solarium_Plugin_Abstract extends Solarium_Configurable
+{
+
+    /**
+     * Client instance
+     *
+     * @var Solarium_Client
+     */
+    protected $_client;
+
+    /**
+     * Initialize
+     *
+     * This method is called when the plugin is registered to a client instance
+     *
+     * @param Solarium_Client $client
+     * @param array $options
+     */
+    public function init($client, $options)
+    {
+        $this->_client = $client;
+        parent::__construct($options);
+
+        $this->_initPlugin();
+    }
+
+    /**
+     * Plugin init function
+     *
+     * This is an extension point for plugin implementations.
+     * Will be called as soon as $this->_client and options have been set.
+     *
+     * @return void
+     */
+    protected function _initPlugin()
+    {
+
+    }
+
+    /**
+     * preCreateRequest hook
+     *
+     * @param Solarium_Query $query
+     * @return void|Solarium_Client_Request
+     */
+    public function preCreateRequest($query)
+    {
+    }
+
+    /**
+     * postCreateRequest hook
+     *
+     * @param Solarium_Query $query
+     * @param Solarium_Client_Request $request
+     * @return void
+     */
+    public function postCreateRequest($query, $request)
+    {
+    }
+
+    /**
+     * preExecuteRequest hook
+     *
+     * @param Solarium_Client_Request $request
+     * @return void|Solarium_Client_Response
+     */
+    public function preExecuteRequest($request)
+    {
+    }
+
+    /**
+     * postExecuteRequest hook
+     *
+     * @param Solarium_Client_Request $request
+     * @param Solarium_Client_Response $response
+     * @return void
+     */
+    public function postExecuteRequest($request, $response)
+    {
+    }
+
+    /**
+     * preCreateResult hook
+     *
+     * @param Solarium_Query $query
+     * @param Solarium_Client_Response $response
+     * @return void|Solarium_Result
+     */
+    public function preCreateResult($query, $response)
+    {
+    }
+
+    /**
+     * postCreateResult hook
+     *
+     * @param Solarium_Query $query
+     * @param Solarium_Client_Response $response
+     * @param Solarium_Result $result
+     * @return void
+     */
+    public function postCreateResult($query, $response, $result)
+    {
+    }
+
+    /**
+     * preExecute hook
+     *
+     * @param Solarium_Query $query
+     * @return void|Solarium_Result
+     */
+    public function preExecute($query)
+    {
+    }
+
+    /**
+     * postExecute hook
+     *
+     * @param Solarium_Query $query
+     * @param Solarium_Result $result
+     * @return void
+     */
+    public function postExecute($query, $result)
+    {
+    }
+
+    /**
+     * preCreateQuery hook
+     *
+     * @param string $type
+     * @param mixed $options
+     * @return void|Solarium_Query
+     */
+    public function preCreateQuery($type, $options)
+    {
+    }
+
+    /**
+     * postCreateQuery hook
+     *
+     * @param string $type
+     * @param mixed $options
+     * @param Solarium_Query
+     * @return void
+     */
+    public function postCreateQuery($type, $options, $query)
+    {
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/CustomizeRequest/Customization.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/CustomizeRequest/Customization.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/CustomizeRequest/Customization.php	(revision 7576)
@@ -0,0 +1,218 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * Customization value object
+ *
+ * @package Solarium
+ * @subpackage Plugin
+ */
+class Solarium_Plugin_CustomizeRequest_Customization extends Solarium_Configurable
+{
+
+    /**
+     * Type definition for params
+     */
+    const TYPE_PARAM = 'param';
+
+    /**
+     * Type definition for headers
+     */
+    const TYPE_HEADER = 'header';
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'key' => null,
+        'type' => null,
+        'name' => null,
+        'value' => null,
+        'persistent' => false,
+        'overwrite' => true,
+    );
+
+    /**
+     * Set key value
+     *
+     * @param string $value
+     * @return Solarium_Plugin_CustomizeRequest_Customization
+     */
+    public function setKey($value)
+    {
+        $this->_setOption('key', $value);
+        return $this;
+    }
+
+    /**
+     * Get key value
+     *
+     * @return string
+     */
+    public function getKey()
+    {
+        return $this->getOption('key');
+    }
+
+    /**
+     * Set type value
+     *
+     * @param string $value
+     * @return Solarium_Plugin_CustomizeRequest_Customization
+     */
+    public function setType($value)
+    {
+        $this->_setOption('type', $value);
+        return $this;
+    }
+
+    /**
+     * Get type value
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return $this->getOption('type');
+    }
+
+    /**
+     * Set name value
+     *
+     * @param string $value
+     * @return Solarium_Plugin_CustomizeRequest_Customization
+     */
+    public function setName($value)
+    {
+        $this->_setOption('name', $value);
+        return $this;
+    }
+
+    /**
+     * Get name value
+     *
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->getOption('name');
+    }
+
+    /**
+     * Set value
+     *
+     * @param string $value
+     * @return Solarium_Plugin_CustomizeRequest_Customization
+     */
+    public function setValue($value)
+    {
+        $this->_setOption('value', $value);
+        return $this;
+    }
+
+    /**
+     * Get value
+     *
+     * @return string
+     */
+    public function getValue()
+    {
+        return $this->getOption('value');
+    }
+
+    /**
+     * Set persistent on/off
+     *
+     * @param boolean $value
+     * @return Solarium_Plugin_CustomizeRequest_Customization
+     */
+    public function setPersistent($value)
+    {
+        $this->_setOption('persistent', $value);
+        return $this;
+    }
+
+    /**
+     * Get persistent setting
+     *
+     * @return boolean
+     */
+    public function getPersistent()
+    {
+        return $this->getOption('persistent');
+    }
+
+    /**
+     * Set overwrite option on/off
+     *
+     * @param boolean $value
+     * @return Solarium_Plugin_CustomizeRequest_Customization
+     */
+    public function setOverwrite($value)
+    {
+        $this->_setOption('overwrite', $value);
+        return $this;
+    }
+
+    /**
+     * Get overwrite option value
+     *
+     * @return boolean
+     */
+    public function getOverwrite()
+    {
+        return $this->getOption('overwrite');
+    }
+
+    /**
+     * Check for all mandatory settings
+     *
+     * @return bool
+     */
+    public function isValid()
+    {
+        $type = $this->getType();
+        if ($type !== self::TYPE_PARAM && $type !== self::TYPE_HEADER) return false;
+
+        if (null == $this->getKey() || null == $this->getName() || null == $this->getValue()) return false;
+
+        return true;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/Loadbalancer.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/Loadbalancer.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Plugin/Loadbalancer.php	(revision 7576)
@@ -0,0 +1,543 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ */
+
+/**
+ * Loadbalancer plugin
+ *
+ * Using this plugin you can use software loadbalancing over multiple Solr instances.
+ * You can add any number of servers, each with their own weight. The weight influences
+ * the probability of a server being used for a query.
+ *
+ * By default all queries except updates are loadbalanced. This can be customized by setting blocked querytypes.
+ * Any querytype that may not be loadbalanced will be executed by Solarium with the default adapter settings.
+ * In a master-slave setup the default adapter should be connecting to the master server.
+ *
+ * You can also enable the failover mode. In this case a query will be retried on another server in case of error.
+ *
+ * @package Solarium
+ * @subpackage Plugin
+ */
+class Solarium_Plugin_Loadbalancer extends Solarium_Plugin_Abstract
+{
+
+    /**
+     * Default options
+     *
+     * @var array
+     */
+    protected $_options = array(
+        'failoverenabled' => false,
+        'failovermaxretries' => 1,
+    );
+
+    /**
+     * Registered servers
+     *
+     * @var array
+     */
+    protected $_servers = array();
+
+    /**
+     * Query types that are blocked from loadbalancing
+     *
+     * @var array
+     */
+    protected $_blockedQueryTypes = array(
+        Solarium_Client::QUERYTYPE_UPDATE => true
+    );
+
+    /**
+     * Key of the last used server
+     *
+     * The value can be null if no queries have been executed, or if the last executed query didn't use loadbalancing.
+     *
+     * @var null|string
+     */
+    protected $_lastServerKey;
+
+    /**
+     * Server to use for next query (overrules randomizer)
+     *
+     * @var string
+     */
+    protected $_nextServer;
+
+    /**
+     * Presets of the client adapter
+     *
+     * These settings are used to restore the adapter to it's original status for queries
+     * that cannot be loadbalanced (for instance update queries that need to go to the master)
+     *
+     * @var array
+     */
+    protected $_adapterPresets;
+
+    /**
+     * Pool of servers to use for requests
+     *
+     * @var Solarium_Plugin_Loadbalancer_WeightedRandomChoice
+     */
+    protected $_randomizer;
+
+    /**
+     * Query type
+     *
+     * @var string
+     */
+    protected $_queryType;
+
+    /**
+     * Used for failover mechanism
+     *
+     * @var array
+     */
+    protected $_serverExcludes;
+
+    /**
+     * Initialize options
+     *
+     * Several options need some extra checks or setup work, for these options
+     * the setters are called.
+     *
+     * @return void
+     */
+    protected function _init()
+    {
+        foreach ($this->_options AS $name => $value) {
+            switch ($name) {
+                case 'server':
+                    $this->setServers($value);
+                    break;
+                case 'blockedquerytype':
+                    $this->setBlockedQueryTypes($value);
+                    break;
+            }
+        }
+    }
+
+    /**
+     * Set failover enabled option
+     *
+     * @param bool $value
+     * @return self Provides fluent interface
+     */
+    public function setFailoverEnabled($value)
+    {
+        return $this->_setOption('failoverenabled', $value);
+    }
+
+    /**
+     * Get failoverenabled option
+     *
+     * @return boolean
+     */
+    public function getFailoverEnabled()
+    {
+        return $this->getOption('failoverenabled');
+    }
+
+    /**
+     * Set failover max retries
+     *
+     * @param int $value
+     * @return self Provides fluent interface
+     */
+    public function setFailoverMaxRetries($value)
+    {
+        return $this->_setOption('failovermaxretries', $value);
+    }
+
+    /**
+     * Get failovermaxretries option
+     *
+     * @return int
+     */
+    public function getFailoverMaxRetries()
+    {
+        return $this->getOption('failovermaxretries');
+    }
+
+    /**
+     * Add a server to the loadbalacing 'pool'
+     *
+     * @param string $key
+     * @param array $options
+     * @param int $weight Must be a positive number
+     * @return self Provides fluent interface
+     */
+    public function addServer($key, $options, $weight = 1)
+    {
+        if (array_key_exists($key, $this->_servers)) {
+            throw new Solarium_Exception('A server for the loadbalancer plugin must have a unique key');
+        } else {
+            $this->_servers[$key] = array(
+                'options' => $options,
+                'weight' => $weight,
+            );
+        }
+
+        // reset the randomizer as soon as a new server is added
+        $this->_randomizer = null;
+
+        return $this;
+    }
+
+    /**
+     * Get servers in the loadbalancing pool
+     *
+     * @return array
+     */
+    public function getServers()
+    {
+        return $this->_servers;
+    }
+
+    /**
+     * Get a server entry by key
+     *
+     * @param string $key
+     * @return array
+     */
+    public function getServer($key)
+    {
+        if (!isset($this->_servers[$key])) {
+            throw new Solarium_Exception('Unknown server key');
+        }
+
+        return $this->_servers[$key];
+    }
+
+    /**
+     * Set servers, overwriting any existing servers
+     *
+     * @param array $servers Use server key as array key and 'options' and 'weight' as array entries
+     * @return self Provides fluent interface
+     */
+    public function setServers($servers)
+    {
+        $this->clearServers();
+        $this->addServers($servers);
+        return $this;
+    }
+
+    /**
+     * Add multiple servers
+     *
+     * @param array $servers
+     * @return self Provides fluent interface
+     */
+    public function addServers($servers)
+    {
+        foreach ($servers AS $key => $data) {
+            $this->addServer($key, $data['options'], $data['weight']);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Clear all server entries
+     *
+     * @return self Provides fluent interface
+     */
+    public function clearServers()
+    {
+        $this->_servers = array();
+    }
+
+    /**
+     * Remove a server by key
+     *
+     * @param string $key
+     * @return self Provides fluent interface
+     */
+    public function removeServer($key)
+    {
+        if (isset($this->_servers[$key])) {
+            unset($this->_servers[$key]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Set a forced server (by key) for the next request
+     *
+     * As soon as one query has used the forced server this setting is reset. If you want to remove this setting
+     * pass NULL as the key value.
+     *
+     * If the next query cannot be loadbalanced (for instance based on the querytype) this setting is ignored
+     * but will still be reset.
+     *
+     * @param string|null $key
+     * @return self Provides fluent interface
+     */
+    public function setForcedServerForNextQuery($key)
+    {
+        if ($key !== null && !array_key_exists($key, $this->_servers)) {
+            throw new Solarium_Exception('Unknown server forced for next query');
+        }
+
+        $this->_nextServer = $key;
+        return $this;
+    }
+
+    /**
+     * Get the ForcedServerForNextQuery value
+     *
+     * @return string|null
+     */
+    public function getForcedServerForNextQuery()
+    {
+        return $this->_nextServer;
+    }
+
+    /**
+     * Get an array of blocked querytypes
+     *
+     * @return array
+     */
+    public function getBlockedQueryTypes()
+    {
+        return array_keys($this->_blockedQueryTypes);
+    }
+
+    /**
+     * Set querytypes to block from loadbalancing
+     *
+     * Overwrites any existing types
+     *
+     * @param array $types Use an array with the constants defined in Solarium_Client as values
+     * @return self Provides fluent interface
+     */
+    public function setBlockedQueryTypes($types)
+    {
+        $this->clearBlockedQueryTypes();
+        $this->addBlockedQueryTypes($types);
+        return $this;
+    }
+
+    /**
+     * Add a querytype to block from loadbalancing
+     *
+     * @param string $type Use one of the constants defined in Solarium_Client
+     * @return self Provides fluent interface
+     */
+    public function addBlockedQueryType($type)
+    {
+        if (!array_key_exists($type, $this->_blockedQueryTypes)) {
+            $this->_blockedQueryTypes[$type] = true;
+        }
+
+        return $this;
+    }
+
+    /**
+     * Add querytypes to block from loadbalancing
+     *
+     * Appended to any existing types
+     *
+     * @param array $types Use an array with the constants defined in Solarium_Client as values
+     * @return self Provides fluent interface
+     */
+    public function addBlockedQueryTypes($types)
+    {
+        foreach ($types AS $type) {
+            $this->addBlockedQueryType($type);
+        }
+    }
+
+    /**
+     * Remove a single querytype from the block list
+     *
+     * @param string $type
+     * @return void
+     */
+    public function removeBlockedQueryType($type)
+    {
+        if (array_key_exists($type, $this->_blockedQueryTypes)) {
+            unset($this->_blockedQueryTypes[$type]);
+        }
+    }
+
+    /**
+     * Clear all blocked querytypes
+     *
+     * @return self Provides fluent interface
+     */
+    public function clearBlockedQueryTypes()
+    {
+        $this->_blockedQueryTypes = array();
+    }
+
+    /**
+     * Get the key of the server that was used for the last query
+     *
+     * May return a null value if no query has been executed yet, or the last query could not be loadbalanced.
+     *
+     * @return null|string
+     */
+    public function getLastServerKey()
+    {
+        return $this->_lastServerKey;
+    }
+
+    /**
+     * Event hook to capture querytype
+     *
+     * @param Solarium_Query $query
+     * @return void
+     */
+    public function preCreateRequest($query)
+    {
+        $this->_queryType = $query->getType();
+    }
+
+    /**
+     * Event hook to adjust client settings just before query execution
+     *
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Response
+     */
+    public function preExecuteRequest($request)
+    {
+        $adapter = $this->_client->getAdapter();
+
+        // save adapter presets (once) to allow the settings to be restored later
+        if ($this->_adapterPresets == null) {
+            $this->_adapterPresets = array(
+                'host'    => $adapter->getHost(),
+                'port'    => $adapter->getPort(),
+                'path'    => $adapter->getPath(),
+                'core'    => $adapter->getCore(),
+                'timeout' => $adapter->getTimeout(),
+            );
+        }
+
+        // check querytype: is loadbalancing allowed?
+        if (!array_key_exists($this->_queryType, $this->_blockedQueryTypes)) {
+            return  $this->_getLoadbalancedResponse($request);
+        } else {
+            $options = $this->_adapterPresets;
+            $this->_lastServerKey = null;
+
+            // apply new settings to adapter
+            $adapter->setOptions($options);
+
+            // execute request and return result
+            return $adapter->execute($request);
+        }
+    }
+
+    /**
+     * Execute a request using the adapter
+     *
+     * @param Solarium_Client_Request $request
+     * @return Solarium_Client_Response $response
+     */
+    protected function _getLoadbalancedResponse($request)
+    {
+        $this->_serverExcludes = array(); // reset for each query
+        $adapter = $this->_client->getAdapter();
+
+        if ($this->getFailoverEnabled() == true) {
+
+            for ($i=0; $i<=$this->getFailoverMaxRetries(); $i++) {
+                $options = $this->_getRandomServerOptions();
+                $adapter->setOptions($options);
+                try {
+                    return $adapter->execute($request);
+                } catch(Solarium_Client_HttpException $e) {
+                    // ignore HTTP errors and try again
+                    // but do issue an event for things like logging
+                    $e = new Solarium_Exception('Maximum number of loadbalancer retries reached');
+                    $this->_client->triggerEvent('LoadbalancerServerFail', array($options, $e));
+                }
+            }
+
+            // if we get here no more retries available, throw exception
+            $e = new Solarium_Exception('Maximum number of loadbalancer retries reached');
+            throw $e;
+
+        } else {
+            // no failover retries, just execute and let an exception bubble upwards
+            $options = $this->_getRandomServerOptions();
+            $adapter->setOptions($options);
+            return $adapter->execute($request);
+        }
+    }
+
+    /**
+     * Get options array for a randomized server
+     *
+     * @return array
+     */
+    protected function _getRandomServerOptions()
+    {
+        // determine the server to use
+        if ($this->_nextServer !== null) {
+            $serverKey = $this->_nextServer;
+            // reset forced server directly after use
+            $this->_nextServer = null;
+        } else {
+            $serverKey = $this->_getRandomizer()->getRandom($this->_serverExcludes);
+        }
+
+        $this->_serverExcludes[] = $serverKey;
+        $this->_lastServerKey = $serverKey;
+        return $this->_servers[$serverKey]['options'];
+    }
+
+    /**
+     * Get randomizer instance
+     *
+     * @return Solarium_Plugin_Loadbalancer_WeightedRandomChoice
+     */
+    protected function _getRandomizer()
+    {
+        if ($this->_randomizer === null) {
+            $choices = array();
+            foreach ($this->_servers AS $key => $settings) {
+                $choices[$key] = $settings['weight'];
+            }
+            $this->_randomizer = new Solarium_Plugin_Loadbalancer_WeightedRandomChoice($choices);
+        }
+
+        return $this->_randomizer;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/MoreLikeThis/Result.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/MoreLikeThis/Result.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/MoreLikeThis/Result.php	(revision 7576)
@@ -0,0 +1,140 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component morelikethis result item
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_MoreLikeThis_Result
+    implements IteratorAggregate, Countable
+{
+
+    /**
+     * Document instances array
+     *
+     * @var array
+     */
+    protected $_documents;
+
+    /**
+     * Solr numFound
+     *
+     * This is NOT the number of MLT documents fetched from Solr!
+     *
+     * @var int
+     */
+    protected $_numFound;
+
+    /**
+     * Maximum score in this MLT set
+     *
+     * @var float
+     */
+    protected $_maximumScore;
+
+    /**
+     * Constructor
+     *
+     * @param int $numFound
+     * @param float $maxScore
+     * @param array $documents
+     * @return void
+     */
+    public function __construct($numFound, $maxScore, $documents)
+    {
+        $this->_numFound = $numFound;
+        $this->_maximumScore = $maxScore;
+        $this->_documents = $documents;
+    }
+
+    /**
+     * get Solr numFound
+     *
+     * Returns the number of MLT documents found by Solr (this is NOT the
+     * number of documents fetched from Solr!)
+     *
+     * @return int
+     */
+    public function getNumFound()
+    {
+        return $this->_numFound;
+    }
+
+    /**
+     * Get maximum score in the MLT document set
+     *
+     * @return float
+     */
+    public function getMaximumScore()
+    {
+        return $this->_maximumScore;
+    }
+
+    /**
+     * Get all documents
+     *
+     * @return array
+     */
+    public function getDocuments()
+    {
+        return $this->_documents;
+    }
+
+    
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_documents);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_documents);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Grouping.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Grouping.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Grouping.php	(revision 7576)
@@ -0,0 +1,112 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component grouping result
+ *
+ * @since 2.1.0
+ * 
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Grouping implements IteratorAggregate, Countable
+{
+
+    /**
+     * Group results array
+     *
+     * @var array
+     */
+    protected $_groups;
+    
+    /**
+     * Constructor
+     *
+     * @param array $groups
+     * @return void
+     */
+    public function __construct($groups)
+    {
+        $this->_groups = $groups;
+    }
+
+    /**
+     * Get all groups
+     *
+     * @return array
+     */
+    public function getGroups()
+    {
+        return $this->_groups;
+    }
+
+    /**
+     * Get a group
+     *
+     * @param string $key
+     * @return Solarium_Result_Select_Grouping_FieldGroup|Solarium_Result_Select_Grouping_QueryGroup
+     */
+    public function getGroup($key)
+    {
+        if (isset($this->_groups[$key])) {
+            return $this->_groups[$key];
+        } else {
+            return null;
+        }
+    }
+    
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_groups);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_groups);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Facet/Range.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Facet/Range.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Facet/Range.php	(revision 7576)
@@ -0,0 +1,132 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select range facet result
+ *
+ * A multiquery facet will usually return a dataset of multiple count, in each
+ * row a range as key and it's count. You can access the values as an array using
+ * {@link getValues()} or iterate this object.
+ *
+ * The extra counts 'before', 'between' and 'after' are only available if the
+ * right settings for the option 'other' were used in the query.
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Facet_Range extends Solarium_Result_Select_Facet_Field
+{
+
+    /**
+     * Count of all records with field values lower then lower bound of the first range
+     *
+     * @var int
+     */
+    protected $_before;
+
+    /**
+     * Count of all records with field values greater then the upper bound of the last range
+     *
+     * @var int
+     */
+    protected $_after;
+
+    /**
+     * Count all records with field values between the start and end bounds of all ranges
+     *
+     * @var int
+     */
+    protected $_between;
+
+    /**
+     * Constructor
+     *
+     * @param array $values
+     * @param int $before
+     * @param int $after
+     * @param int $between
+     * @return void
+     */
+    public function __construct($values, $before, $after, $between)
+    {
+        $this->_values = $values;
+        $this->_before = $before;
+        $this->_after = $after;
+        $this->_between = $between;
+    }
+
+    /**
+     * Get 'before' count
+     *
+     * Count of all records with field values lower then lower bound of the first range
+     * Only available if the 'other' setting was used in the query facet.
+     *
+     * @return int
+     */
+    public function getBefore()
+    {
+        return $this->_before;
+    }
+
+    /**
+     * Get 'after' count
+     *
+     * Count of all records with field values greater then the upper bound of the last range
+     * Only available if the 'other' setting was used in the query facet.
+     *
+     * @return int
+     */
+    public function getAfter()
+    {
+        return $this->_after;
+    }
+
+    /**
+     * Get 'between' count
+     *
+     * Count all records with field values between the start and end bounds of all ranges
+     * Only available if the 'other' setting was used in the query facet.
+     *
+     * @return int
+     */
+    public function getBetween()
+    {
+        return $this->_between;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Facet/MultiQuery.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Facet/MultiQuery.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Facet/MultiQuery.php	(revision 7576)
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select multiquery facet result
+ *
+ * A multiquery facet will usually return a dataset of multiple rows, in each
+ * row a query key and it's count. You can access the values as an array using
+ * {@link getValues()} or iterate this object.
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Facet_MultiQuery extends Solarium_Result_Select_Facet_Field
+{
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Facet/Field.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Facet/Field.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Facet/Field.php	(revision 7576)
@@ -0,0 +1,99 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select field facet result
+ *
+ * A field facet will usually return a dataset of multiple rows, in each row a
+ * value and it's count. You can access the values as an array using
+ * {@link getValues()} or iterate this object.
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Facet_Field implements IteratorAggregate, Countable
+{
+
+    /**
+     * Value array
+     *
+     * @var array
+     */
+    protected $_values;
+    
+    /**
+     * Constructor
+     *
+     * @param array $values
+     * @return void
+     */
+    public function __construct($values)
+    {
+        $this->_values = $values;
+    }
+
+    /**
+     * Get all values
+     *
+     * @return array
+     */
+    public function getValues()
+    {
+        return $this->_values;
+    }
+    
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_values);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_values);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Facet/Query.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Facet/Query.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Facet/Query.php	(revision 7576)
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select query facet result
+ *
+ * Since a query facet has only a single result, the count for the query, this
+ * is a very simple object.
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Facet_Query
+{
+
+    /**
+     * Value (count)
+     *
+     * @var mixed
+     */
+    protected $_value;
+    
+    /**
+     * Constructor
+     *
+     * @param mixed $value
+     * @return void
+     */
+    public function __construct($value)
+    {
+        $this->_value = $value;
+    }
+
+    /**
+     * Get the value
+     *
+     * @return mixed
+     */
+    public function getValue()
+    {
+        return $this->_value;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Spellcheck.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Spellcheck.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Spellcheck.php	(revision 7576)
@@ -0,0 +1,150 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component spellcheck result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Spellcheck implements IteratorAggregate, Countable
+{
+
+    /**
+     * Suggestions array
+     *
+     * @var array
+     */
+    protected $_suggestions;
+
+    /**
+     * Collation object
+     *
+     * @var Solarium_Result_Select_Spellcheck_Collation
+     */
+    protected $_collation;
+
+    /**
+     * Correctly spelled?
+     *
+     * @var boolean
+     */
+    protected $_correctlySpelled;
+
+    /**
+     * Constructor
+     *
+     * @param array $suggestions
+     * @param Solarium_Result_Select_Spellcheck_Collation $collation
+     * @param boolean $correctlySpelled
+     * @return void
+     */
+    public function __construct($suggestions, $collation, $correctlySpelled)
+    {
+        $this->_suggestions = $suggestions;
+        $this->_collation = $collation;
+        $this->_correctlySpelled = $correctlySpelled;
+    }
+
+    /**
+     * Get the collation result
+     *
+     * @return Solarium_Result_Select_Spellcheck_Collation
+     */
+    public function getCollation()
+    {
+        return $this->_collation;
+    }
+
+    /**
+     * Get correctly spelled status
+     *
+     * Only available if ExtendedResults was enabled in your query
+     *
+     * @return bool
+     */
+    public function getCorrectlySpelled()
+    {
+        return $this->_correctlySpelled;
+    }
+
+    /**
+     * Get a result by key
+     *
+     * @param mixed $key
+     * @return Solarium_Result_Select_Highlighting_Suggestion|null
+     */
+    public function getSuggestion($key)
+    {
+        if (isset($this->_suggestions[$key])) {
+            return $this->_suggestions[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all suggestions
+     *
+     * @return array
+     */
+    public function getSuggestions()
+    {
+        return $this->_suggestions;
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_suggestions);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_suggestions);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/FacetSet.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/FacetSet.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/FacetSet.php	(revision 7576)
@@ -0,0 +1,110 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component facetset result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_FacetSet implements IteratorAggregate, Countable
+{
+
+    /**
+     * Facet array
+     *
+     * @var array
+     */
+    protected $_facets;
+    
+    /**
+     * Constructor
+     *
+     * @param array $facets
+     * @return void
+     */
+    public function __construct($facets)
+    {
+        $this->_facets = $facets;
+    }
+
+    /**
+     * Get a facet by key
+     *
+     * @param mixed $key
+     * @return mixed
+     */
+    public function getFacet($key)
+    {
+        if (isset($this->_facets[$key])) {
+            return $this->_facets[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all results
+     *
+     * @return array
+     */
+    public function getFacets()
+    {
+        return $this->_facets;
+    }
+    
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_facets);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_facets);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Stats.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Stats.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Stats.php	(revision 7576)
@@ -0,0 +1,111 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component stats result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Stats
+    implements IteratorAggregate, Countable
+{
+
+    /**
+     * Result array
+     *
+     * @var array
+     */
+    protected $_results;
+
+    /**
+     * Constructor
+     *
+     * @param array $results
+     * @return void
+     */
+    public function __construct($results)
+    {
+        $this->_results = $results;
+    }
+
+    /**
+     * Get a result by key
+     *
+     * @param mixed $key
+     * @return Solarium_Result_Select_Stats_Result|null
+     */
+    public function getResult($key)
+    {
+        if (isset($this->_results[$key])) {
+            return $this->_results[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all results
+     *
+     * @return array
+     */
+    public function getResults()
+    {
+        return $this->_results;
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_results);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_results);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Highlighting/Result.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Highlighting/Result.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Highlighting/Result.php	(revision 7576)
@@ -0,0 +1,110 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component highlighting result item
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Highlighting_Result implements IteratorAggregate, Countable
+{
+
+    /**
+     * Fields array
+     *
+     * @var array
+     */
+    protected $_fields;
+
+    /**
+     * Constructor
+     *
+     * @param array $fields
+     * @return void
+     */
+    public function __construct($fields)
+    {
+        $this->_fields = $fields;
+    }
+
+    /**
+     * Get highlights for all fields
+     *
+     * @return array
+     */
+    public function getFields()
+    {
+        return $this->_fields;
+    }
+
+    /**
+     * Get highlights for a single field
+     *
+     * @param string $key
+     * @return array
+     */
+    public function getField($key)
+    {
+        if (isset($this->_fields[$key])) {
+            return $this->_fields[$key];
+        } else {
+            return array();
+        }
+    }
+    
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_fields);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_fields);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/MoreLikeThis.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/MoreLikeThis.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/MoreLikeThis.php	(revision 7576)
@@ -0,0 +1,111 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component morelikethis result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_MoreLikeThis
+    implements IteratorAggregate, Countable
+{
+
+    /**
+     * Result array
+     *
+     * @var array
+     */
+    protected $_results;
+    
+    /**
+     * Constructor
+     *
+     * @param array $results
+     * @return void
+     */
+    public function __construct($results)
+    {
+        $this->_results = $results;
+    }
+
+    /**
+     * Get a result by key
+     *
+     * @param mixed $key
+     * @return Solarium_Result_Select_MoreLikeThis_Result|null
+     */
+    public function getResult($key)
+    {
+        if (isset($this->_results[$key])) {
+            return $this->_results[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all results
+     *
+     * @return array
+     */
+    public function getResults()
+    {
+        return $this->_results;
+    }
+    
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_results);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_results);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/DocumentSet.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/DocumentSet.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/DocumentSet.php	(revision 7576)
@@ -0,0 +1,111 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component debug documentset result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Debug_DocumentSet
+    implements IteratorAggregate, Countable
+{
+
+    /**
+     * Docs array
+     *
+     * @var array
+     */
+    protected $_docs;
+
+    /**
+     * Constructor
+     *
+     * @param array $docs
+     * @return void
+     */
+    public function __construct($docs)
+    {
+        $this->_docs = $docs;
+    }
+
+    /**
+     * Get a document by key
+     *
+     * @param mixed $key
+     * @return Solarium_Result_Select_Debug_Document|null
+     */
+    public function getDocument($key)
+    {
+        if (isset($this->_docs[$key])) {
+            return $this->_docs[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all docs
+     *
+     * @return array
+     */
+    public function getDocuments()
+    {
+        return $this->_docs;
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_docs);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_docs);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/Document.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/Document.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/Document.php	(revision 7576)
@@ -0,0 +1,118 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component debug document result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Debug_Document extends Solarium_Result_Select_Debug_Detail
+     implements IteratorAggregate, Countable
+{
+
+    /**
+     * Key
+     *
+     * @var string
+     */
+    protected $_key;
+
+    /**
+     * Details
+     *
+     * @var array
+     */
+    protected $_details;
+
+    /**
+     * Constructor
+     *
+     * @param string $key
+     * @param boolean $match
+     * @param float $value
+     * @param string $description
+     * @param array $details
+     */
+    public function __construct($key, $match, $value, $description, $details)
+    {
+        parent::__construct($match, $value, $description);
+        $this->_key = $key;
+        $this->_details = $details;
+    }
+
+    /**
+     * Get key value for this document
+     *
+     * @return string
+     */
+    public function getKey()
+    {
+        return $this->_key;
+    }
+
+    /**
+     * Get details
+     *
+     * @return array
+     */
+    public function getDetails()
+    {
+        return $this->_details;
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_details);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_details);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/Detail.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/Detail.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/Detail.php	(revision 7576)
@@ -0,0 +1,113 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component debug detail result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Debug_Detail
+{
+
+    /**
+     * Value
+     *
+     * @var float
+     */
+    protected $_value;
+
+    /**
+     * Match
+     *
+     * @var boolean
+     */
+    protected $_match;
+
+    /**
+     * Description
+     *
+     * @var string
+     */
+    protected $_description;
+
+    /**
+     * Constructor
+     *
+     * @param boolean $match
+     * @param float $value
+     * @param string $description
+     */
+    public function __construct($match, $value, $description)
+    {
+        $this->_match = $match;
+        $this->_value = $value;
+        $this->_description = $description;
+    }
+
+    /**
+     * Get match status
+     *
+     * @return bool
+     */
+    public function getMatch()
+    {
+        return $this->_match;
+    }
+
+    /**
+     * Get match value (score)
+     *
+     * @return float
+     */
+    public function getValue()
+    {
+        return $this->_value;
+    }
+
+    /**
+     * Get description
+     *
+     * @return string
+     */
+    public function getDescription()
+    {
+        return $this->_description;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/Timing.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/Timing.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/Timing.php	(revision 7576)
@@ -0,0 +1,129 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component debug timing result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Debug_Timing implements IteratorAggregate, Countable
+{
+
+    /**
+     * Time
+     *
+     * @var float
+     */
+    protected $_time;
+
+    /**
+     * Timing phase array
+     *
+     * @var array
+     */
+    protected $_phases;
+
+    /**
+     * Constructor
+     *
+     * @param float $time
+     * @param array $phases
+     * @return void
+     */
+    public function __construct($time, $phases)
+    {
+        $this->_time = $time;
+        $this->_phases = $phases;
+    }
+
+    /**
+     * Get total time
+     *
+     * @return float
+     */
+    public function getTime()
+    {
+        return $this->_time;
+    }
+
+    /**
+     * Get a timing phase by key
+     *
+     * @param mixed $key
+     * @return Solarium_Result_Select_Debug_TimingPhase|null
+     */
+    public function getPhase($key)
+    {
+        if (isset($this->_phases[$key])) {
+            return $this->_phases[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get timings
+     *
+     * @return array
+     */
+    public function getPhases()
+    {
+        return $this->_phases;
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_phases);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_phases);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/TimingPhase.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/TimingPhase.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug/TimingPhase.php	(revision 7576)
@@ -0,0 +1,139 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component debug timing phase result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Debug_TimingPhase
+    implements IteratorAggregate, Countable
+{
+
+    /**
+     * Phase name
+     *
+     * @var string
+     */
+    protected $_name;
+
+    /**
+     * Phase time
+     *
+     * @var float
+     */
+    protected $_time;
+
+    /**
+     * Timing array
+     *
+     * @var array
+     */
+    protected $_timings;
+
+    /**
+     * Constructor
+     *
+     * @param string $name
+     * @param float $time
+     * @param array $timings
+     * @return void
+     */
+    public function __construct($name, $time, $timings)
+    {
+        $this->_name = $name;
+        $this->_time = $time;
+        $this->_timings = $timings;
+    }
+
+    /**
+     * Get total time
+     *
+     * @return float
+     */
+    public function getTime()
+    {
+        return $this->_time;
+    }
+
+    /**
+     * Get a timing by key
+     *
+     * @param mixed $key
+     * @return float|null
+     */
+    public function getTiming($key)
+    {
+        if (isset($this->_timings[$key])) {
+            return $this->_timings[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get timings
+     *
+     * @return array
+     */
+    public function getTimings()
+    {
+        return $this->_timings;
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_timings);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_timings);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Grouping/ValueGroup.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Grouping/ValueGroup.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Grouping/ValueGroup.php	(revision 7576)
@@ -0,0 +1,154 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component grouping field value group result
+ *
+ * @since 2.1.0
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Grouping_ValueGroup implements IteratorAggregate, Countable
+{
+
+    /**
+     * Field value
+     *
+     * @var string
+     */
+    protected $_value;
+
+    /**
+     * NumFound
+     *
+     * @var int
+     */
+    protected $_numFound;
+
+    /**
+     * Start position
+     *
+     * @var int
+     */
+    protected $_start;
+
+    /**
+     * Documents in this group
+     *
+     * @var array
+     */
+    protected $_documents;
+    
+    /**
+     * Constructor
+     *
+     * @param string $value
+     * @param int $numFound
+     * @param int $start
+     * @param array $documents
+     * @return void
+     */
+    public function __construct($value, $numFound, $start, $documents)
+    {
+        $this->_value = $value;
+        $this->_numFound = $numFound;
+        $this->_start = $start;
+        $this->_documents = $documents;
+    }
+
+    /**
+     * Get value
+     * 
+     * @return string
+     */
+    public function getValue()
+    {
+        return $this->_value;
+    }
+
+    /**
+     * Get numFound
+     *
+     * @return int
+     */
+    public function getNumFound()
+    {
+        return $this->_numFound;
+    }
+
+    /**
+     * Get start
+     *
+     * @return int
+     */
+    public function getStart()
+    {
+        return $this->_start;
+    }
+
+    /**
+     * Get all documents
+     *
+     * @return array
+     */
+    public function getDocuments()
+    {
+        return $this->_documents;
+    }
+    
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_documents);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_documents);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Grouping/FieldGroup.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Grouping/FieldGroup.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Grouping/FieldGroup.php	(revision 7576)
@@ -0,0 +1,137 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component grouping field group result
+ *
+ * @since 2.1.0
+ * 
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Grouping_FieldGroup implements IteratorAggregate, Countable
+{
+
+    /**
+     * Match count
+     *
+     * @var int
+     */
+    protected $_matches;
+
+    /**
+     * Number of groups
+     *
+     * @var int
+     */
+    protected $_numberOfGroups;
+
+    /**
+     * Value groups
+     *
+     * @var array
+     */
+    protected $_valueGroups;
+    
+    /**
+     * Constructor
+     *
+     * @param int $matches
+     * @param int $numberOfGroups
+     * @param array $groups
+     * @return void
+     */
+    public function __construct($matches, $numberOfGroups, $groups)
+    {
+        $this->_matches = $matches;
+        $this->_numberOfGroups = $numberOfGroups;
+        $this->_valueGroups = $groups;
+    }
+
+    /**
+     * Get matches value
+     * 
+     * @return int
+     */
+    public function getMatches()
+    {
+        return $this->_matches;
+    }
+
+    /**
+     * Get numberOfGroups value
+     *
+     * Only available if the numberofgroups option in the query was 'true'
+     *
+     * @return int
+     */
+    public function getNumberOfGroups()
+    {
+        return $this->_numberOfGroups;
+    }
+
+    /**
+     * Get all value groups
+     *
+     * @return array
+     */
+    public function getValueGroups()
+    {
+        return $this->_valueGroups;
+    }
+    
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_valueGroups);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_valueGroups);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Grouping/QueryGroup.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Grouping/QueryGroup.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Grouping/QueryGroup.php	(revision 7576)
@@ -0,0 +1,173 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component grouping query group result
+ *
+ * @since 2.1.0
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Grouping_QueryGroup implements IteratorAggregate, Countable
+{
+
+    /**
+     * Match count
+     *
+     * @var int
+     */
+    protected $_matches;
+
+    /**
+     * NumFound value
+     *
+     * @var int
+     */
+    protected $_numFound;
+
+    /**
+     * Start offset
+     *
+     * @var int
+     */
+    protected $_start;
+
+    /**
+     * Maximum score in group
+     * 
+     * @var float
+     */
+    protected $_maximumScore;
+
+    /**
+     * Group documents array
+     *
+     * @var array
+     */
+    protected $_documents;
+    
+    /**
+     * Constructor
+     *
+     * @param int $matches
+     * @param int $numFound
+     * @param int $start
+     * @param float $maximumScore
+     * @param array $documents
+     * @return void
+     */
+    public function __construct($matches, $numFound, $start, $maximumScore, $documents)
+    {
+        $this->_matches = $matches;
+        $this->_numFound = $numFound;
+        $this->_start = $start;
+        $this->_maximumScore = $maximumScore;
+        $this->_documents = $documents;
+    }
+
+    /**
+     * Get matches value
+     *
+     * @return int
+     */
+    public function getMatches()
+    {
+        return $this->_matches;
+    }
+
+    /**
+     * Get numFound value
+     *
+     * @return int
+     */
+    public function getNumFound()
+    {
+        return $this->_numFound;
+    }
+
+    /**
+     * Get start value
+     *
+     * @return int
+     */
+    public function getStart()
+    {
+        return $this->_start;
+    }
+
+    /**
+     * Get maximumScore value
+     *
+     * @return int
+     */
+    public function getMaximumScore()
+    {
+        return $this->_maximumScore;
+    }
+
+    /**
+     * Get all documents
+     *
+     * @return array
+     */
+    public function getDocuments()
+    {
+        return $this->_documents;
+    }
+    
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_documents);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_documents);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Highlighting.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Highlighting.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Highlighting.php	(revision 7576)
@@ -0,0 +1,110 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component highlighting result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Highlighting implements IteratorAggregate, Countable
+{
+
+    /**
+     * Result array
+     *
+     * @var array
+     */
+    protected $_results;
+    
+    /**
+     * Constructor
+     *
+     * @param array $results
+     * @return void
+     */
+    public function __construct($results)
+    {
+        $this->_results = $results;
+    }
+
+    /**
+     * Get a result by key
+     *
+     * @param mixed $key
+     * @return Solarium_Result_Select_Highlighting_Result|null
+     */
+    public function getResult($key)
+    {
+        if (isset($this->_results[$key])) {
+            return $this->_results[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get all results
+     *
+     * @return array
+     */
+    public function getResults()
+    {
+        return $this->_results;
+    }
+    
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_results);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_results);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Debug.php	(revision 7576)
@@ -0,0 +1,211 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component debug result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Debug implements IteratorAggregate, Countable
+{
+
+    /**
+     * QueryString
+     *
+     * @var string
+     */
+    protected $_queryString;
+
+    /**
+     * ParsedQuery
+     *
+     * @var string
+     */
+    protected $_parsedQuery;
+
+    /**
+     * QueryParser
+     *
+     * @var string
+     */
+    protected $_queryParser;
+
+    /**
+     * OtherQuery
+     *
+     * @var string
+     */
+    protected $_otherQuery;
+
+    /**
+     * Explain instance
+     *
+     * @var Solarium_Result_Select_Debug_DocumentSet
+     */
+    protected $_explain;
+
+    /**
+     * ExplainOther instance
+     *
+     * @var Solarium_Result_Select_Debug_DocumentSet
+     */
+    protected $_explainOther;
+
+    /**
+     * Timing instance
+     *
+     * @var Solarium_Result_Select_Debug_Timing
+     */
+    protected $_timing;
+
+    /**
+     * Constructor
+     *
+     * @param string $queryString
+     * @param string $parsedQuery
+     * @param string $queryParser
+     * @param string $otherQuery
+     * @param Solarium_Result_Select_Debug_DocumentSet $explain
+     * @param Solarium_Result_Select_Debug_DocumentSet $explainOther
+     * @param Solarium_Result_Select_Debug_Timing $timing
+     */
+    public function __construct($queryString, $parsedQuery, $queryParser, $otherQuery, $explain, $explainOther, $timing)
+    {
+        $this->_queryString = $queryString;
+        $this->_parsedQuery = $parsedQuery;
+        $this->_queryParser = $queryParser;
+        $this->_otherQuery = $otherQuery;
+        $this->_explain = $explain;
+        $this->_explainOther = $explainOther;
+        $this->_timing = $timing;
+    }
+
+    /**
+     * Get input querystring
+     *
+     * @return string
+     */
+    public function getQueryString()
+    {
+        return $this->_queryString;
+    }
+
+    /**
+     * Get the result of the queryparser
+     *
+     * @return string
+     */
+    public function getParsedQuery()
+    {
+        return $this->_parsedQuery;
+    }
+
+    /**
+     * Get the used queryparser
+     *
+     * @return string
+     */
+    public function getQueryParser()
+    {
+        return $this->_queryParser;
+    }
+
+    /**
+     * Get other query (only available if set in query)
+     *
+     * @return string
+     */
+    public function getOtherQuery()
+    {
+        return $this->_otherQuery;
+    }
+
+    /**
+     * Get explain document set
+     *
+     * @return Solarium_Result_Select_Debug_DocumentSet
+     */
+    public function getExplain()
+    {
+        return $this->_explain;
+    }
+
+    /**
+     * Get explain other document set (only available if otherquery was set in query)
+     *
+     * @return Solarium_Result_Select_Debug_DocumentSet
+     */
+    public function getExplainOther()
+    {
+        return $this->_explainOther;
+    }
+
+    /**
+     * Get timing object
+     *
+     * @return Solarium_Result_Select_Debug_Timing
+     */
+    public function getTiming()
+    {
+        return $this->_timing;
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * Iterates the explain results
+     *
+     * @return Solarium_Result_Select_Debug_DocumentSet
+     */
+    public function getIterator()
+    {
+        return $this->_explain;
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_explain);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Spellcheck/Collation.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Spellcheck/Collation.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Spellcheck/Collation.php	(revision 7576)
@@ -0,0 +1,140 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component spellcheck collation result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Spellcheck_Collation implements IteratorAggregate, Countable
+{
+
+    /**
+     * Query
+     *
+     * @var string
+     */
+    protected $_query;
+
+    /**
+     * Hit count
+     *
+     * @var int
+     */
+    protected $_hits;
+
+    /**
+     * Corrections
+     *
+     * @var array
+     */
+    protected $_corrections;
+
+    /**
+     * Constructor
+     *
+     * @param string $query
+     * @param int|null $hits
+     * @param array $corrections
+     */
+    public function __construct($query, $hits, $corrections)
+    {
+        $this->_query = $query;
+        $this->_hits = $hits;
+        $this->_corrections = $corrections;
+    }
+
+    /**
+     * Get query string
+     *
+     * @return string
+     */
+    public function getQuery()
+    {
+        return $this->_query;
+    }
+
+    /**
+     * Get hit count
+     *
+     * Only available if ExtendedResults was enabled in your query
+     *
+     * @return int|null
+     */
+    public function getHits()
+    {
+        return $this->_hits;
+    }
+
+    /**
+     * Get all corrrections
+     *
+     * Only available if ExtendedResults was enabled in your query
+     *
+     * @return array
+     */
+    public function getCorrections()
+    {
+        return $this->_corrections;
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * Only available if ExtendedResults was enabled in your query
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_corrections);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * Only available if ExtendedResults was enabled in your query
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_corrections);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Spellcheck/Suggestion.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Spellcheck/Suggestion.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Spellcheck/Suggestion.php	(revision 7576)
@@ -0,0 +1,132 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component spellcheck suggestion result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Spellcheck_Suggestion
+{
+
+    /**
+     * Constructor
+     *
+     * @param int $numFound
+     * @param int $startOffset
+     * @param int $endOffset
+     * @param int $originalFrequency
+     * @param string $word
+     * @param int $frequency
+     */
+    public function __construct($numFound, $startOffset, $endOffset, $originalFrequency, $word, $frequency)
+    {
+        $this->_numFound = $numFound;
+        $this->_startOffset = $startOffset;
+        $this->_endOffset = $endOffset;
+        $this->_originalFrequency = $originalFrequency;
+        $this->_word = $word;
+        $this->_frequency = $frequency;
+    }
+
+    /**
+     * Get numFound value
+     *
+     * @return int
+     */
+    public function getNumFound()
+    {
+        return $this->_numFound;
+    }
+
+    /**
+     * Get startOffset value
+     *
+     * @return int
+     */
+    public function getStartOffset()
+    {
+        return $this->_startOffset;
+    }
+
+    /**
+     * Get endOffset value
+     *
+     * @return int
+     */
+    public function getEndOffset()
+    {
+        return $this->_endOffset;
+    }
+
+    /**
+     * Get originalFrequency value
+     *
+     * Only available if CollateExtendedResults was enabled in your query
+     *
+     * @return int
+     */
+    public function getOriginalFrequency()
+    {
+        return $this->_originalFrequency;
+    }
+
+    /**
+     * Get word
+     *
+     * @return string
+     */
+    public function getWord()
+    {
+        return $this->_word;
+    }
+
+    /**
+     * Get frequency value
+     *
+     * Only available if CollateExtendedResults was enabled in your query
+     *
+     * @return int
+     */
+    public function getFrequency()
+    {
+        return $this->_frequency;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Stats/Result.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Stats/Result.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Stats/Result.php	(revision 7576)
@@ -0,0 +1,174 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component stats field result item
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Stats_Result
+{
+
+    /**
+     * Field name
+     *
+     * @var string
+     */
+    protected $_field;
+
+    /**
+     * Stats data
+     *
+     * @var array
+     */
+    protected $_stats;
+
+    /**
+     * Constructor
+     *
+     * @param string $field
+     * @param array $stats
+     * @return void
+     */
+    public function __construct($field, $stats)
+    {
+        $this->_field = $field;
+        $this->_stats = $stats;
+    }
+
+    /**
+     * Get field name
+     *
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->_field;
+    }
+
+    /**
+     * Get min value
+     *
+     * @return string
+     */
+    public function getMin()
+    {
+        return $this->_stats['min'];
+    }
+
+    /**
+     * Get max value
+     *
+     * @return string
+     */
+    public function getMax()
+    {
+        return $this->_stats['max'];
+    }
+
+    /**
+     * Get sum value
+     *
+     * @return string
+     */
+    public function getSum()
+    {
+        return $this->_stats['sum'];
+    }
+
+    /**
+     * Get count value
+     *
+     * @return string
+     */
+    public function getCount()
+    {
+        return $this->_stats['count'];
+    }
+
+    /**
+     * Get missing value
+     *
+     * @return string
+     */
+    public function getMissing()
+    {
+        return $this->_stats['missing'];
+    }
+
+    /**
+     * Get sumOfSquares value
+     *
+     * @return string
+     */
+    public function getSumOfSquares()
+    {
+        return $this->_stats['sumOfSquares'];
+    }
+
+    /**
+     * Get mean value
+     *
+     * @return string
+     */
+    public function getMean()
+    {
+        return $this->_stats['mean'];
+    }
+
+    /**
+     * Get stddev value
+     *
+     * @return string
+     */
+    public function getStddev()
+    {
+        return $this->_stats['stddev'];
+    }
+
+    /**
+     * Get facet stats
+     *
+     * @return array
+     */
+    public function getFacets()
+    {
+        return $this->_stats['facets'];
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Stats/FacetValue.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Stats/FacetValue.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select/Stats/FacetValue.php	(revision 7576)
@@ -0,0 +1,174 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select component stats facet value
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select_Stats_FacetValue
+{
+
+    /**
+     * Facet value
+     *
+     * @var string
+     */
+    protected $_value;
+
+    /**
+     * Stats data
+     *
+     * @var array
+     */
+    protected $_stats;
+
+    /**
+     * Constructor
+     *
+     * @param string $value
+     * @param array $stats
+     * @return void
+     */
+    public function __construct($value, $stats)
+    {
+        $this->_value = $value;
+        $this->_stats = $stats;
+    }
+
+    /**
+     * Get facet value
+     *
+     * @return string
+     */
+    public function getValue()
+    {
+        return $this->_value;
+    }
+
+    /**
+     * Get min value
+     *
+     * @return string
+     */
+    public function getMin()
+    {
+        return $this->_stats['min'];
+    }
+
+    /**
+     * Get max value
+     *
+     * @return string
+     */
+    public function getMax()
+    {
+        return $this->_stats['max'];
+    }
+
+    /**
+     * Get sum value
+     *
+     * @return string
+     */
+    public function getSum()
+    {
+        return $this->_stats['sum'];
+    }
+
+    /**
+     * Get count value
+     *
+     * @return string
+     */
+    public function getCount()
+    {
+        return $this->_stats['count'];
+    }
+
+    /**
+     * Get missing value
+     *
+     * @return string
+     */
+    public function getMissing()
+    {
+        return $this->_stats['missing'];
+    }
+
+    /**
+     * Get sumOfSquares value
+     *
+     * @return string
+     */
+    public function getSumOfSquares()
+    {
+        return $this->_stats['sumOfSquares'];
+    }
+
+    /**
+     * Get mean value
+     *
+     * @return string
+     */
+    public function getMean()
+    {
+        return $this->_stats['mean'];
+    }
+
+    /**
+     * Get stddev value
+     *
+     * @return string
+     */
+    public function getStddev()
+    {
+        return $this->_stats['stddev'];
+    }
+
+    /**
+     * Get facet stats
+     *
+     * @return array
+     */
+    public function getFacets()
+    {
+        return $this->_stats['facets'];
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Terms.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Terms.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Terms.php	(revision 7576)
@@ -0,0 +1,152 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Terms query result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Terms extends Solarium_Result_QueryType implements IteratorAggregate, Countable
+{
+    /**
+     * Status code returned by Solr
+     *
+     * @var int
+     */
+    protected $_status;
+
+    /**
+     * Solr index queryTime
+     *
+     * This doesn't include things like the HTTP responsetime. Purely the Solr
+     * query execution time.
+     *
+     * @var int
+     */
+    protected $_queryTime;
+
+    /**
+     * Term results
+     *
+     * @var array
+     */
+    protected $_results;
+
+    /**
+     * Get Solr status code
+     *
+     * This is not the HTTP status code! The normal value for success is 0.
+     *
+     * @return int
+     */
+    public function getStatus()
+    {
+        $this->_parseResponse();
+
+        return $this->_status;
+    }
+
+    /**
+     * Get Solr query time
+     *
+     * This doesn't include things like the HTTP responsetime. Purely the Solr
+     * query execution time.
+     *
+     * @return int
+     */
+    public function getQueryTime()
+    {
+        $this->_parseResponse();
+
+        return $this->_queryTime;
+    }
+
+    /**
+     * Get all term results
+     *
+     * @return array
+     */
+    public function getResults()
+    {
+        $this->_parseResponse();
+
+        return $this->_results;
+    }
+
+    /**
+     * Get term results for a specific field
+     *
+     * @param string $field
+     * @return array
+     */
+    public function getTerms($field)
+    {
+        $this->_parseResponse();
+
+        if (isset($this->_results[$field])) {
+            return $this->_results[$field];
+        } else {
+            return array();
+        }
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        $this->_parseResponse();
+
+        return new ArrayIterator($this->_results);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        $this->_parseResponse();
+
+        return count($this->_results);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/List.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/List.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/List.php	(revision 7576)
@@ -0,0 +1,115 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Analysis list result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Analysis_List implements IteratorAggregate, Countable
+{
+
+    /**
+     * List name
+     *
+     * @var string
+     */
+    protected $_name;
+
+    /**
+     * List items
+     *
+     * @var array
+     */
+    protected $_items;
+
+
+    /**
+     * Constructor
+     *
+     * @param string $name
+     * @param array $items
+     */
+    public function __construct($name, $items)
+    {
+        $this->_name = $name;
+        $this->_items = $items;
+    }
+
+    /**
+     * Get type value
+     *
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->_name;
+    }
+
+    /**
+     * Get all items
+     *
+     * @return array
+     */
+    public function getItems()
+    {
+        return $this->_items;
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_items);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_items);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/Document.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/Document.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/Document.php	(revision 7576)
@@ -0,0 +1,155 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Analysis document query result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Analysis_Document extends Solarium_Result_QueryType
+    implements IteratorAggregate, Countable
+{
+
+    /**
+     * Document instances array
+     *
+     * @var array
+     */
+    protected $_items;
+
+    /**
+     * Status code returned by Solr
+     *
+     * @var int
+     */
+    protected $_status;
+
+    /**
+     * Solr index queryTime
+     *
+     * This doesn't include things like the HTTP responsetime. Purely the Solr
+     * query execution time.
+     *
+     * @var int
+     */
+    protected $_queryTime;
+
+    /**
+     * Get Solr status code
+     *
+     * This is not the HTTP status code! The normal value for success is 0.
+     *
+     * @return int
+     */
+    public function getStatus()
+    {
+        $this->_parseResponse();
+
+        return $this->_status;
+    }
+
+    /**
+     * Get Solr query time
+     *
+     * This doesn't include things like the HTTP responsetime. Purely the Solr
+     * query execution time.
+     *
+     * @return int
+     */
+    public function getQueryTime()
+    {
+        $this->_parseResponse();
+
+        return $this->_queryTime;
+    }
+
+    /**
+     * Get all documents
+     *
+     * @return array
+     */
+    public function getDocuments()
+    {
+        $this->_parseResponse();
+
+        return $this->_items;
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        $this->_parseResponse();
+
+        return new ArrayIterator($this->_items);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        $this->_parseResponse();
+
+        return count($this->_items);
+    }
+
+    /**
+     * Get a document by uniquekey value
+     *
+     * @param string $key
+     * @return Solarium_Result_Analysis_List|null
+     */
+    public function getDocument($key)
+    {
+        $this->_parseResponse();
+
+        if (isset($this->_items[$key])) {
+            return $this->_items[$key];
+        } else {
+            return null;
+        }
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/Item.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/Item.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/Item.php	(revision 7576)
@@ -0,0 +1,209 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Analysis item
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Analysis_Item
+{
+
+    /**
+     * Text string
+     *
+     * @var string
+     */
+    protected $_text;
+
+    /**
+     * RawText string
+     *
+     * @var string
+     */
+    protected $_rawText;
+
+    /**
+     * Start
+     *
+     * @var int
+     */
+    protected $_start;
+
+    /**
+     * End
+     *
+     * @var int
+     */
+    protected $_end;
+
+    /**
+     * Position
+     *
+     * @var int
+     */
+    protected $_position;
+
+    /**
+     * Position history
+     *
+     * @var array
+     */
+    protected $_positionHistory;
+
+    /**
+     * Type
+     *
+     * @var string
+     */
+    protected $_type;
+
+    /**
+     * Match
+     *
+     * @var boolean
+     */
+    protected $_match = false;
+
+    /**
+     * Constructor
+     *
+     * @param array $analysis
+     */
+    public function __construct($analysis)
+    {
+        $this->_text = $analysis['text'];
+        $this->_start = $analysis['start'];
+        $this->_end = $analysis['end'];
+        $this->_position = $analysis['position'];
+        $this->_positionHistory = $analysis['positionHistory'];
+        $this->_type = $analysis['type'];
+
+        if (isset($analysis['raw_text'])) {
+            $this->_rawText = $analysis['raw_text'];
+        }
+
+        if (isset($analysis['match'])) {
+            $this->_match = $analysis['match'];
+        }
+    }
+
+    /**
+     * Get text value
+     *
+     * @return string
+     */
+    public function getText()
+    {
+        return $this->_text;
+    }
+
+    /**
+     * Get raw text value
+     *
+     * This values is not available in all cases
+     *
+     * @return string
+     */
+    public function getRawText()
+    {
+        return $this->_rawText;
+    }
+
+    /**
+     * Get start value
+     *
+     * @return int
+     */
+    public function getStart()
+    {
+        return $this->_start;
+    }
+
+    /**
+     * Get end value
+     *
+     * @return int
+     */
+    public function getEnd()
+    {
+        return $this->_end;
+    }
+
+    /**
+     * Get postion value
+     *
+     * @return int
+     */
+    public function getPosition()
+    {
+        return $this->_position;
+    }
+
+    /**
+     * Get position history value
+     *
+     * @return array
+     */
+    public function getPositionHistory()
+    {
+        return $this->_positionHistory;
+    }
+
+    /**
+     * Get type value
+     *
+     * @return string
+     */
+    public function getType()
+    {
+        return $this->_type;
+    }
+
+    /**
+     * Get match value
+     *
+     * @return boolean
+     */
+    public function getMatch()
+    {
+        return $this->_match;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/Field.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/Field.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/Field.php	(revision 7576)
@@ -0,0 +1,138 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Analysis field query result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Analysis_Field extends Solarium_Result_QueryType
+    implements IteratorAggregate, Countable
+{
+
+    /**
+     * List instances array
+     *
+     * @var array
+     */
+    protected $_items;
+
+    /**
+     * Status code returned by Solr
+     *
+     * @var int
+     */
+    protected $_status;
+
+    /**
+     * Solr index queryTime
+     *
+     * This doesn't include things like the HTTP responsetime. Purely the Solr
+     * query execution time.
+     *
+     * @var int
+     */
+    protected $_queryTime;
+
+    /**
+     * Get Solr status code
+     *
+     * This is not the HTTP status code! The normal value for success is 0.
+     *
+     * @return int
+     */
+    public function getStatus()
+    {
+        $this->_parseResponse();
+
+        return $this->_status;
+    }
+
+    /**
+     * Get Solr query time
+     *
+     * This doesn't include things like the HTTP responsetime. Purely the Solr
+     * query execution time.
+     *
+     * @return int
+     */
+    public function getQueryTime()
+    {
+        $this->_parseResponse();
+
+        return $this->_queryTime;
+    }
+
+    /**
+     * Get all lists
+     *
+     * @return array
+     */
+    public function getLists()
+    {
+        $this->_parseResponse();
+
+        return $this->_items;
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        $this->_parseResponse();
+
+        return new ArrayIterator($this->_items);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        $this->_parseResponse();
+
+        return count($this->_items);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/Types.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/Types.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Analysis/Types.php	(revision 7576)
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Analysis types result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Analysis_Types extends Solarium_Result_Analysis_List
+{
+
+    /**
+     * Get index analysis list
+     *
+     * @return Solarium_Result_Analysis_List|null
+     */
+    public function getIndexAnalysis()
+    {
+        foreach ($this->_items AS $item) {
+            if ($item->getName() == 'index') {
+                return $item;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Get query analysis list
+     *
+     * @return Solarium_Result_Analysis_List|null
+     */
+    public function getQueryAnalysis()
+    {
+        foreach ($this->_items AS $item) {
+            if ($item->getName() == 'query') {
+                return $item;
+            }
+        }
+
+        return null;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Ping.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Ping.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Ping.php	(revision 7576)
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Ping query result
+ *
+ * A ping query has no useful result so only a dummy status var is available.
+ * If you don't get an exception for a ping query it was succesful.
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Ping extends Solarium_Result
+{
+
+    /**
+     * Get Solr status code
+     *
+     * Since no status is returned for a ping, a default of 0 is used.
+     * If you don't get an exception for a ping query it was succesful.
+     *
+     * @return int
+     */
+    public function getStatus()
+    {
+        return 0;
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/MoreLikeThis.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/MoreLikeThis.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/MoreLikeThis.php	(revision 7576)
@@ -0,0 +1,109 @@
+<?php
+/**
+ * Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Gasol Wu <gasol.wu@gmail.com>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * MoreLikeThis query result
+ *
+ * This is the standard resulttype for a moreLikeThis query. Example usage:
+ * <code>
+ * // total solr mlt results
+ * $result->getNumFound();
+ *
+ * // results fetched
+ * count($result);
+ *
+ * // iterate over fetched mlt docs
+ * foreach ($result AS $doc) {
+ *    ....
+ * }
+ * </code>
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_MoreLikeThis extends Solarium_Result_Select
+{
+    /**
+     * MLT interesting terms
+     */
+    protected $_interestingTerms;
+
+    /**
+     * MLT match document
+     */
+    protected $_match;
+
+    /**
+     * Get MLT interesting terms
+     * 
+     * this will show what "interesting" terms are used for the MoreLikeThis
+     * query. These are the top tf/idf terms. NOTE: if you select 'details',
+     * this shows you the term and boost used for each term. Unless
+     * mlt.boost=true all terms will have boost=1.0
+     *
+     * @return array
+     */
+    public function getInterestingTerms()
+    {
+        $query = $this->getQuery();
+        if ('none' == $query->getInterestingTerms()) {
+            throw new Solarium_Exception('interestingterms is none');
+        }
+        $this->_parseResponse();
+        return $this->_interestingTerms;
+    }
+
+    /**
+     * Get matched document
+     *
+     * Only available if matchinclude was set to true in the query.
+     *
+     * @throws Solarium_Exception
+     * @return Solarium_Document
+     */
+    public function getMatch()
+    {
+        $query = $this->getQuery();
+        if (true != $query->getMatchInclude()) {
+            throw new Solarium_Exception('matchinclude was disabled in the MLT query');
+        }
+        $this->_parseResponse();
+        return $this->_match;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Select.php	(revision 7576)
@@ -0,0 +1,296 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Select query result
+ *
+ * This is the standard resulttype for a select query. Example usage:
+ * <code>
+ * // total solr results
+ * $result->getNumFound();
+ *
+ * // results fetched
+ * count($result);
+ *
+ * // get a single facet by key
+ * $result->getFacet('category');
+ *
+ * // iterate over fetched docs
+ * foreach ($result AS $doc) {
+ *    ....
+ * }
+ * </code>
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Select extends Solarium_Result_QueryType
+    implements IteratorAggregate, Countable
+{
+
+    /**
+     * Solr numFound
+     *
+     * This is NOT the number of document fetched from Solr!
+     *
+     * @var int
+     */
+    protected $_numfound;
+
+    /**
+     * Document instances array
+     *
+     * @var array
+     */
+    protected $_documents;
+
+    /**
+     * Component results
+     */
+    protected $_components;
+
+    /**
+     * Status code returned by Solr
+     *
+     * @var int
+     */
+    protected $_status;
+
+    /**
+     * Solr index queryTime
+     *
+     * This doesn't include things like the HTTP responsetime. Purely the Solr
+     * query execution time.
+     *
+     * @var int
+     */
+    protected $_queryTime;
+
+    /**
+     * Get Solr status code
+     *
+     * This is not the HTTP status code! The normal value for success is 0.
+     *
+     * @return int
+     */
+    public function getStatus()
+    {
+        $this->_parseResponse();
+
+        return $this->_status;
+    }
+
+    /**
+     * Get Solr query time
+     *
+     * This doesn't include things like the HTTP responsetime. Purely the Solr
+     * query execution time.
+     *
+     * @return int
+     */
+    public function getQueryTime()
+    {
+        $this->_parseResponse();
+
+        return $this->_queryTime;
+    }
+
+    /**
+     * get Solr numFound
+     *
+     * Returns the total number of documents found by Solr (this is NOT the
+     * number of document fetched from Solr!)
+     *
+     * @return int
+     */
+    public function getNumFound()
+    {
+        $this->_parseResponse();
+
+        return $this->_numfound;
+    }
+
+    /**
+     * Get all documents
+     *
+     * @return array
+     */
+    public function getDocuments()
+    {
+        $this->_parseResponse();
+
+        return $this->_documents;
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        $this->_parseResponse();
+
+        return new ArrayIterator($this->_documents);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        $this->_parseResponse();
+
+        return count($this->_documents);
+    }
+
+    /**
+     * Get all component results
+     *
+     * @return array
+     */
+    public function getComponents()
+    {
+        $this->_parseResponse();
+
+        return $this->_components;
+    }
+
+    /**
+     * Get a component result by key
+     *
+     * @param string $key
+     * @return Solarium_Result_Select_Component
+     */
+    public function getComponent($key)
+    {
+        $this->_parseResponse();
+
+        if (isset($this->_components[$key])) {
+            return $this->_components[$key];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Get morelikethis component result
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Result_Select_MoreLikeThis
+     */
+    public function getMoreLikeThis()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_MORELIKETHIS);
+    }
+
+    /**
+     * Get highlighting component result
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Result_Select_Highlighting
+     */
+    public function getHighlighting()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_HIGHLIGHTING);
+    }
+
+    /**
+     * Get grouping component result
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Result_Select_Grouping
+     */
+    public function getGrouping()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_GROUPING);
+    }
+
+    /**
+     * Get facetset component result
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Result_Select_FacetSet
+     */
+    public function getFacetSet()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_FACETSET);
+    }
+
+    /**
+     * Get spellcheck component result
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Result_Select_Spellcheck
+     */
+    public function getSpellcheck()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_SPELLCHECK);
+    }
+
+    /**
+     * Get stats component result
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Result_Select_Stats
+     */
+    public function getStats()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_STATS);
+    }
+
+    /**
+     * Get debug component result
+     *
+     * This is a convenience method that maps presets to getComponent
+     *
+     * @return Solarium_Result_Select_Debug
+     */
+    public function getDebug()
+    {
+        return $this->getComponent(Solarium_Query_Select::COMPONENT_DEBUG);
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Suggester/Term.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Suggester/Term.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Suggester/Term.php	(revision 7576)
@@ -0,0 +1,154 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Suggester query term result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Suggester_Term implements IteratorAggregate, Countable
+{
+
+    /**
+     * NumFound
+     *
+     * @var int
+     */
+    protected $_numFound;
+
+    /**
+     * StartOffset
+     *
+     * @var int
+     */
+    protected $_startOffset;
+
+    /**
+     * EndOffset
+     *
+     * @var int
+     */
+    protected $_endOffset;
+
+    /**
+     * Suggestions
+     *
+     * @var array
+     */
+    protected $_suggestions;
+
+
+    /**
+     * Constructor
+     *
+     * @param int $numFound
+     * @param int $startOffset
+     * @param int $endOffset
+     * @param array $suggestions
+     */
+    public function __construct($numFound, $startOffset, $endOffset, $suggestions)
+    {
+        $this->_numFound = $numFound;
+        $this->_startOffset = $startOffset;
+        $this->_endOffset = $endOffset;
+        $this->_suggestions = $suggestions;
+    }
+
+    /**
+     * Get NumFound
+     *
+     * @return int
+     */
+    public function getNumFound()
+    {
+        return $this->_numFound;
+    }
+
+    /**
+     * Get StartOffset
+     *
+     * @return int
+     */
+    public function getStartOffset()
+    {
+        return $this->_startOffset;
+    }
+
+    /**
+     * Get EndOffset
+     *
+     * @return int
+     */
+    public function getEndOffset()
+    {
+        return $this->_endOffset;
+    }
+
+    /**
+     * Get suggestions
+     *
+     * @return array
+     */
+    public function getSuggestions()
+    {
+        return $this->_suggestions;
+    }
+
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_suggestions);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->_suggestions);
+    }
+
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Update.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Update.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Update.php	(revision 7576)
@@ -0,0 +1,98 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Update result
+ *
+ * An update query only returns a query time and status. Both are accessible
+ * using the methods provided by {@link Solarium_Result_Query}.
+ *
+ * @internal For now this class only exists to distinguish the different result
+ *  types. It might get some extra behaviour in the future.
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Update extends Solarium_Result_QueryType
+{
+    /**
+     * Status code returned by Solr
+     *
+     * @var int
+     */
+    protected $_status;
+
+    /**
+     * Solr index queryTime
+     *
+     * This doesn't include things like the HTTP responsetime. Purely the Solr
+     * query execution time.
+     *
+     * @var int
+     */
+    protected $_queryTime;
+
+    /**
+     * Get Solr status code
+     *
+     * This is not the HTTP status code! The normal value for success is 0.
+     *
+     * @return int
+     */
+    public function getStatus()
+    {
+        $this->_parseResponse();
+
+        return $this->_status;
+    }
+
+    /**
+     * Get Solr query time
+     *
+     * This doesn't include things like the HTTP responsetime. Purely the Solr
+     * query execution time.
+     *
+     * @return int
+     */
+    public function getQueryTime()
+    {
+        $this->_parseResponse();
+
+        return $this->_queryTime;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/QueryType.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/QueryType.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/QueryType.php	(revision 7576)
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * QueryType result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_QueryType extends Solarium_Result
+{
+
+    /**
+     * Lazy load parsing indicator
+     *
+     * @var bool
+     */
+    protected $_parsed = false;
+
+    /**
+     * Parse response into result objects
+     *
+     * Only runs once
+     * 
+     * @return void
+     */
+    protected function _parseResponse()
+    {
+        if (!$this->_parsed) {
+            $queryType = $this->_query->getType();
+            $queryTypes = $this->_client->getQueryTypes();
+            if (!isset($queryTypes[$queryType])) {
+                throw new Solarium_Exception('No responseparser registered for querytype: '. $queryType);
+            }
+
+            $responseParserClass = $queryTypes[$queryType]['responseparser'];
+            $responseParser = new $responseParserClass;
+            $this->_mapData($responseParser->parse($this));
+
+            $this->_parsed = true;
+        }
+    }
+
+    /**
+     * Map parser data into properties
+     *
+     * @param array $mapData
+     * @return void
+     */
+    protected function _mapData($mapData)
+    {
+        foreach ($mapData AS $key => $data) {
+            $this->{'_'.$key} = $data;
+        }
+    }
+    
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Suggester.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Suggester.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/library/Solarium/Result/Suggester.php	(revision 7576)
@@ -0,0 +1,173 @@
+<?php
+/**
+ * Copyright 2011 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+
+/**
+ * Suggester query result
+ *
+ * @package Solarium
+ * @subpackage Result
+ */
+class Solarium_Result_Suggester extends Solarium_Result_QueryType implements IteratorAggregate, Countable
+{
+    /**
+     * Status code returned by Solr
+     *
+     * @var int
+     */
+    protected $_status;
+
+    /**
+     * Solr index queryTime
+     *
+     * This doesn't include things like the HTTP responsetime. Purely the Solr
+     * query execution time.
+     *
+     * @var int
+     */
+    protected $_queryTime;
+
+    /**
+     * Suggester results
+     *
+     * @var array
+     */
+    protected $_results;
+
+    /**
+     * Collation result
+     *
+     * Only available when collate is enabled in the suggester query
+     *
+     * @var string
+     */
+    protected $_collation;
+
+    /**
+     * Get Solr status code
+     *
+     * This is not the HTTP status code! The normal value for success is 0.
+     *
+     * @return int
+     */
+    public function getStatus()
+    {
+        $this->_parseResponse();
+
+        return $this->_status;
+    }
+
+    /**
+     * Get Solr query time
+     *
+     * This doesn't include things like the HTTP responsetime. Purely the Solr
+     * query execution time.
+     *
+     * @return int
+     */
+    public function getQueryTime()
+    {
+        $this->_parseResponse();
+
+        return $this->_queryTime;
+    }
+
+    /**
+     * Get all results
+     *
+     * @return array
+     */
+    public function getResults()
+    {
+        $this->_parseResponse();
+
+        return $this->_results;
+    }
+
+    /**
+     * Get results for a specific term
+     *
+     * @param string $term
+     * @return array
+     */
+    public function getTerm($term)
+    {
+        $this->_parseResponse();
+
+        if (isset($this->_results[$term])) {
+            return $this->_results[$term];
+        } else {
+            return array();
+        }
+    }
+
+    /**
+     * IteratorAggregate implementation
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        $this->_parseResponse();
+
+        return new ArrayIterator($this->_results);
+    }
+
+    /**
+     * Countable implementation
+     *
+     * @return int
+     */
+    public function count()
+    {
+        $this->_parseResponse();
+
+        return count($this->_results);
+    }
+
+    /**
+     * Get collation
+     *
+     * @return null|string
+     */
+    public function getCollation()
+    {
+        $this->_parseResponse();
+
+        return $this->_collation;
+    }
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/init.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/init.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/init.php	(revision 7576)
@@ -0,0 +1,21 @@
+<?php
+
+error_reporting(E_ALL);
+ini_set('display_errors', true);
+
+require('autoload.php');
+
+if (file_exists('config.php')) {
+    require('config.php');
+} else {
+    require('config.dist.php');
+}
+
+
+function htmlHeader(){
+    echo '<html><head><title>Solarium examples</title></head><body>';
+}
+
+function htmlFooter(){
+    echo '</body></html>';
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/.buildpath
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/.buildpath	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/.buildpath	(revision 7576)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<buildpath>
+	<buildpathentry kind="src" path=""/>
+	<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
+</buildpath>
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/phar/buildphar.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/phar/buildphar.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/phar/buildphar.php	(revision 7576)
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Copyright 2012 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2012 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ */
+
+
+// Check phar.readonly ini setting
+if (ini_get('phar.readonly') == '1') {
+    exit("Your php.ini has phar.readonly enabled. Phar cannot be created. Please alter your php.ini first.\n");
+}
+
+// You can optionally use arguments to enable compression and whitespace/comment stripping.
+// Example: "php buildphar.php -s 1 -c 1"
+// -c with a value of 1 enables compression, multiple phars will be created
+// -s with a value of 1 enables stripping
+$options = getopt('s:c:');
+$compress = (isset($options['c']) && $options['c'] == '1');
+$strip = (isset($options['s']) && $options['s'] == '1');
+
+$start = microtime(true);
+
+// Create a new Solarium phar file
+@unlink('solarium.phar');
+$phar = new Phar('solarium.phar', 0, 'solarium.phar');
+$phar->setStub(file_get_contents("stub.php"));
+$phar->setSignatureAlgorithm(Phar::SHA1);
+
+// Add files to the phar
+$basePath = realpath(__DIR__."/../library/Solarium");
+if ($strip) {
+    $directoryIterator = new RecursiveIteratorIterator (new RecursiveDirectoryIterator ($basePath), RecursiveIteratorIterator::SELF_FIRST);
+    foreach ($directoryIterator as $file) {
+        if ( preg_match ('/\\.php$/i', $file) ) {
+            $phar->addFromString (substr ($file, strlen ($basePath) + 1), php_strip_whitespace ($file));
+        }
+    }
+} else {
+    $phar->buildFromDirectory($basePath, '/\.php$/');
+}
+
+// Create compressed versions
+if ($compress) {
+    $phar->compress(Phar::BZ2);
+    $phar->compress(Phar::GZ);
+}
+
+$time = round(microtime(true)-$start,5);
+echo "\nDONE ($time seconds)\n\n";
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/phar/stub.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/phar/stub.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/phar/stub.php	(revision 7576)
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Copyright 2012 Bas de Nooijer. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this listof conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the copyright holder.
+ *
+ * @copyright Copyright 2012 Bas de Nooijer <solarium@raspberry.nl>
+ * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
+ * @link http://www.solarium-project.org/
+ */
+
+Phar::mapPhar("solarium.phar");
+require_once 'phar://solarium.phar/Autoloader.php';
+Solarium_Autoloader::register();
+
+if ('cli' === php_sapi_name() && basename(__FILE__) === basename($_SERVER['argv'][0]) && isset($_SERVER['argv'][1])) {
+
+    switch ($_SERVER['argv'][1]) {
+
+        case 'version':
+            echo "Solarium version " . Solarium_Version::VERSION ."\n";
+            break;
+
+        default:
+            echo "Unknown command '" . $_SERVER['argv'][1] . "' (Supported commands: version)\n";
+    }
+
+    exit(0);
+}
+
+__HALT_COMPILER();
+?>
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/phar/README
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/phar/README	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/phar/README	(revision 7576)
@@ -0,0 +1,1 @@
+The buildphar.php will generate a solarium.phar PHAR file that is ready for distribution.
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/config.dist.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/config.dist.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/config.dist.php	(revision 7576)
@@ -0,0 +1,9 @@
+<?php
+
+$config = array(
+    'adapteroptions' => array(
+        'host' => '127.1.1.1',
+        'port' => 8983,
+        'path' => '/solr',
+    )
+);
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/index.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/index.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/index.php	(revision 7576)
@@ -0,0 +1,44 @@
+
+<!---->
+<!--<html><head><title>Basic select</title></head><body>-->
+
+<?php
+require('../library/Solarium/Autoloader.php');
+Solarium_Autoloader::register();
+
+// create a client instance
+$client = new Solarium_Client();
+
+// get a select query instance
+$query = $client->createSelect();
+
+$query->setQuery("nÃ£o");
+
+// override the default row limit of 10 by setting rows to 30
+$query->setRows(30);
+
+// this executes the query with default settings and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+?>
+<!--</body></html>-->
+
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/.settings/org.eclipse.php.core.prefs
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/.settings/org.eclipse.php.core.prefs	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/.settings/org.eclipse.php.core.prefs	(revision 7576)
@@ -0,0 +1,3 @@
+#Tue Sep 11 09:19:54 BRT 2012
+eclipse.preferences.version=1
+include_path=0;/solr-client
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/autoload.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/autoload.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/autoload.php	(revision 7576)
@@ -0,0 +1,4 @@
+<?php
+
+require('library/Solarium/Autoloader.php');
+Solarium_Autoloader::register();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.7-query-reuse.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.7-query-reuse.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.7-query-reuse.php	(revision 7576)
@@ -0,0 +1,72 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+
+// first create a base query as a query class
+class PriceQuery extends Solarium_Query_Select
+{
+    protected function _init()
+    {
+        // set a query (all prices starting from 12)
+        $this->setQuery('price:[12 TO *]');
+
+        // set start and rows param (comparable to SQL limit) using fluent interface
+        $this->setStart(2)->setRows(20);
+
+        // set fields to fetch (this overrides the default setting 'all fields')
+        $this->setFields(array('id','name','price'));
+
+        // sort the results by price ascending
+        $this->addSort('price', self::SORT_ASC);
+    }
+}
+
+// the query instance easily be altered based on user input
+// try calling this page with "?start=10" added to the url.
+$query = new PriceQuery();
+if(isset($_GET['start']) && is_numeric($_GET['start'])){
+    $query->setStart($_GET['start']);
+}
+
+// alternatively you can use class inheritance to create query inheritance
+// in this example this class isn't actually used, but you can simple replace
+// the var $query with an instance of this class...
+class LowerPriceQuery extends PriceQuery{
+    protected function _init()
+    {
+        // this call makes sure we get all the settings of the parent class
+        parent::_init();
+
+        $this->setQuery('price:[5 TO *]');
+    }
+}
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.8-distributed-search.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.8-distributed-search.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.8-distributed-search.php	(revision 7576)
@@ -0,0 +1,41 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// add distributed search settings
+// see http://wiki.apache.org/solr/DistributedSearch#Distributed_Search_Example for setting up two solr instances
+$distributedSearch = $query->getDistributedSearch();
+$distributedSearch->addShard('shard1', 'localhost:8983/solr');
+$distributedSearch->addShard('shard2', 'localhost:7574/solr');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/1.2-basic-select.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/1.2-basic-select.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/1.2-basic-select.php	(revision 7576)
@@ -0,0 +1,35 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.1.1-zend-http-adapter.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.1.1-zend-http-adapter.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.1.1-zend-http-adapter.php	(revision 7576)
@@ -0,0 +1,45 @@
+<?php
+
+require_once 'Zend/Loader/Autoloader.php';
+$loader = Zend_Loader_Autoloader::getInstance();
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// set the adapter to zendhttp and get a zendhttp client instance reference
+$client->setAdapter('Solarium_Client_Adapter_ZendHttp');
+$zendHttp = $client->getAdapter()->getZendHttp();
+
+// you can use any of the zend_http features, like http-authentication
+$zendHttp->setAuth('user', 'password!', Zend_Http_Client::AUTH_BASIC);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.2-escaping.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.2-escaping.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.2-escaping.php	(revision 7576)
@@ -0,0 +1,43 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// search input string, this value fails without escaping because of the double-quote
+$input = 'ATA "133';
+
+// in this case phrase escaping is used (most common) but you can also do term escaping, see the manual
+// also note that the same can be done using the placeholder syntax, see example 6.3
+$helper = $query->getHelper();
+$query->setQuery('features:' . $helper->escapePhrase($input));
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.5-edismax.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.5-edismax.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.5-edismax.php	(revision 7576)
@@ -0,0 +1,44 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// get the dismax component and set a boost query
+$dismax = $query->getDisMax();
+
+// override the default setting of 'dismax' to enable 'edismax'
+$dismax->setQueryParser('edismax');
+
+// this query is now a dismax query
+$query->setQuery('memory -printer');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/1.1-check-solarium-and-ping.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/1.1-check-solarium-and-ping.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/1.1-check-solarium-and-ping.php	(revision 7576)
@@ -0,0 +1,25 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// check solarium version available
+echo 'Solarium library version: ' . Solarium_Version::VERSION . ' - ';
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// create a ping query
+$ping = $client->createPing();
+
+// execute the ping query
+try{
+    $result = $client->ping($ping);
+    echo 'Ping query successful';
+    echo '<br/><pre>';
+    var_dump($result->getData());
+}catch(Solarium_Exception $e){
+    echo 'Ping query failed';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/1.3-basic-update.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/1.3-basic-update.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/1.3-basic-update.php	(revision 7576)
@@ -0,0 +1,47 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+if ($_POST) {
+    // if data is posted add it to solr
+
+    // create a client instance
+    $client = new Solarium_Client($config);
+
+    // get an update query instance
+    $update = $client->createUpdate();
+
+    // create a new document for the data
+    // please note that any type of validation is missing in this example to keep it simple!
+    $doc = $update->createDocument();
+    $doc->id = $_POST['id'];
+    $doc->name = $_POST['name'];
+    $doc->price = $_POST['price'];
+    
+    // add the document and a commit command to the update query
+    $update->addDocument($doc);
+    $update->addCommit();
+
+    // this executes the query and returns the result
+    $result = $client->update($update);
+
+    echo '<b>Update query executed</b><br/>';
+    echo 'Query status: ' . $result->getStatus(). '<br/>';
+    echo 'Query time: ' . $result->getQueryTime();
+
+} else {
+    // if no data is posted show a form
+?>
+
+    <form method="POST">
+        Id: <input type="text" name="id"/> <br/>
+        Name: <input type="text" name="name"/> <br/>
+        Price: <input type="text" name="price"/> <br/>
+        <input type="submit" value="Add"/>
+    </form>
+
+<?php
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.4-optimize.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.4-optimize.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.4-optimize.php	(revision 7576)
@@ -0,0 +1,22 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get an update query instance
+$update = $client->createUpdate();
+
+// optimize the index
+$update->addOptimize(true, false, 5);
+
+// this executes the query and returns the result
+$result = $client->update($update);
+
+echo '<b>Update query executed</b><br/>';
+echo 'Query status: ' . $result->getStatus(). '<br/>';
+echo 'Query time: ' . $result->getQueryTime();
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.3-delete-by-id.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.3-delete-by-id.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.3-delete-by-id.php	(revision 7576)
@@ -0,0 +1,23 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get an update query instance
+$update = $client->createUpdate();
+
+// add the delete id and a commit command to the update query
+$update->addDeleteById(123);
+$update->addCommit();
+
+// this executes the query and returns the result
+$result = $client->update($update);
+
+echo '<b>Update query executed</b><br/>';
+echo 'Query status: ' . $result->getStatus(). '<br/>';
+echo 'Query time: ' . $result->getQueryTime();
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.1-plugin-loadbalancer.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.1-plugin-loadbalancer.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.1-plugin-loadbalancer.php	(revision 7576)
@@ -0,0 +1,47 @@
+<?php
+require('init.php');
+
+htmlHeader();
+
+// create a client instance and get loadbalancer plugin instance
+$client = new Solarium_Client($config);
+$loadbalancer = $client->getPlugin('loadbalancer');
+
+// apply loadbalancer settings
+$optionsSolrOne = array('host' => '127.0.0.1', 'port' => 8983);
+$optionsSolrTwo = array('host' => '127.0.0.1', 'port' => 7574);
+$loadbalancer->addServer('solr1', $optionsSolrOne, 100);
+$loadbalancer->addServer('solr2', $optionsSolrTwo, 200);
+$loadbalancer->addServer('solr3', $optionsSolrTwo, 1);
+
+// create a basic query to execute
+$query = $client->createSelect();
+
+// execute the query multiple times, displaying the server for each execution
+for($i=1; $i<=8; $i++) {
+    $resultset = $client->select($query);
+    echo 'Query execution #' . $i . '<br/>';
+    echo 'NumFound: ' . $resultset->getNumFound(). '<br/>';
+    echo 'Server: ' . $loadbalancer->getLastServerKey() .'<hr/>';
+}
+
+// force a server for a query (normally solr 3 is extremely unlikely based on it's weight)
+$loadbalancer->setForcedServerForNextQuery('solr3');
+$resultset = $client->select($query);
+echo 'Query execution with server forced to solr3<br/>';
+echo 'NumFound: ' . $resultset->getNumFound(). '<br/>';
+echo 'Server: ' . $loadbalancer->getLastServerKey() .'<hr/>';
+
+// test a ping query
+$query = $client->createPing();
+$client->ping($query);
+echo 'Loadbalanced ping query, should display a loadbalancing server:<br/>';
+echo 'Ping server: ' . $loadbalancer->getLastServerKey() .'<hr/>';
+
+// exclude ping query from loadbalancing
+$loadbalancer->addBlockedQueryType(Solarium_Client::QUERYTYPE_PING);
+$client->ping($query);
+echo 'Non-loadbalanced ping query, should not display a loadbalancing server:<br/>';
+echo 'Ping server: ' . $loadbalancer->getLastServerKey() .'<hr/>';
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.3-highlighting.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.3-highlighting.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.3-highlighting.php	(revision 7576)
@@ -0,0 +1,51 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+$query->setQuery('memory');
+
+// get highlighting component and apply settings
+$hl = $query->getHighlighting();
+$hl->setFields('name, features');
+$hl->setSimplePrefix('<b>');
+$hl->setSimplePostfix('</b>');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+$highlighting = $resultset->getHighlighting();
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table><br/><b>Highlighting results:</b><br/>';
+
+    // highlighting results can be fetched by document id (the field defined as uniquekey in this schema)
+    $highlightedDoc = $highlighting->getResult($document->id);
+    if($highlightedDoc){
+        foreach($highlightedDoc as $field => $highlight) {
+            echo implode(' (...) ', $highlight) . '<br/>';
+        }
+    }
+
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/autoload.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/autoload.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/autoload.php	(revision 7576)
@@ -0,0 +1,4 @@
+<?php
+
+require('../library/Solarium/Autoloader.php');
+Solarium_Autoloader::register();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/4.2-configuration-usage.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/4.2-configuration-usage.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/4.2-configuration-usage.php	(revision 7576)
@@ -0,0 +1,60 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+
+// In this case an array is used for configuration to keep the example simple.
+// For an easier to use config file you are probably better of with another format, like Zend_Config_Ini
+// See the documentation for more info about this.
+$select = array(
+    'query'         => '*:*',
+    'start'         => 2,
+    'rows'          => 20,
+    'fields'        => array('id','name','price'),
+    'sort'          => array('price' => 'asc'),
+    'filterquery' => array(
+        'maxprice' => array(
+            'query' => 'price:[1 TO 300]'
+        ),
+    ),
+    'component' => array(
+        'facetset' => array(
+            'facet' => array(
+                // notice this config uses an inline key value, instead of array key like the filterquery
+                array('type' => 'field', 'key' => 'stock', 'field' => 'inStock'),
+            )
+        ),
+    ),
+);
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance based on the config
+$query = $client->createSelect($select);
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// display facet counts
+echo '<hr/>Facet counts for field "inStock":<br/>';
+$facet = $resultset->getFacetSet()->getFacet('stock');
+foreach($facet as $value => $count) {
+    echo $value . ' [' . $count . ']<br/>';
+}
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+    echo '<tr><th>id</th><td>' . $document->id . '</td></tr>';
+    echo '<tr><th>name</th><td>' . $document->name . '</td></tr>';
+    echo '<tr><th>price</th><td>' . $document->price . '</td></tr>';
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.3-placeholder-syntax.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.3-placeholder-syntax.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.3-placeholder-syntax.php	(revision 7576)
@@ -0,0 +1,45 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// search input string, this value fails without escaping because of the double-quote
+$input = 'ATA "133';
+
+// the placeholder syntax applies phrase escaping to the first term
+// see the manual for all supported formats
+$query->setQuery('features: %p1% AND inStock:%2%',array($input,1));
+
+// show the result after replacing the placeholders with values
+echo $query->getQuery() . '<br/>';
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.3.1-per-field-highlighting.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.3.1-per-field-highlighting.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.3.1-per-field-highlighting.php	(revision 7576)
@@ -0,0 +1,53 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+$query->setQuery('memory');
+
+// get highlighting component and apply settings
+// highlights are applied to three fields with a different markup for each field
+// much more per-field settings are available, see the manual for all options
+$hl = $query->getHighlighting();
+$hl->getField('name')->setSimplePrefix('<b>')->setSimplePostfix('</b>');
+$hl->getField('cat')->setSimplePrefix('<u>')->setSimplePostfix('</u>');
+$hl->getField('features')->setSimplePrefix('<i>')->setSimplePostfix('</i>');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+$highlighting = $resultset->getHighlighting();
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table><br/><b>Highlighting results:</b><br/>';
+
+    // highlighting results can be fetched by document id (the field defined as uniquekey in this schema)
+    $highlightedDoc = $highlighting->getResult($document->id);
+    if($highlightedDoc){
+        foreach($highlightedDoc as $field => $highlight) {
+            echo implode(' (...) ', $highlight) . '<br/>';
+        }
+    }
+
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.7-grouping-by-query.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.7-grouping-by-query.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.7-grouping-by-query.php	(revision 7576)
@@ -0,0 +1,45 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// get grouping component and create two query groups
+$groupComponent = $query->getGrouping();
+$groupComponent->addQuery('price:[0 TO 99.99]');
+$groupComponent->addQuery('price:[100 TO *]');
+// sorting inside groups
+$groupComponent->setSort('price desc');
+// maximum number of items per group
+$groupComponent->setLimit(5);
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+$groups = $resultset->getGrouping();
+foreach($groups AS $groupKey => $group) {
+
+    echo '<h1>'.$groupKey.'</h1>';
+
+    foreach($group AS $document) {
+        echo '<hr/><table>';
+
+        // the documents are also iterable, to get all fields
+        foreach($document AS $field => $value)
+        {
+            // this converts multivalue fields to a comma-separated string
+            if(is_array($value)) $value = implode(', ', $value);
+
+            echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+        }
+
+        echo '</table>';
+    }
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.6-plugin-prefetchiterator.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.6-plugin-prefetchiterator.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.6-plugin-prefetchiterator.php	(revision 7576)
@@ -0,0 +1,26 @@
+<?php
+require('init.php');
+
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+$query->setFields(array('id'));
+
+// get a plugin instance and apply settings
+$prefetch = $client->getPlugin('prefetchiterator');
+$prefetch->setPrefetch(2); //fetch 2 rows per query (for real world use this can be way higher)
+$prefetch->setQuery($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: ' . count($prefetch);
+
+// show document IDs using the resultset iterator
+foreach ($prefetch as $document) {
+    echo '<hr/>ID: '. $document->id;
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.6-suggester-query.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.6-suggester-query.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.6-suggester-query.php	(revision 7576)
@@ -0,0 +1,39 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a suggester query instance
+$query = $client->createSuggester();
+$query->setQuery('ap ip v'); //multiple terms
+$query->setDictionary('suggest');
+$query->setOnlyMorePopular(true);
+$query->setCount(10);
+$query->setCollate(true);
+
+// this executes the query and returns the result
+$resultset = $client->suggester($query);
+
+echo '<b>Query:</b> '.$query->getQuery().'<hr/>';
+
+// display results for each term
+foreach ($resultset as $term => $termResult) {
+    echo '<h3>' . $term . '</h3>';
+    echo 'NumFound: '.$termResult->getNumFound().'<br/>';
+    echo 'StartOffset: '.$termResult->getStartOffset().'<br/>';
+    echo 'EndOffset: '.$termResult->getEndOffset().'<br/>';
+    echo 'Suggestions:<br/>';
+    foreach($termResult as $result){
+        echo '- '.$result.'<br/>';
+    }
+
+    echo '<hr/>';
+}
+
+// display collation
+echo 'Collation: '.$resultset->getCollation();
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.10-stats.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.10-stats.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.10-stats.php	(revision 7576)
@@ -0,0 +1,54 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+$query->setRows(0);
+
+// add stats settings
+$stats = $query->getStats();
+$stats->addFacet('inStock');
+$stats->createField('popularity');
+$stats->createField('price')->addFacet('price')->addFacet('popularity');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+$statsResult = $resultset->getStats();
+
+// display the stats results
+foreach ($statsResult as $field) {
+    echo '<h1>' . $field->getName() . '</h1>';
+    echo 'Min: ' . $field->getMin() . '<br/>';
+    echo 'Max: ' . $field->getMax() . '<br/>';
+    echo 'Sum: ' . $field->getSum() . '<br/>';
+    echo 'Count: ' . $field->getCount() . '<br/>';
+    echo 'Missing: ' . $field->getMissing() . '<br/>';
+    echo 'SumOfSquares: ' . $field->getSumOfSquares() . '<br/>';
+    echo 'Mean: ' . $field->getMean() . '<br/>';
+    echo 'Stddev: ' . $field->getStddev() . '<br/>';
+
+    echo '<h2>Field facets</h2>';
+    foreach ($field->getFacets() as $field => $facet) {
+        echo '<h3>Facet ' . $field . '</h3>';
+        foreach ($facet AS $facetStats) {
+            echo '<h4>Value: ' . $facetStats->getValue() . '</h4>';
+            echo 'Min: ' . $facetStats->getMin() . '<br/>';
+            echo 'Max: ' . $facetStats->getMax() . '<br/>';
+            echo 'Sum: ' . $facetStats->getSum() . '<br/>';
+            echo 'Count: ' . $facetStats->getCount() . '<br/>';
+            echo 'Missing: ' . $facetStats->getMissing() . '<br/>';
+            echo 'SumOfSquares: ' . $facetStats->getSumOfSquares() . '<br/>';
+            echo 'Mean: ' . $facetStats->getMean() . '<br/>';
+            echo 'Stddev: ' . $facetStats->getStddev() . '<br/>';
+        }
+    }
+
+    echo '<hr/>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.1.4-facet-range.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.1.4-facet-range.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.1.4-facet-range.php	(revision 7576)
@@ -0,0 +1,45 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// get the facetset component
+$facetSet = $query->getFacetSet();
+
+// create a facet field instance and set options
+$facet = $facetSet->createFacetRange('priceranges');
+$facet->setField('price');
+$facet->setStart(1);
+$facet->setGap(100);
+$facet->setEnd(1000);
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// display facet counts
+echo '<hr/>Facet ranges:<br/>';
+$facet = $resultset->getFacetSet()->getFacet('priceranges');
+foreach($facet as $range => $count) {
+    echo $range . ' to ' . ($range + 100) . ' [' . $count . ']<br/>';
+}
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+    echo '<tr><th>id</th><td>' . $document->id . '</td></tr>';
+    echo '<tr><th>name</th><td>' . $document->name . '</td></tr>';
+    echo '<tr><th>price</th><td>' . $document->price . '</td></tr>';
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.2-plugin-postbigrequest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.2-plugin-postbigrequest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.2-plugin-postbigrequest.php	(revision 7576)
@@ -0,0 +1,45 @@
+<?php
+require('init.php');
+
+htmlHeader();
+
+// create a client instance and autoload the postbigrequest plugin
+$client = new Solarium_Client($config);
+$client->getPlugin('postbigrequest');
+
+// create a basic query to execute
+$query = $client->createSelect();
+
+// add a huge filterquery to create a very long query string
+// note: normally you would use a range for this, it's just an easy way to create a very big querystring as a test
+$fq = '';
+for($i=1; $i<=1000; $i++) {
+   $fq .= ' OR price:'.$i;
+}
+$fq = substr($fq, 4);
+$query->createFilterQuery('fq')->setQuery($fq);
+
+// without the plugin this query would fail as it is bigger than the default servlet container header buffer
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.4-plugin-parallelexecution.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.4-plugin-parallelexecution.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.4-plugin-parallelexecution.php	(revision 7576)
@@ -0,0 +1,51 @@
+<?php
+require('init.php');
+
+htmlHeader();
+
+// create a client instance and autoload the customize request plugin
+$client = new Solarium_Client($config);
+$parallel = $client->getPlugin('parallelexecution');
+
+// Add a delay param to better show the effect, as an example Solr install with
+// only a dozen documents is too fast for good testing
+// This param only works with the correct Solr plugin,
+// see http://www.raspberry.nl/2012/01/04/solr-delay-component/
+// If you don't have to plugin the example still works, just without the delay.
+$customizer = $client->getPlugin('customizerequest');
+$customizer->createCustomization(array(
+    'key' => 'delay',
+    'type' => 'param',
+    'name' => 'delay',
+    'value' => '500',
+    'persistent' => true
+));
+
+// create two queries to execute in an array. Keys are important for fetching the results later!
+$queryInstock = $client->createSelect()->setQuery('inStock:true');
+$queryLowprice = $client->createSelect()->setQuery('price:[1 TO 300]');
+
+// first execute the queries the normal way and time it
+$start = microtime(true);
+$client->execute($queryInstock);
+$client->execute($queryLowprice);
+echo 'Execution time for normal "serial" execution of two queries: ' . round(microtime(true)-$start, 3);
+
+
+echo '<hr/>';
+
+
+// now execute the two queries parallel and time it
+$start = microtime(true);
+$parallel->addQuery('instock', $queryInstock);
+$parallel->addQuery('lowprice', $queryLowprice);
+$results = $parallel->execute();
+echo 'Execution time for parallel execution of two queries: ' . round(microtime(true)-$start, 3);
+
+
+htmlFooter();
+
+// Note: for this example on a default Solr index (with a tiny index) running on localhost the performance gain is
+// minimal to none, sometimes even slightly slower!
+// In a realworld scenario with network latency, a bigger dataset, more complex queries or multiple solr instances the
+// performance gain is much more.
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.1.2-facet-query.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.1.2-facet-query.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.1.2-facet-query.php	(revision 7576)
@@ -0,0 +1,38 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// get the facetset component
+$facetSet = $query->getFacetSet();
+
+// create a facet query instance and set options
+$facetSet->createFacetQuery('stock')->setQuery('inStock: true');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// display facet query count
+$count = $resultset->getFacetSet()->getFacet('stock')->getValue();
+echo '<hr/>Facet query count : ' . $count;
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+    echo '<tr><th>id</th><td>' . $document->id . '</td></tr>';
+    echo '<tr><th>name</th><td>' . $document->name . '</td></tr>';
+    echo '<tr><th>price</th><td>' . $document->price . '</td></tr>';
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.9-spellcheck.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.9-spellcheck.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.9-spellcheck.php	(revision 7576)
@@ -0,0 +1,53 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+$query->setRows(0);
+
+// add spellcheck settings
+$spellcheck = $query->getSpellcheck();
+$spellcheck->setQuery('delll ultrashar');
+$spellcheck->setBuild(true);
+$spellcheck->setCollate(true);
+$spellcheck->setExtendedResults(true);
+$spellcheck->setCollateExtendedResults(true);
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+$spellcheckResult = $resultset->getSpellcheck();
+
+
+echo '<h1>Correctly spelled?</h1>';
+if ($spellcheckResult->getCorrectlySpelled()) {
+    echo 'yes';
+}else{
+    echo 'no';
+}
+
+echo '<h1>Suggestions</h1>';
+foreach($spellcheckResult as $suggestion) {
+    echo 'NumFound: '.$suggestion->getNumFound().'<br/>';
+    echo 'StartOffset: '.$suggestion->getStartOffset().'<br/>';
+    echo 'EndOffset: '.$suggestion->getEndOffset().'<br/>';
+    echo 'OriginalFrequency: '.$suggestion->getOriginalFrequency().'<br/>';
+    echo 'Frequency: '.$suggestion->getFrequency().'<br/>';
+    echo 'Word: '.$suggestion->getWord().'<br/>';
+    echo '<hr/>';
+}
+
+$collation = $spellcheckResult->getCollation();
+echo '<h1>Collation</h1>';
+echo 'Query: '.$collation->getQuery().'<br/>';
+echo 'Hits: '.$collation->getHits().'<br/>';
+echo 'Corrections:<br/>';
+foreach($collation->getCorrections() as $input => $correction) {
+    echo $input . ' => ' . $correction .'<br/>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.3.2-mlt-stream.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.3.2-mlt-stream.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.3.2-mlt-stream.php	(revision 7576)
@@ -0,0 +1,55 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a morelikethis query instance
+$query = $client->createMoreLikeThis();
+
+$query->setQuery('electronics memory');
+$query->setQueryStream(true);
+$query->setMltFields('manu,cat');
+$query->setMinimumDocumentFrequency(1);
+$query->setMinimumTermFrequency(1);
+$query->createFilterQuery('stock')->setQuery('inStock:true');
+$query->setInterestingTerms('details');
+$query->setMatchInclude(true);
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+echo 'Document used for matching:<br/><table>';
+foreach($resultset->getMatch() AS $field => $value)
+{
+    // this converts multivalue fields to a comma-separated string
+    if(is_array($value)) $value = implode(', ', $value);
+
+    echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+}
+echo '</table><hr/>';
+
+// display the total number of MLT documents found by solr
+echo 'Number of MLT matches found: '.$resultset->getNumFound().'<br/><br/>';
+echo '<b>Listing of matched docs:</b>';
+
+// show MLT documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.6-helper-functions.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.6-helper-functions.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.6-helper-functions.php	(revision 7576)
@@ -0,0 +1,42 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance and a query helper instance
+$query = $client->createSelect();
+$helper = $query->getHelper();
+
+// add a filterquery on a price range, using the helper to generate the range
+$query->createFilterQuery('price')->setQuery($helper->rangeQuery('price', 10, 300));
+
+// add a filterquery to find products in a range of 5km, using the helper to generate the 'geofilt' filter
+$query->createFilterQuery('region')->setQuery($helper->geofilt(45.15, -93.85, 'store', 5));
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.6-grouping-by-field.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.6-grouping-by-field.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.6-grouping-by-field.php	(revision 7576)
@@ -0,0 +1,53 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+$query->setRows(50);
+
+// get grouping component and set a field to group by
+$groupComponent = $query->getGrouping();
+$groupComponent->addField('inStock');
+// maximum number of items per group
+$groupComponent->setLimit(3);
+// get a group count
+$groupComponent->setNumberOfGroups(true);
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+$groups = $resultset->getGrouping();
+foreach($groups AS $groupKey => $fieldGroup) {
+
+    echo '<h1>'.$groupKey.'</h1>';
+    echo 'Matches: '.$fieldGroup->getMatches().'<br/>';
+    echo 'Number of groups: '.$fieldGroup->getNumberOfGroups();
+
+    foreach($fieldGroup AS $valueGroup) {
+
+        echo '<h2>'.(int)$valueGroup->getValue().'</h2>';
+
+        foreach($valueGroup AS $document) {
+            
+            echo '<hr/><table>';
+
+            // the documents are also iterable, to get all fields
+            foreach($document AS $field => $value)
+            {
+                // this converts multivalue fields to a comma-separated string
+                if(is_array($value)) $value = implode(', ', $value);
+
+                echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+            }
+
+            echo '</table>';
+        }
+    }
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/4.3-extending-usage.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/4.3-extending-usage.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/4.3-extending-usage.php	(revision 7576)
@@ -0,0 +1,70 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// In most cases using the API or config is advisable, however in some cases it can make sense to extend classes.
+// This makes it possible to create 'query inheritance' like in this example
+class ProductQuery extends Solarium_Query_Select{
+
+    protected function _init()
+    {
+        parent::_init();
+
+        // basic params
+        $this->setQuery('*:*');
+        $this->setStart(2)->setRows(20);
+        $this->setFields(array('id','name','price'));
+        $this->addSort('price', Solarium_Query_Select::SORT_ASC);
+
+        // create a facet field instance and set options
+        $facetSet = $this->getFacetSet();
+        $facetSet->createFacetField('stock')->setField('inStock');
+    }
+
+}
+
+// This query inherits all of the query params of it's parent (using parent::_init) and adds some more
+// Ofcourse it could also alter or remove settings
+class ProductPriceLimitedQuery extends ProductQuery{
+
+    protected function _init()
+    {
+        parent::_init();
+
+        // create a filterquery
+        $this->createFilterQuery('maxprice')->setQuery('price:[1 TO 300]');
+    }
+
+}
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// create a query instance
+$query = new ProductPriceLimitedQuery;
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// display facet counts
+echo '<hr/>Facet counts for field "inStock":<br/>';
+$facet = $resultset->getFacetSet()->getFacet('stock');
+foreach($facet as $value => $count) {
+    echo $value . ' [' . $count . ']<br/>';
+}
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+    echo '<tr><th>id</th><td>' . $document->id . '</td></tr>';
+    echo '<tr><th>name</th><td>' . $document->name . '</td></tr>';
+    echo '<tr><th>price</th><td>' . $document->price . '</td></tr>';
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.5-rollback.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.5-rollback.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.5-rollback.php	(revision 7576)
@@ -0,0 +1,22 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get an update query instance
+$update = $client->createUpdate();
+
+// rollback any uncommitted changes on the Solr server
+$update->addRollback();
+
+// this executes the query and returns the result
+$result = $client->update($update);
+
+echo '<b>Update query executed</b><br/>';
+echo 'Query status: ' . $result->getStatus(). '<br/>';
+echo 'Query time: ' . $result->getQueryTime();
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.3-plugin-customizerequest.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.3-plugin-customizerequest.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.3-plugin-customizerequest.php	(revision 7576)
@@ -0,0 +1,47 @@
+<?php
+require('init.php');
+
+htmlHeader();
+
+// create a client instance and autoload the customize request plugin
+$client = new Solarium_Client($config);
+$customizer = $client->getPlugin('customizerequest');
+
+// add a persistent HTTP header (using array input values)
+$customizer->createCustomization(array(
+    'key' => 'auth',
+    'type' => 'header',
+    'name' => 'X-my-auth',
+    'value' => 'mypassword',
+    'persistent' => true
+));
+
+// add a persistent GET param (using fluent interface)
+$customizer->createCustomization('session')
+           ->setType('param')
+           ->setName('ssid')
+           ->setValue('md7Nhd86adye6sad46d')
+           ->setPersistent(true);
+
+// add a GET param thats only used for a single request (the default setting is no persistence)
+$customizer->createCustomization('id')
+           ->setType('param')
+           ->setName('id')
+           ->setValue(4576);
+
+// create a basic query to execute
+$query = $client->createSelect();
+
+// execute query (you should be able to see the extra params in the solr log file)
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound() . '<br/>';
+
+// execute the same query again (this time the 'id' param should no longer show up in the logs)
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.3.1-mlt-query.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.3.1-mlt-query.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.3.1-mlt-query.php	(revision 7576)
@@ -0,0 +1,54 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a morelikethis query instance
+$query = $client->createMoreLikeThis();
+
+$query->setQuery('id:SP2514N');
+$query->setMltFields('manu,cat');
+$query->setMinimumDocumentFrequency(1);
+$query->setMinimumTermFrequency(1);
+$query->createFilterQuery('stock')->setQuery('inStock:true');
+$query->setInterestingTerms('details');
+$query->setMatchInclude(true);
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+echo 'Document used for matching:<br/><table>';
+foreach($resultset->getMatch() AS $field => $value)
+{
+    // this converts multivalue fields to a comma-separated string
+    if(is_array($value)) $value = implode(', ', $value);
+
+    echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+}
+echo '</table><hr/>';
+
+// display the total number of MLT documents found by solr
+echo 'Number of MLT matches found: '.$resultset->getNumFound().'<br/><br/>';
+echo '<b>Listing of matched docs:</b>';
+
+// show MLT documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.5-plugin-bufferedadd.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.5-plugin-bufferedadd.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/7.5-plugin-bufferedadd.php	(revision 7576)
@@ -0,0 +1,51 @@
+<?php
+require('init.php');
+
+// this very simple plugin is used to show some events
+class simpleDebug extends Solarium_Plugin_Abstract
+{
+    protected $_output = array();
+
+    public function display()
+    {
+        echo implode('<br/>', $this->_output);
+    }
+
+    public function eventBufferedAddFlushStart($buffer) {
+        $this->_output[] = 'Flushing buffer (' . count($buffer) . 'docs)';
+    }
+}
+
+htmlHeader();
+
+// create a client instance and autoload the buffered add plugin
+$client = new Solarium_Client($config);
+$buffer = $client->getPlugin('bufferedadd');
+$buffer->setBufferSize(10); // this is quite low, in most cases you can use a much higher value
+
+// also register a plugin for outputting events
+$debug = new simpleDebug();
+$client->registerPlugin('debugger', $debug);
+
+// let's insert 25 docs
+for ($i=1; $i<=25; $i++) {
+
+    // create a new document with dummy data and add it to the buffer
+    $data = array(
+        'id' => 'test_'.$i,
+        'name' => 'test for buffered add',
+        'price' => $i,
+    );
+    $buffer->createDocument($data);
+
+    // alternatively you could create document instances yourself and use the addDocument(s) method
+}
+
+// At this point two flushes will already have been done by the buffer automatically (at the 10th and 20th doc), now
+// manually flush the remainder. Alternatively you can use the commit method if you want to include a commit command.
+$buffer->flush();
+
+// In total 3 flushes (requests) have been sent to Solr. This should be visible in this output:
+$debug->display();
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.4.1-analysis-document.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.4.1-analysis-document.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.4.1-analysis-document.php	(revision 7576)
@@ -0,0 +1,94 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get an analysis document query
+$query = $client->createAnalysisDocument();
+
+$query->setShowMatch(true);
+$query->setQuery('ipod');
+
+$doc = new Solarium_Document_ReadWrite(
+    array(
+        'id' => 'MA147LL',
+        'name' => 'Apple 60 GB iPod with Video Playback Black',
+        'manu' => 'Apple Computer Inc.',
+        'cat' => 'electronics',
+        'cat' => 'music',
+        'features' => 'iTunes, Podcasts, Audiobooks',
+        'features' => 'Stores up to 15,000 songs, 25,000 photos, or 150 hours of video',
+        'features' => '2.5-inch, 320x240 color TFT LCD display with LED backlight',
+        'features' => 'Up to 20 hours of battery life',
+        'features' => 'Plays AAC, MP3, WAV, AIFF, Audible, Apple Lossless, H.264 video',
+        'features' => 'Notes, Calendar, Phone book, Hold button, Date display, Photo wallet, Built-in games, JPEG photo playback, Upgradeable firmware, USB 2.0 compatibility, Playback speed control, Rechargeable capability, Battery level indication',
+        'includes' => 'earbud headphones, USB cable',
+        'weight' => 5.5,
+        'price' => 399.00,
+        'popularity' => 10,
+        'inStock' => true,
+    )
+);
+
+$query->addDocument($doc);
+
+// this executes the query and returns the result
+$result = $client->analyze($query);
+
+// show the results
+foreach ($result as $document) {
+
+    echo '<hr><h2>Document: ' . $document->getName() . '</h2>';
+
+    foreach ($document as $field) {
+
+        echo '<h3>Field: ' . $field->getName() . '</h3>';
+
+        $indexAnalysis = $field->getIndexAnalysis();
+        if (!empty($indexAnalysis)) {
+            echo '<h4>Index Analysis</h4>';
+            foreach ($indexAnalysis as $classes) {
+
+                echo '<h5>'.$classes->getName().'</h5>';
+
+                foreach($classes as $result) {
+                    echo 'Text: ' . $result->getText() . '<br/>';
+                    echo 'Raw text: ' . $result->getRawText() . '<br/>';
+                    echo 'Start: ' . $result->getStart() . '<br/>';
+                    echo 'End: ' . $result->getEnd() . '<br/>';
+                    echo 'Position: ' . $result->getPosition() . '<br/>';
+                    echo 'Position history: ' . implode(', ',$result->getPositionHistory()) . '<br/>';
+                    echo 'Type: ' . htmlspecialchars($result->getType()) . '<br/>';
+                    echo 'Match: ' . var_export($result->getMatch(),true) . '<br/>';
+                    echo '-----------<br/>';
+                }
+            }
+        }
+
+        $queryAnalysis = $field->getQueryAnalysis();
+        if (!empty($queryAnalysis)) {
+            echo '<h4>Query Analysis</h4>';
+            foreach ($queryAnalysis as $classes) {
+
+                echo '<h5>'.$classes->getName().'</h5>';
+
+                foreach($classes as $result) {
+                    echo 'Text: ' . $result->getText() . '<br/>';
+                    echo 'Raw text: ' . $result->getRawText() . '<br/>';
+                    echo 'Start: ' . $result->getStart() . '<br/>';
+                    echo 'End: ' . $result->getEnd() . '<br/>';
+                    echo 'Position: ' . $result->getPosition() . '<br/>';
+                    echo 'Position history: ' . implode(', ',$result->getPositionHistory()) . '<br/>';
+                    echo 'Type: ' . htmlspecialchars($result->getType()) . '<br/>';
+                    echo 'Match: ' . var_export($result->getMatch(),true) . '<br/>';
+                    echo '-----------<br/>';
+                }
+            }
+        }
+    }
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.5-terms-query.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.5-terms-query.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.5-terms-query.php	(revision 7576)
@@ -0,0 +1,26 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a terms query instance
+$query = $client->createTerms();
+$query->setFields('features,name');
+$query->setLowerbound('i');
+
+// this executes the query and returns the result
+$resultset = $client->terms($query);
+
+// display terms
+foreach ($resultset as $field => $terms) {
+    echo '<h3>' . $field . '</h3>';
+    foreach ($terms as $term => $count) {
+       echo $term . ' (' . $count . ')<br/>';
+    }
+    echo '<hr/>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/5.1-partial-usage.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/5.1-partial-usage.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/5.1-partial-usage.php	(revision 7576)
@@ -0,0 +1,51 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// This example shows how to manually execute the query flow.
+// By doing this manually you can customize data in between any step (although a plugin might be better for this)
+// And you can use only a part of the flow. You could for instance use the query object and request builder,
+// but execute the request in your own code.
+
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// create a select query instance
+$query = $client->createSelect();
+
+// manually create a request for the query
+$request = $client->createRequest($query);
+
+// you can now use the request object for getting an uri (ie. to use in you own code)
+// or you could modify the request object
+echo 'Request URI: ' . $request->getUri() . '<br/>';
+
+// you can still execute the request using the client and get a 'raw' response object
+$response = $client->executeRequest($request);
+
+// and finally you can convert the response into a result
+$result = $client->createResult($query, $response);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$result->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($result as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.2-custom-result-document.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.2-custom-result-document.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.2-custom-result-document.php	(revision 7576)
@@ -0,0 +1,47 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+
+// this is the custom result document class
+class myDoc extends Solarium_Document_ReadOnly{
+
+    public function getSpecialPrice()
+    {
+        return round(($this->price * .95), 2);
+    }
+
+}
+
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// set the custom resultclass
+$query->setDocumentClass('myDoc');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+    echo '<tr><th>id</th><td>' . $document->id . '</td></tr>';
+    echo '<tr><th>name</th><td>' . $document->name . '</td></tr>';
+    echo '<tr><th>price</th><td>' . $document->price . '</td></tr>';
+
+    // this method is added by the custom class
+    echo '<tr><th>offer price</th><td>' . $document->getSpecialPrice() . '</td></tr>';
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.2-morelikethis.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.2-morelikethis.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.2-morelikethis.php	(revision 7576)
@@ -0,0 +1,57 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// add a query and morelikethis settings (using fluent interface)
+$query->setQuery('apache')
+      ->getMoreLikeThis()
+      ->setFields('manu,cat')
+      ->setMinimumDocumentFrequency(1)
+      ->setMinimumTermFrequency(1);
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+$mlt = $resultset->getMoreLikeThis();
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table><br/><b>MLT results:</b><br/>';
+
+    // mlt results can be fetched by document id (the field defined as uniquekey in this schema)
+    $mltResult = $mlt->getResult($document->id);
+    if($mltResult){
+        echo 'Max score: '.$mltResult->getMaximumScore().'<br/>';
+        echo 'NumFound: '.$mltResult->getNumFound().'<br/>';
+        echo 'Num. fetched: '.count($mltResult).'<br/>';
+        foreach($mltResult AS $mltDoc) {
+            echo 'MLT result doc: '. $mltDoc->name . ' (id='. $mltDoc->id . ')<br/>';
+        }
+    }else{
+        echo 'No MLT results';
+    }
+
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/5.3.1-plugin-event-hooks.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/5.3.1-plugin-event-hooks.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/5.3.1-plugin-event-hooks.php	(revision 7576)
@@ -0,0 +1,119 @@
+<?php
+require('init.php');
+
+
+// this very simple plugin shows a timing for each event and display some request debug info
+class basicDebug extends Solarium_Plugin_Abstract
+{
+
+    protected $_start;
+    protected $_output = array();
+
+    public function _initPlugin()
+    {
+        $this->_start = microtime(true);
+    }
+
+    protected function _timer($event)
+    {
+        $time = round(microtime(true) - $this->_start, 5);
+        $this->_output[] = '['.$time.'] ' . $event;
+
+    }
+
+    public function display()
+    {
+        echo implode('<br/>', $this->_output);
+    }
+
+    public function preCreateRequest()
+    {
+        $this->_timer('preCreateRequest');
+    }
+
+    public function postCreateRequest()
+    {
+        $this->_timer('postCreateRequest');
+    }
+
+    // This method uses the aviable param(s) (see plugin abstract class)
+    // You can access or modify data this way
+    public function preExecuteRequest($request)
+    {
+        $this->_timer('preExecuteRequest');
+
+        // this dummy param will be visible in the debug output but will also be used in the actual Solr request
+        $request->addParam('dummyparam', 'dummyvalue');
+
+        $this->_output[] = 'Request URI: ' . $request->getUri();
+    }
+
+    public function postExecuteRequest()
+    {
+        $this->_timer('postExecuteRequest');
+    }
+
+    public function preCreateResult()
+    {
+        $this->_timer('preCreateResult');
+    }
+
+    public function postCreateResult()
+    {
+        $this->_timer('postCreateResult');
+    }
+
+    public function preExecute()
+    {
+        $this->_timer('preExecute');
+    }
+
+    public function postExecute()
+    {
+        $this->_timer('postExecute');
+    }
+
+    public function preCreateQuery()
+    {
+        $this->_timer('preCreateResult');
+    }
+
+    public function postCreateQuery()
+    {
+        $this->_timer('postCreateResult');
+    }
+
+}
+
+
+htmlHeader();
+
+// create a client instance and register the plugin
+$plugin = new basicDebug();
+$client = new Solarium_Client($config);
+$client->registerPlugin('debugger', $plugin);
+
+// execute a select query and display the results
+$query = $client->createSelect();
+$resultset = $client->select($query);
+
+echo 'NumFound: '.$resultset->getNumFound();
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    foreach($document AS $field => $value)
+    {
+        if(is_array($value)) $value = implode(', ', $value);
+
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+// display the debug plugin output
+echo '<hr/><h1>Plugin output</h1>';
+$plugin->display();
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.1.3-facet-multiquery.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.1.3-facet-multiquery.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.1.3-facet-multiquery.php	(revision 7576)
@@ -0,0 +1,45 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// get the facetset component
+$facetSet = $query->getFacetSet();
+
+// create a facet query instance and set options
+$facet = $facetSet->createFacetMultiQuery('stock');
+$facet->createQuery('stock_pricecat1', 'inStock:true AND price:[1 TO 300]');
+$facet->createQuery('nostock_pricecat1', 'inStock:false AND price:[1 TO 300]');
+$facet->createQuery('stock_pricecat2', 'inStock:true AND price:[300 TO *]');
+$facet->createQuery('nostock_pricecat2', 'inStock:false AND price:[300 TO *]');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// display facet counts
+echo '<hr/>Multiquery facet counts:<br/>';
+$facet = $resultset->getFacetSet()->getFacet('stock');
+foreach($facet as $key => $count) {
+    echo $key . ' [' . $count . ']<br/>';
+}
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+    echo '<tr><th>id</th><td>' . $document->id . '</td></tr>';
+    echo '<tr><th>name</th><td>' . $document->name . '</td></tr>';
+    echo '<tr><th>price</th><td>' . $document->price . '</td></tr>';
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.4-dereferenced-params.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.4-dereferenced-params.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.4-dereferenced-params.php	(revision 7576)
@@ -0,0 +1,41 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance and get a select query instance
+$client = new Solarium_Client($config);
+
+
+
+
+// first an example manually defining dereferenced params
+$query = $client->createSelect();
+$helper = $query->getHelper();
+
+$join = $helper->qparser('join', array('from' => 'manu_id', 'to' => 'id'), true);
+$queryString = $join . 'id:1';
+$query->setQuery($queryString);
+$request = $client->createRequest($query);
+
+// output resulting url with dereferenced params
+echo urldecode($request->getUri()) . '<hr/>';
+
+
+
+
+// this second example gives the exact same result, using the special join helper
+$query = $client->createSelect();
+$helper = $query->getHelper();
+
+$join = $helper->join('manu_id', 'id', true);
+$queryString = $join . 'id:1';
+$query->setQuery($queryString);
+$request = $client->createRequest($query);
+
+echo urldecode($request->getUri());
+
+
+
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.1.1-facet-field.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.1.1-facet-field.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.1.1-facet-field.php	(revision 7576)
@@ -0,0 +1,41 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// get the facetset component
+$facetSet = $query->getFacetSet();
+
+// create a facet field instance and set options
+$facetSet->createFacetField('stock')->setField('inStock');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// display facet counts
+echo '<hr/>Facet counts for field "inStock":<br/>';
+$facet = $resultset->getFacetSet()->getFacet('stock');
+foreach($facet as $value => $count) {
+    echo $value . ' [' . $count . ']<br/>';
+}
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+    echo '<tr><th>id</th><td>' . $document->id . '</td></tr>';
+    echo '<tr><th>name</th><td>' . $document->name . '</td></tr>';
+    echo '<tr><th>price</th><td>' . $document->price . '</td></tr>';
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/init.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/init.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/init.php	(revision 7576)
@@ -0,0 +1,21 @@
+<?php
+
+error_reporting(E_ALL);
+ini_set('display_errors', true);
+
+require('autoload.php');
+
+if (file_exists('config.php')) {
+    require('config.php');
+} else {
+    require('config.dist.php');
+}
+
+
+function htmlHeader(){
+    echo '<html><head><title>Solarium examples</title></head><body>';
+}
+
+function htmlFooter(){
+    echo '</body></html>';
+}
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.4.2-analysis-field.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.4.2-analysis-field.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.4.2-analysis-field.php	(revision 7576)
@@ -0,0 +1,74 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get an analysis document query
+$query = $client->createAnalysisField();
+
+$query->setShowMatch(true);
+$query->setFieldName('cat,title');
+$query->setFieldType('text_general');
+$query->setFieldValue('Apple 60 GB iPod with Video Playback Black');
+$query->setQuery('ipod');
+
+// this executes the query and returns the result
+$results = $client->analyze($query);
+
+// show the results
+foreach ($results as $result) {
+
+    echo '<hr><h2>Result list: ' . $result->getName() . '</h2>';
+
+    foreach ($result as $item) {
+
+        echo '<h3>Item: ' . $item->getName() . '</h3>';
+
+        $indexAnalysis = $item->getIndexAnalysis();
+        if (!empty($indexAnalysis)) {
+            echo '<h4>Index Analysis</h4>';
+            foreach ($indexAnalysis as $classes) {
+
+                echo '<h5>'.$classes->getName().'</h5>';
+
+                foreach($classes as $result) {
+                    echo 'Text: ' . $result->getText() . '<br/>';
+                    echo 'Raw text: ' . $result->getRawText() . '<br/>';
+                    echo 'Start: ' . $result->getStart() . '<br/>';
+                    echo 'End: ' . $result->getEnd() . '<br/>';
+                    echo 'Position: ' . $result->getPosition() . '<br/>';
+                    echo 'Position history: ' . implode(', ',$result->getPositionHistory()) . '<br/>';
+                    echo 'Type: ' . htmlspecialchars($result->getType()) . '<br/>';
+                    echo 'Match: ' . var_export($result->getMatch(),true) . '<br/>';
+                    echo '-----------<br/>';
+                }
+            }
+        }
+
+        $queryAnalysis = $item->getQueryAnalysis();
+        if (!empty($queryAnalysis)) {
+            echo '<h4>Query Analysis</h4>';
+            foreach ($queryAnalysis as $classes) {
+
+                echo '<h5>'.$classes->getName().'</h5>';
+
+                foreach($classes as $result) {
+                    echo 'Text: ' . $result->getText() . '<br/>';
+                    echo 'Raw text: ' . $result->getRawText() . '<br/>';
+                    echo 'Start: ' . $result->getStart() . '<br/>';
+                    echo 'End: ' . $result->getEnd() . '<br/>';
+                    echo 'Position: ' . $result->getPosition() . '<br/>';
+                    echo 'Position history: ' . implode(', ',$result->getPositionHistory()) . '<br/>';
+                    echo 'Type: ' . htmlspecialchars($result->getType()) . '<br/>';
+                    echo 'Match: ' . var_export($result->getMatch(),true) . '<br/>';
+                    echo '-----------<br/>';
+                }
+            }
+        }
+    }
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/index2.html
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/index2.html	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/index2.html	(revision 7576)
@@ -0,0 +1,133 @@
+<html>
+    <head>
+        <title>Solarium examples</title>
+    </head>
+    <body>
+        <h1>Solarium examples</h1>
+
+        <p>
+            In this folder you can find various examples for the Solarium PHP Solr client library, to be used on a Solr 'example' index as distributed with Solr.<br/>
+            Only the code is included, for more details about the examples and how to get them working please see the manual on the project website: <a href="http://www.solarium-project.org" target="_blank">http://www.solarium-project.org</a>
+        </p>
+        <p>
+            If examples for some Solarium functionality are missing please request them by opening an issue in the issue tracker: <a href="http://github.com/basdenooijer/solarium/issues" target="_blank">http://github.com/basdenooijer/solarium/issues</a>
+        </p>
+        <p>
+            <b>Important:</b> This code is intended to demonstrate the usage of Solarium. It is not intended for real-world use. For instance user input validation is missing or very limited, as the best way to do this will depend on your application and is not Solarium functionality.<br>
+            It's advised not to deploy the examples to a public environment, or at least make sure the example directory is not available via your webserver.
+        </p>
+
+
+        <ul style="list-style:none;">
+            <li>1. Basic usage</li>
+            <ul style="list-style:none;">
+                <li><a href="1.1-check-solarium-and-ping.php">1.1 Check solarium availability and ping Solr</a></li>
+                <li><a href="1.2-basic-select.php">1.2 Basic select</a></li>
+                <li><a href="1.3-basic-update.php">1.3 Basic update - add document</a></li>
+            </ul>
+
+            <li>2. Queries</li>
+            <ul style="list-style:none;">
+                <li>2.1. Select query</li>
+                <ul style="list-style:none;">
+                    <li><a href="2.1.1-query-params.php">2.1.1 Select query params</a></li>
+                    <li><a href="2.1.2-custom-result-document.php">2.1.2 Custom result document</a></li>
+                    <li><a href="2.1.3-filterquery.php">2.1.3 Filterquery</a></li>
+                    <li>2.1.4 Components</li>
+                    <ul style="list-style:none;">
+                        <li>2.1.5.1 FacetSet</li>
+                        <ul style="list-style:none;">
+                            <li><a href="2.1.5.1.1-facet-field.php">2.1.5.1.1 Facet field</a></li>
+                            <li><a href="2.1.5.1.2-facet-query.php">2.1.5.1.2 Facet query</a></li>
+                            <li><a href="2.1.5.1.3-facet-multiquery.php">2.1.5.1.3 Facet multiquery</a></li>
+                            <li><a href="2.1.5.1.4-facet-range.php">2.1.5.1.4 Facet range</a></li>
+                        </ul>
+                        <li><a href="2.1.5.2-morelikethis.php">2.1.5.2 MoreLikeThis</a></li>
+                        <li><a href="2.1.5.3-highlighting.php">2.1.5.3 Highlighting</a></li>
+                        <ul style="list-style:none;">
+
+                            <li><a href="2.1.5.3.1-per-field-highlighting.php">2.1.5.3.1 Per-field highlighting options</a></li>
+                        </ul>
+                        <li><a href="2.1.5.4-dismax.php">2.1.5.4 Dismax</a></li>
+                        <li><a href="2.1.5.5-edismax.php">2.1.5.5 Edismax</a></li>
+                        <li><a href="2.1.5.6-grouping-by-field.php">2.1.5.6 Grouping by field</a></li>
+                        <li><a href="2.1.5.7-grouping-by-query.php">2.1.5.7 Grouping by query</a></li>
+                        <li><a href="2.1.5.8-distributed-search.php">2.1.5.8 Distributed search (sharding)</a></li>
+                        <li><a href="2.1.5.9-spellcheck.php">2.1.5.9 Spellcheck</a></li>
+                        <li><a href="2.1.5.10-stats.php">2.1.5.10 Stats</a></li>
+                        <li><a href="2.1.5.11-debug.php">2.1.5.11 Debug (DebugQuery)</a></li>
+                    </ul>
+                    <li><a href="2.1.6-helper-functions.php">2.1.6 Helper functions</a></li>
+                    <li><a href="2.1.7-query-reuse.php">2.1.7 Query re-use</a></li>
+                </ul>
+
+                <li>2.2. Update query</li>
+                <ul style="list-style:none;">
+                    <li><a href="2.2.1-add-docs.php">2.2.1 Add docs</a></li>
+                    <li><a href="2.2.2-delete-by-query.php">2.2.2 Delete by query</a></li>
+                    <li><a href="2.2.3-delete-by-id.php">2.2.3 Delete by ID</a></li>
+                    <li><a href="2.2.4-optimize.php">2.2.4 Optimize index</a></li>
+                    <li><a href="2.2.5-rollback.php">2.2.5 Rollback</a></li>
+                </ul>
+
+                <li>2.3. MoreLikeThis query</li>
+                <ul style="list-style:none;">
+                    <li><a href="2.3.1-mlt-query.php">2.3.1 MoreLikeThis query</a></li>
+                    <li><a href="2.3.2-mlt-stream.php">2.3.2 MoreLikeThis query input as stream</a></li>
+                </ul>
+
+                <li>2.4. Analysis queries</li>
+                <ul style="list-style:none;">
+                    <li><a href="2.4.1-analysis-document.php">2.4.1 Analysis query for a document</a></li>
+                    <li><a href="2.4.2-analysis-field.php">2.4.2 Analysis query for a field</a></li>
+                </ul>
+
+                <li><a href="2.5-terms-query.php">2.5 Terms query</a></li>
+
+                <li><a href="2.6-suggester-query.php">2.6 Suggester query</a></li>
+            </ul>
+
+            <li>4. Usage modes</li>
+            <ul style="list-style:none;">
+                <li><a href="4.1-api-usage.php">4.1 API</a></li>
+                <li><a href="4.2-configuration-usage.php">4.2 Configuration</a></li>
+                <li><a href="4.3-extending-usage.php">4.3 Extending</a></li>
+            </ul>
+
+            <li>5. Customization</li>
+            <ul style="list-style:none;">
+                <li><a href="5.1-partial-usage.php">5.1 Partial usage</a></li>
+                <li><a href="5.2-extending.php">5.2 Extending</a></li>
+                <li>5.3 Plugin system</li>
+                <ul style="list-style:none;">
+                    <li><a href="5.3.1-plugin-event-hooks.php">5.3.1 Event hooks</a></li>
+                    <li><a href="5.3.2-plugin-solarium-presets.php">5.3.2 Modifying Solarium presets</a></li>
+                </ul>
+            </ul>
+
+            <li>6. Miscellaneous</li>
+            <ul style="list-style:none;">
+                <li>6.1 Client adapters</li>
+                <ul style="list-style:none;">
+                    <li><a href="6.1.1-zend-http-adapter.php">6.1.1 Zend_Http adapter</a></li>
+                    <li><a href="6.1.2-pecl-http-adapter.php">6.1.2 Pecl_Http adapter</a></li>
+                    <li><a href="6.1.3-curl-adapter.php">6.1.3 Curl adapter</a></li>
+                </ul>
+                <li><a href="6.2-escaping.php">6.2 Escaping</a></li>
+                <li><a href="6.3-placeholder-syntax.php">6.3 Placeholder syntax</a></li>
+                <li><a href="6.4-dereferenced-params.php">6.4 Dereferenced params</a></li>
+            </ul>
+
+            <li>7. Plugins</li>
+            <ul style="list-style:none;">
+                <li><a href="7.1-plugin-loadbalancer.php">7.1 Loadbalancer</a></li>
+                <li><a href="7.2-plugin-postbigrequest.php">7.2 Post Big Requests</a></li>
+                <li><a href="7.3-plugin-customizerequest.php">7.3 Customize Requests</a></li>
+                <li><a href="7.4-plugin-parallelexecution.php">7.4 Parallel Execution</a></li>
+                <li><a href="7.5-plugin-bufferedadd.php">7.5 Buffered Add for documents</a></li>
+                <li><a href="7.6-plugin-prefetchiterator.php">7.6 Prefetch iterator for select queries</a></li>
+            </ul>
+
+        </ul>
+    </body>
+</html>
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.11-debug.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.11-debug.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.11-debug.php	(revision 7576)
@@ -0,0 +1,69 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+$query->setQuery('ipod');
+
+// add debug settings
+$debug = $query->getDebug();
+$debug->setExplainOther('id:MA*');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+$debugResult = $resultset->getDebug();
+
+// display the debug results
+echo '<h1>Debug data</h1>';
+echo 'Querystring: ' . $debugResult->getQueryString() . '<br/>';
+echo 'Parsed query: ' . $debugResult->getParsedQuery() . '<br/>';
+echo 'Query parser: ' . $debugResult->getQueryParser() . '<br/>';
+echo 'Other query: ' . $debugResult->getOtherQuery() . '<br/>';
+
+echo '<h2>Explain data</h2>';
+foreach ($debugResult->getExplain() as $key => $explanation) {
+    echo '<h3>Document key: ' . $key . '</h3>';
+    echo 'Value: ' . $explanation->getValue() . '<br/>';
+    echo 'Match: ' . (($explanation->getMatch() == true) ? 'true' : 'false')  . '<br/>';
+    echo 'Description: ' . $explanation->getDescription() . '<br/>';
+    echo '<h4>Details</h4>';
+    foreach ($explanation AS $detail) {
+        echo 'Value: ' . $detail->getValue() . '<br/>';
+        echo 'Match: ' . (($detail->getMatch() == true) ? 'true' : 'false')  . '<br/>';
+        echo 'Description: ' . $detail->getDescription() . '<br/>';
+        echo '<hr/>';
+    }
+}
+
+echo '<h2>ExplainOther data</h2>';
+foreach ($debugResult->getExplainOther() as $key => $explanation) {
+    echo '<h3>Document key: ' . $key . '</h3>';
+    echo 'Value: ' . $explanation->getValue() . '<br/>';
+    echo 'Match: ' . (($explanation->getMatch() == true) ? 'true' : 'false')  . '<br/>';
+    echo 'Description: ' . $explanation->getDescription() . '<br/>';
+    echo '<h4>Details</h4>';
+    foreach ($explanation AS $detail) {
+        echo 'Value: ' . $detail->getValue() . '<br/>';
+        echo 'Match: ' . (($detail->getMatch() == true) ? 'true' : 'false')  . '<br/>';
+        echo 'Description: ' . $detail->getDescription() . '<br/>';
+        echo '<hr/>';
+    }
+}
+
+echo '<h2>Timings (in ms)</h2>';
+echo 'Total time: ' . $debugResult->getTiming()->getTime() . '<br/>';
+echo '<h3>Phases</h3>';
+foreach ($debugResult->getTiming()->getPhases() as $phaseName => $phaseData) {
+    echo '<h4>' . $phaseName . '</h4>';
+    foreach ($phaseData as $class => $time) {
+        echo $class . ': ' . $time . '<br/>';
+    }
+    echo '<hr/>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/config.dist.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/config.dist.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/config.dist.php	(revision 7576)
@@ -0,0 +1,9 @@
+<?php
+
+$config = array(
+    'adapteroptions' => array(
+        'host' => '172.25.60.61',
+        'port' => 8983,
+        'path' => '/solr',
+    )
+);
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/index.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/index.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/index.php	(revision 7576)
@@ -0,0 +1,58 @@
+<!---->
+<!--<html><head><title>Basic select</title></head><body>-->
+<?php
+require('init.php');
+//require('../library/Solarium/Autoloader.php');
+//Solarium_Autoloader::register();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+$query->setQuery("gato");
+
+// override the default row limit of 10 by setting rows to 30
+$query->setRows(30);
+
+// this executes the query with default settings and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+	
+	echo "-----------------------------------------";
+	echo '</br>';
+
+	// the documents are also iterable, to get all fields
+	foreach($document AS $field => $value)
+	{
+		// this converts multivalue fields to a comma-separated string
+		if(is_array($value)) $value = implode(', ', $value);
+		
+		if($field == "id" )
+		{
+			echo "UID: ".substr($value, 1, strlen($value)-2)."</br>";
+		}
+		
+		if($field == "user" )
+		{
+			echo "UsuÃ¡rio: ".$value."</br>";
+		}
+		
+		if($field == "subject" )
+		{
+			echo "Assunto: ".$value."</br>";
+		}
+		
+//		echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+	}
+
+}
+?>
+<!--</body></html>-->
+
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.3-filterquery.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.3-filterquery.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.3-filterquery.php	(revision 7576)
@@ -0,0 +1,31 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// create a filterquery
+$query->createFilterQuery('maxprice')->setQuery('price:[1 TO 300]');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+    echo '<tr><th>id</th><td>' . $document->id . '</td></tr>';
+    echo '<tr><th>name</th><td>' . $document->name . '</td></tr>';
+    echo '<tr><th>price</th><td>' . $document->price . '</td></tr>';
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/4.1-api-usage.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/4.1-api-usage.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/4.1-api-usage.php	(revision 7576)
@@ -0,0 +1,48 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// apply settings using the API
+$query->setQuery('*:*');
+$query->setStart(2)->setRows(20);
+$query->setFields(array('id','name','price'));
+$query->addSort('price', Solarium_Query_Select::SORT_ASC);
+
+// create a filterquery using the API
+$fq = $query->createFilterQuery('maxprice')->setQuery('price:[1 TO 300]');
+
+// create a facet field instance and set options using the API
+$facetSet = $query->getFacetSet();
+$facet = $facetSet->createFacetField('stock')->setField('inStock');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// display facet counts
+echo '<hr/>Facet counts for field "inStock":<br/>';
+$facet = $resultset->getFacetSet()->getFacet('stock');
+foreach($facet as $value => $count) {
+    echo $value . ' [' . $count . ']<br/>';
+}
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+    echo '<tr><th>id</th><td>' . $document->id . '</td></tr>';
+    echo '<tr><th>name</th><td>' . $document->name . '</td></tr>';
+    echo '<tr><th>price</th><td>' . $document->price . '</td></tr>';
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.2-delete-by-query.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.2-delete-by-query.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.2-delete-by-query.php	(revision 7576)
@@ -0,0 +1,23 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get an update query instance
+$update = $client->createUpdate();
+
+// add the delete query and a commit command to the update query
+$update->addDeleteQuery('name:testdoc*');
+$update->addCommit();
+
+// this executes the query and returns the result
+$result = $client->update($update);
+
+echo '<b>Update query executed</b><br/>';
+echo 'Query status: ' . $result->getStatus(). '<br/>';
+echo 'Query time: ' . $result->getQueryTime();
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.1-add-docs.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.1-add-docs.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.2.1-add-docs.php	(revision 7576)
@@ -0,0 +1,35 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get an update query instance
+$update = $client->createUpdate();
+
+// create a new document for the data
+$doc1 = $update->createDocument();
+$doc1->id = 123;
+$doc1->name = 'testdoc-1';
+$doc1->price = 364;
+
+// and a second one
+$doc2 = $update->createDocument();
+$doc2->id = 124;
+$doc2->name = 'testdoc-2';
+$doc2->price = 340;
+
+// add the documents and a commit command to the update query
+$update->addDocuments(array($doc1, $doc2));
+$update->addCommit();
+
+// this executes the query and returns the result
+$result = $client->update($update);
+
+echo '<b>Update query executed</b><br/>';
+echo 'Query status: ' . $result->getStatus(). '<br/>';
+echo 'Query time: ' . $result->getQueryTime();
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/5.3.2-plugin-solarium-presets.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/5.3.2-plugin-solarium-presets.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/5.3.2-plugin-solarium-presets.php	(revision 7576)
@@ -0,0 +1,56 @@
+<?php
+require('init.php');
+
+// This is a custom query class that could have some customized logic
+class MyQuery extends Solarium_Query_Select
+{
+    // ...customization here...
+}
+
+// this very simple plugin that modifies the default querytype mapping
+class queryCustomizer extends Solarium_Plugin_Abstract
+{
+
+    protected function _initPlugin()
+    {
+        $this->_client->registerQueryType(
+            Solarium_Client::QUERYTYPE_SELECT,
+            'MyQuery',
+            'Solarium_Client_RequestBuilder_Select',
+            'Solarium_Client_ResponseParser_Select'
+        );
+    }
+    
+}
+
+
+htmlHeader();
+
+// create a client instance and register the plugin
+$client = new Solarium_Client($config);
+$client->registerPlugin('querycustomizer', 'queryCustomizer');
+
+// create a select query instance
+$query = $client->createSelect();
+
+// check the query class, it should be our custom query class
+echo 'Query class: ' . get_class($query) . '<br/>';
+
+// execute the query and display the results
+$resultset = $client->select($query);
+echo 'NumFound: '.$resultset->getNumFound();
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    foreach($document AS $field => $value)
+    {
+        if(is_array($value)) $value = implode(', ', $value);
+
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/.gitignore
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/.gitignore	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/.gitignore	(revision 7576)
@@ -0,0 +1,1 @@
+config.php
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.1.2-pecl-http-adapter.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.1.2-pecl-http-adapter.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.1.2-pecl-http-adapter.php	(revision 7576)
@@ -0,0 +1,41 @@
+<?php
+
+require_once 'Zend/Loader/Autoloader.php';
+$loader = Zend_Loader_Autoloader::getInstance();
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// set the adapter to peclhttp
+$client->setAdapter('Solarium_Client_Adapter_PeclHttp');
+
+// get a select query instance
+$query = $client->createSelect();
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.1-query-params.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.1-query-params.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.1-query-params.php	(revision 7576)
@@ -0,0 +1,47 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// set a query (all prices starting from 12)
+$query->setQuery('price:[12 TO *]');
+
+// set start and rows param (comparable to SQL limit) using fluent interface
+$query->setStart(2)->setRows(20);
+
+// set fields to fetch (this overrides the default setting 'all fields')
+$query->setFields(array('id','name','price'));
+
+// sort the results by price ascending
+$query->addSort('price', Solarium_Query_Select::SORT_ASC);
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.1.3-curl-adapter.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.1.3-curl-adapter.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.1.3-curl-adapter.php	(revision 7576)
@@ -0,0 +1,41 @@
+<?php
+
+require_once 'Zend/Loader/Autoloader.php';
+$loader = Zend_Loader_Autoloader::getInstance();
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// set the adapter to curl
+$client->setAdapter('Solarium_Client_Adapter_Curl');
+
+// get a select query instance
+$query = $client->createSelect();
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/5.2-extending.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/5.2-extending.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/5.2-extending.php	(revision 7576)
@@ -0,0 +1,72 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// This is a custom query class that could have some customized logic
+class MyQuery extends Solarium_Query_Select
+{
+    // ...customization here...
+}
+
+// And this is the extended client, that modifies the default query mapping
+// for select queries to our custom query class.
+// BTW, the same could also be done using a plugin, see example 5.3.2
+class MyClient extends Solarium_Client
+{
+     /**
+     * Querytype mappings
+     */
+    protected $_queryTypes = array(
+        self::QUERYTYPE_SELECT => array(
+            'query'          => 'MyQuery',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Select',
+            'responseparser' => 'Solarium_Client_ResponseParser_Select'
+        ),
+        self::QUERYTYPE_UPDATE => array(
+            'query'          => 'Solarium_Query_Update',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Update',
+            'responseparser' => 'Solarium_Client_ResponseParser_Update'
+        ),
+        self::QUERYTYPE_PING => array(
+            'query'          => 'Solarium_Query_Ping',
+            'requestbuilder' => 'Solarium_Client_RequestBuilder_Ping',
+            'responseparser' => 'Solarium_Client_ResponseParser_Ping'
+        ),
+    );
+}
+
+
+// create a client instance
+$client = new MyClient($config);
+
+// create a select query instance
+$query = $client->createSelect();
+
+// check the query class, it should be our custom query class
+echo 'Query class: ' . get_class($query) . '<br/>';
+
+// execute query
+$result = $client->execute($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$result->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($result as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
Index: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.4-dismax.php
===================================================================
--- sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.4-dismax.php	(revision 7576)
+++ sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/2.1.5.4-dismax.php	(revision 7576)
@@ -0,0 +1,42 @@
+<?php
+
+require('init.php');
+htmlHeader();
+
+// create a client instance
+$client = new Solarium_Client($config);
+
+// get a select query instance
+$query = $client->createSelect();
+
+// get the dismax component and set a boost query
+$dismax = $query->getDisMax();
+$dismax->setBoostQuery('cat:"graphics card"^2');
+
+// this query is now a dismax query
+$query->setQuery('memory -printer');
+
+// this executes the query and returns the result
+$resultset = $client->select($query);
+
+// display the total number of documents found by solr
+echo 'NumFound: '.$resultset->getNumFound();
+
+// show documents using the resultset iterator
+foreach ($resultset as $document) {
+
+    echo '<hr/><table>';
+
+    // the documents are also iterable, to get all fields
+    foreach($document AS $field => $value)
+    {
+        // this converts multivalue fields to a comma-separated string
+        if(is_array($value)) $value = implode(', ', $value);
+        
+        echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
+    }
+
+    echo '</table>';
+}
+
+htmlFooter();
