Solr Class Reference

Query the Solr server. More...

List of all members.

Public Member Functions

 __construct ($core="", $host="localhost")
 Constructor.
 __destruct ()
 select ($query)
 Send a select query to the Solr server.
 update ($content)
 Send a update query to the Solr server.
 commit ()
 Send a commit query to the Solr server.
 deleteInstanceRecord ($uri, $dataset)
 Delete a specific instance record in the solr index.
 optimize ()
 Send a optimize query to the Solr server.
 flushIndex ()
 Remove all records in the Solr index.
 flushDataset ($dataset)
 Remove all records in the Solr index, belonging to a specific dataset.
 createSolrAddElementFromWSElement ($wsElement)
 Create a Solr element to add to the index from a web service XML element (the XML representation of a RDF resource of the web services).
 xmlEncode ($string)
 Create/Update a Solr document.

Private Member Functions

 sendQuery ($query)
 Send any kind of query to the Solr server.
 sendContent ($content)
 Send any kind of query to the Solr server.

Private Attributes

 $updateUrl
 URL where to reach the Solr update endpoint.
 $selectUrl
 URL where to reach the Solr select (normal query) endpoint.


Detailed Description

Query the Solr server.

Author:
Frederick Giasson, Structured Dynamics LLC.

Definition at line 21 of file Solr.php.


Constructor & Destructor Documentation

Solr::__construct ( core = "",
host = "localhost" 
)

Constructor.


Parameters:
[in] $core An optional target Solr core in a multicore setting
Returns:
returns the XML resultset
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 41 of file Solr.php.

Solr::__destruct (  ) 

Definition at line 55 of file Solr.php.


Member Function Documentation

Solr::commit (  ) 

Send a commit query to the Solr server.


Returns:
returns the XML resultset with the status of this request
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 95 of file Solr.php.

References sendContent().

Here is the call graph for this function:

Solr::createSolrAddElementFromWSElement ( wsElement  ) 

Create a Solr element to add to the index from a web service XML element (the XML representation of a RDF resource of the web services).


Parameters:
[in] $wsElement Web service element to convert
Returns:
returns an array of Solr document to index
Todo:
"object_property" and "object_label" have to be added once everything is indexed.
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 206 of file Solr.php.

References $type, $types, and xmlEncode().

Here is the call graph for this function:

Solr::deleteInstanceRecord ( uri,
dataset 
)

Delete a specific instance record in the solr index.


Parameters:
[in] $uri URI of the instance record to delete
[in] $dataset Dataset URI where the instance record is described
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 109 of file Solr.php.

References $dataset, $uri, and sendContent().

Here is the call graph for this function:

Solr::flushDataset ( dataset  ) 

Remove all records in the Solr index, belonging to a specific dataset.


Parameters:
[in] $dataset Dataset to remove
Returns:
returns the XML resultset with the status of this request
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 153 of file Solr.php.

References sendContent().

Here is the call graph for this function:

Solr::flushIndex (  ) 

Remove all records in the Solr index.


Returns:
returns the XML resultset with the status of this request
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 139 of file Solr.php.

References sendContent().

Here is the call graph for this function:

Solr::optimize (  ) 

Send a optimize query to the Solr server.


Returns:
returns the XML resultset with the status of this request
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 127 of file Solr.php.

References sendContent().

Here is the call graph for this function:

Solr::select ( query  ) 

Send a select query to the Solr server.


Parameters:
[in] $query Solr query
Returns:
returns the XML resultset
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 69 of file Solr.php.

References $query, and sendQuery().

Here is the call graph for this function:

Solr::sendContent ( content  )  [private]

Send any kind of query to the Solr server.


Parameters:
[in] $content Solr query to send to the server
Returns:
returns the XML resultset with the status of this request
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 410 of file Solr.php.

Referenced by commit(), deleteInstanceRecord(), flushDataset(), flushIndex(), optimize(), and update().

Solr::sendQuery ( query  )  [private]

Send any kind of query to the Solr server.


Parameters:
[in] $query Solr query to send to the server
Returns:
returns the XML resultset with the status of this request
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 167 of file Solr.php.

References $query.

Referenced by select().

Solr::update ( content  ) 

Send a update query to the Solr server.


Parameters:
[in] $content Solr content (add) XML item to add to the server
Returns:
returns the XML resultset with the status of this request
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 83 of file Solr.php.

References sendContent().

Here is the call graph for this function:

Solr::xmlEncode ( string  ) 

Create/Update a Solr document.


Parameters:
[in] $solrDocument A SolrDocument description
Returns:
returns FALSE for an internal error
Author:
Frederick Giasson, Structured Dynamics LLC.



Encode content to be included in XML files

Parameters:
[in] $string The content string to be encoded
Returns:
returns the encoded string
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 395 of file Solr.php.

Referenced by createSolrAddElementFromWSElement().


Member Data Documentation

Solr::$selectUrl [private]

URL where to reach the Solr select (normal query) endpoint.

Definition at line 27 of file Solr.php.

Solr::$updateUrl [private]

URL where to reach the Solr update endpoint.

Definition at line 24 of file Solr.php.


The documentation for this class was generated from the following file:
Copyright © 2009. Structured Dynamics LLC Structured Dynamics LLC. All rights reserved.