blob: 495ad7021e6f8465b66775255a8f04265cd35c27 [file] [log] [blame]
<?php
/**
* File containing the ezcSearchIndexHandler interface.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
* @package Search
* @version //autogentag//
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/
/**
* Defines interface for all the search backend implementations.
*
* @version //autogentag//
* @package Search
*/
interface ezcSearchIndexHandler
{
/**
* Starts a transaction for indexing.
*
* When using a transaction, the amount of processing that the search
* backend does decreases, increasing indexing performance. Without this,
* the component sends a commit after every document that is indexed.
* Transactions can be nested, when commit() is called the same number of
* times as beginTransaction(), the component sends a commit.
*/
public function beginTransaction();
/**
* Ends a transaction and calls commit.
*
* @throws ezcSearchTransactionException if no transaction is active.
*/
public function commit();
/**
* Indexes the document $document using definition $definition
*
* @param ezcSearchDocumentDefinition $definition
* @param mixed $document
*/
public function index( ezcSearchDocumentDefinition $definition, $document );
/**
* Creates a delete query object with the fields from the definition filled in.
*
* @param string $type
* @param ezcSearchDocumentDefinition $definition
* @return ezcSearchDeleteQuery
*/
public function createDeleteQuery( $type, ezcSearchDocumentDefinition $definition );
/**
* Builds the delete query and returns the parsed response
*
* @param ezcSearchDeleteQuery $query
*/
public function delete( ezcSearchDeleteQuery $query );
/**
* Deletes a document by the document's $id
*
* @param mixed $id
* @param ezcSearchDocumentDefinition $definition
*/
public function deleteById( $id, ezcSearchDocumentDefinition $definition );
}
?>