Apache-Solr

 view release on metacpan or  search on metacpan

lib/Apache/Solr.pod  view on Meta::CPAN


=item * mlt -> F<https://solr.apache.org/guide/8_11/morelikethis.html>

=item * stats -> F<http://wiki.apache.org/solr/StatsComponent>

=item * suggest -> F<https://solr.apache.org/guide/8_11/suggester.html>

=item * group -> F<http://wiki.apache.org/solr/FieldCollapsing>

=back

You may use WebService::Solr::Query to construct the query ('q').

example: 

  my @r = $solr->expandSelect(
      q => 'inStock:true', rows => 10,
      facet => {limit => -1, field => [qw/cat inStock/], mincount => 1},
      f_cat_facet => {missing => 1},
      hl    => {},
      mlt   => { fl => 'manu,cat', mindf => 1, mintf => 1 },
      stats => { field => [ 'price', 'popularity' ] },
      group => { query => 'price:[0 TO 99.99]', limit => 3 },
  );

  # becomes (one line)
  ...?rows=10&q=inStock:true
    &facet=true&facet.limit=-1&facet.field=cat
       &f.cat.facet.missing=true&facet.mincount=1&facet.field=inStock
    &mlt=true&mlt.fl=manu,cat&mlt.mindf=1&mlt.mintf=1
    &stats=true&stats.field=price&stats.field=popularity
    &group=true&group.query=price:[0+TO+99.99]&group.limit=3

=item $obj-E<gt>B<expandTerms>(PAIRS|ARRAY)

Used by L<queryTerms()|Apache::Solr/"Search"> only.

example: 

  my @t = $solr->expandTerms('terms.lower.incl' => 'true');
  my @t = $solr->expandTerms([lower_incl => 1]);   # same

  my $r = $self->queryTerms(fl => 'subject', limit => 100);

=item $obj-E<gt>B<ignored>($message)

Produce a warning $message about parameters which will get ignored
because they were not yet supported by the indicated server version.

=item $obj-E<gt>B<removed>($message)

Produce a warning $message about parameters which will not be passed on,
because they were removed from the indicated server version.

=back

=head3 Other helpers

=over 4

=item $obj-E<gt>B<endpoint>($action, %options)

Compute the address to be called (for HTTP)

 -Option--Default
  core    new(core)
  params  []

=over 2

=item core => NAME

If no core is specified, the default of the server is addressed.

=item params => HASH|ARRAY-of-pairs

The order of the parameters will be preserved when an ARRAY or parameters
is passed; you never know for a HASH.

=back

=item $obj-E<gt>B<request>($url, $result, $body, $ct)

Send a request to the server C<$url> and return the response
(an HTTP::Response object).  A trace of the activity is
added to the C<$result> object.  The C<$body> of the request
can be provided as bytes or reference to bytes (SCALAR). The
content-type C<$ct> must match the body bytes.

=back

=head1 DETAILS

=head2 Comparison with other implementations

=head3 Compared to WebService::Solr

WebService::Solr is a good module, with a lot of miles.  The main
differences is that C<Apache::Solr> has much more abstraction.

=over 4

=item * simplified parameter syntax, improving readibility

=item * real Perl-level boolean parameters, not 'true' and 'false'

=item * warnings for deprecated and ignored parameters

=item * smart result object with built-in trace and timing

=item * hidden paging of results

=item * flexible logging framework (Log::Report)

=item * both-way XML or both-way JSON, not requests in XML and answers in JSON

=item * access to plugings like terms and tika

=item * no Moose

=back



( run in 0.466 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )