Skip to content

Vuzit_Document_findAll

bmatzelle edited this page Dec 9, 2010 · 5 revisions

Vuzit_Document findAll function

Searches for a document according to the supplied query and options.

Signatures

  • public static findAll($options = null)

Parameters

  • array $options : Options for the uploaded file. See “Options” below.

Options

  • query – string : Query keywords to search for.
  • limit – int : Limits the results to this many.
  • offset – int: Offsets the results at this record
  • output – string: Set this value to “minimal” to return just the web IDs of documents you are searching for. All other attributes like title, subject, pages, etc will be null. This will make client work faster because there is much less XML. Set this value to “summary” to return the document ID, document title, file size, page count and an excerpt from the document. This is useful for showing a search engine results page (SERP). The default is “minimal”.

Return type

Usage Examples

Search for a document by the keywords “john smith”:


Vuzit_Service::setPublicKey('YOUR_PUBLIC_API_KEY');
Vuzit_Service::setPrivateKey('YOUR_PRIVATE_API_KEY');

$docs = Vuzit_Document::findAll(array("query" => "john smith"));

foreach($docs as $doc)
{
  echo "Document id: " . $doc->getId();
  echo "Document title: " . $doc->getTitle();
}

Search for for the first 5 documents that match “linda”:


Vuzit_Service::setPublicKey('YOUR_PUBLIC_API_KEY');
Vuzit_Service::setPrivateKey('YOUR_PRIVATE_API_KEY');

$docs = Vuzit_Document::findAll(array("query" => "linda", "limit" => 5));

foreach($docs as $doc)
{
  echo "Document id: " . $doc->getId();
  echo "Document title: " . $doc->getTitle();
}