The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Apache::Solr::JSON - Apache Solr (Lucene) client via JSON

INHERITANCE

 Apache::Solr::JSON
   is a Apache::Solr

SYNOPSIS

  my $solr = Apache::Solr::JSON->new(...);
  my $solr = Apache::Solr->new(format => 'JSON', ...);

DESCRIPTION

Implement the Solr client, where the communication is in JSON.

Both the requests and the responses are using JSON syntax, produced by the JSON distribution (which defaults to JSON::XS when installed)

Warning 1: Apparently, Perl's JSON implementation does not support the repetition of keys in one list, but Solr is using that. Care is taken to avoid these cases.

Warning 2: In some cases, XML and JSON differ in structure and names in the structure. In those cases, the XML plan is made leading: the JSON data is transformed to match the XML.

METHODS

Constructors

Apache::Solr::JSON->new(OPTIONS)
 -Option        --Defined in     --Default
  agent           Apache::Solr     <created internally>
  autocommit      Apache::Solr     true
  core            Apache::Solr     undef
  format          Apache::Solr     'JSON'
  json                             <created internally>
  server          Apache::Solr     <required>
  server_version  Apache::Solr     <latest>
agent => LWP::UserAgent object
autocommit => BOOLEAN
core => NAME
format => 'XML'|'JSON'
json => JSON object

By default, an JSON object is created for you, in utf8 mode.

server => URL
server_version => VERSION

Accessors

$obj->agent()

See "Accessors" in Apache::Solr

$obj->autocommit([BOOLEAN])

See "Accessors" in Apache::Solr

$obj->core([CORE])

See "Accessors" in Apache::Solr

$obj->json()
$obj->server([URI|STRING])

See "Accessors" in Apache::Solr

$obj->serverVersion()

See "Accessors" in Apache::Solr

Commands

See http://wiki.apache.org/solr/UpdateJSON

$obj->queryTerms(TERMS)

See "Search" in Apache::Solr

$obj->select(PARAMETERS)

See "Search" in Apache::Solr

Updates

$obj->addDocument(DOC|ARRAY, OPTIONS)

See "Updates" in Apache::Solr

$obj->commit(OPTIONS)

See "Updates" in Apache::Solr

$obj->delete(OPTIONS)

See "Updates" in Apache::Solr

$obj->extractDocument(OPTIONS)

See "Updates" in Apache::Solr

$obj->optimize(OPTIONS)

See "Updates" in Apache::Solr

$obj->rollback()

See "Updates" in Apache::Solr

Core management

$obj->coreReload([CORE])

See "Core management" in Apache::Solr

$obj->coreStatus()

See "Core management" in Apache::Solr

$obj->coreUnload([OPTIONS])

See "Core management" in Apache::Solr

Helpers

$obj->simpleDocument(COMMAND, [ATTRIBUTES, [CONTENT]])

Construct a simple XML structure.

$obj->simpleUpdate(COMMAND, ATTRIBUTES, [CONTENT])

Parameter pre-processing

$obj->deprecated(MESSAGE)

See "Parameter pre-processing" in Apache::Solr

$obj->expandExtract(PAIRS|ARRAY)

See "Parameter pre-processing" in Apache::Solr

$obj->expandSelect(PAIRS)

See "Parameter pre-processing" in Apache::Solr

$obj->expandTerms(PAIRS|ARRAY)

See "Parameter pre-processing" in Apache::Solr

$obj->ignored(MESSAGE)

See "Parameter pre-processing" in Apache::Solr

Other helpers

$obj->endpoint(ACTION, OPTIONS)

See "Other helpers" in Apache::Solr

SEE ALSO

This module is part of Apache-Solr distribution version 0.95, built on February 01, 2013. Website: http://perl.overmeer.net

LICENSE

Copyrights 2012-2013 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html