Apache-Solr
view release on metacpan or search on metacpan
version 1.10: Fri 18 Apr 16:52:35 CEST 2025
Improvements:
- .gitignore [Gábor Szabó] pull #4
- capitalize error messages
- add http_response to some errors. Requested by [Andy Beverley]
- add SOLR version display during test.
-Â Boolean parameters update to Solr 9.8 syntax.
version 1.09: Tue 6 Dec 13:28:37 CET 2022
Improvements:
- configure retries and retry-wait times on communication errors.
- fail when the number of retries is reached. [Andy Beverley]
- improve network failure reporting. Issue #3 [Gábor Szabó]
version 1.08: Sun 13 Nov 17:10:36 CET 2022
Fixes:
- perl 5.12 syntax issue [cpantesters]
Improvements:
- do not break at communication errors: alert but continue
Detected by [Any Beverley]
version 1.07: Fri 26 Aug 09:41:03 CEST 2022
- do no warn for long lists of pages, deep recursion.
Detected by [Andy Beverley]
- search with 'start' does not work with nextSelected()
Fixed by [Andy Beverley]
Improvements:
- nextSelected() plays well with selected()
- $core->select now may have options
- $core->select option 'sequential'
version 1.05: Fri 11 Jan 17:53:40 CET 2019
Fixes:
- include examples in the manual-pages.
Improvements:
- Convert to GitHUB
version 1.04: Mon 23 May 09:24:40 CEST 2016
Fixes:
- regression test fails on hash randomization [cpantesters]
rt.cpan.org#114542 [Slaven Rezic]
version 1.03: Sat 21 May 09:32:33 CEST 2016
Fixes:
- expandSelect() over-eager to protect generic configuration
flags to be used as specific field flags. [Mark Elrod]
version 1.02: Tue Mar 8 19:47:39 CET 2016
Fixes:
- implement the update attribute [Mark Elrod]
- boost float accept rounding error.
version 1.01: Thu Dec 11 15:54:03 CET 2014
Fixes:
- _getResult -> _getResults in selected()
rt.cpan.org#100860 [Kristian Gray]
version 1.00: Wed Dec 3 17:48:07 CET 2014
Changes:
- understand and simplify response/docs structure, results of
facet'd queries. rt.cpan.org#100662 [Douglas Early]
version 0.99: Mon Mar 3 10:27:02 CET 2014
Changes:
- ::XML add basic field types date, text, and double. Their
values are now included in the HASH by name, not by type.
So, date => { name => 'xyz', _ => $ts } becomes xyz => $ts
[Andrew Beverley]
Improvements:
- change documentation style
version 0.98: Wed Jan 22 17:00:02 CET 2014
Fixes:
- extractDocument(content_type) [Andrew Beverley]
- extractDocument character encoding on text [Andrew Beverley]
- extractDocument more use of ref on data.
version 0.97: Fri Nov 15 15:11:30 CET 2013
Changes:
- undefined value for boolean becomes 'missing', not 'false'
[Andrew Beverley]
Fixes:
- handling result without hits.
Improvements:
- expandExtract() accepts SCALAR
- ignore fields with undefined content
version 0.96: Thu Oct 10 15:42:25 CEST 2013
Improvements:
- adding a few new configuration fields, from 4.0.0 -> 4.5
version 0.95: Fri Feb 1 16:47:38 CET 2013
Fixes:
- ::Result::selected() deep recursion.
Improvements:
- new ::Result::nextSelected()
- ::Result::selected() does not need the optional $solr object anymore
version 0.94: Thu Jan 31 15:12:34 CET 2013
Fixes:
- extractDocument(string) did not work.
Improvements:
- catch and check deprecation warning in t/12facet.t
- accept parameter hashes for fmap, resource and boost in expandExtract
- honour autocommit in extractDocument()
- the user agent will be default be shared when multiple Solr objects
are created.
- do not die on HTML answers: put it in $result->success
- add \n to ::Results::errors()
- add ::coreStatus, ::coreReload, and ::coreUnload
version 0.93: Wed Jan 30 15:53:08 CET 2013
Improvements:
- support perl pre-5.10 by removal single use of //
- ::Document::boost() now also for fields
- further documentation improvements
- much better error reporting, use $result->errors()
- surpress early warning about connection errors.
- take filename from extractDocument() even if the data is
specified as string.
- extended the power of expandExtract()
version 0.92: Thu Dec 6 09:48:18 CET 2012
- fix delete()
- no multiple deletes in JSON available (it seems)
- implement extractDocument()
- avoid added wt=> for select more than one
version 0.91: Tue Dec 4 09:41:10 CET 2012
- ::Document field lookups by hash, not grep.
- ::Result::selected() returns ::Document, not HASH. Then, ask
for highlighed info via ::Result::highlighted($doc)
- many more tricks with a ::Document
- extractDocument() is work in progress
version 0.90: Mon Dec 3 11:46:27 CET 2012
- initial implementation
t/12facet.t view on Meta::CPAN
}
### Facet Fields
check_get
"$server/select?q=ipod&rows=0&facet=true&facet.limit=-1&facet.field=cat&facet.field=inStock",
{ q => 'ipod', rows => 0
, facet => { limit => -1, field => [ qw/cat inStock/ ] }
}, 'example 1 get';
my $f1 = <<'_FACET_FIELDS1';
<response>
<responseHeader><status>0</status><QTime>2</QTime></responseHeader>
<result numFound="4" start="0"/>
<lst name="facet_counts">
<lst name="facet_queries"/>
<lst name="facet_fields">
<lst name="cat">
<int name="search">0</int>
<int name="memory">0</int>
<int name="graphics">0</int>
t/12facet.t view on Meta::CPAN
<int name="drive">0</int>
<int name="printer">0</int>
</lst>
<lst name="inStock">
<int name="false">3</int>
<int name="true">1</int>
</lst>
</lst>
</lst>
</response>
_FACET_FIELDS1
my $d1 =
{
responseHeader => { status => '0', QTime => '2' },
facet_counts => {
facet_fields => {
cat => { printer => '0', search => '0', copier => '0', monitor => '0',
drive => '0', music => '1', connector => '2', camera => '0',
scanner => '0', software => '0', card => '0', graphics => '0',
memory => '0', multifunction => '0', electronics => '3', hard => '0'
t/12facet.t view on Meta::CPAN
is_deeply(decode_xml($f1), $d1, 'example 1 xml');
### Facet Fields with No Zeros
check_get
'http://localhost:8983/solr/select?q=ipod&rows=0&facet=true&facet.limit=-1&facet.field=cat&facet.mincount=1&facet.field=inStock',
{ q => 'ipod', rows => 0
, facet => { limit => -1, field => [ qw/cat inStock/ ], mincount => 1 }
}, 'example 2 get';
my $f2 = <<'_FACET_FIELDS2';
<response>
<responseHeader><status>0</status><QTime>3</QTime></responseHeader>
<result numFound="4" start="0"/>
<lst name="facet_counts">
<lst name="facet_queries"/>
<lst name="facet_fields">
<lst name="cat">
<int name="music">1</int>
<int name="connector">2</int>
<int name="electronics">3</int>
</lst>
<lst name="inStock">
<int name="false">3</int>
<int name="true">1</int>
</lst>
</lst>
</lst>
</response>
_FACET_FIELDS2
my $d2 = {
responseHeader => { status => '0', QTime => '3' },
facet_counts => {
facet_fields => {
cat => { music => '1', connector => '2', electronics => '3' },
inStock => { false => '3', true => '1' }
},
facet_queries => {}
},
t/12facet.t view on Meta::CPAN
### Facet Fields with No Zeros And Missing Count For One Field
check_get
'http://localhost:8983/solr/select?q=ipod&rows=0&facet=true&facet.limit=-1&facet.field=cat&f.cat.facet.missing=true&facet.mincount=1&facet.field=inStock',
{ q => 'ipod', rows => 0
, facet => {limit => -1, field => [qw/cat inStock/], mincount => 1}
, f_cat_facet => {missing => 1}
}, 'example 3 get';
# weird field: <int>1</int>
my $f3 = <<'_FACET_FIELDS3';
<response>
<responseHeader><status>0</status><QTime>3</QTime></responseHeader>
<result numFound="4" start="0"/>
<lst name="facet_counts">
<lst name="facet_queries"/>
<lst name="facet_fields">
<lst name="cat">
<int name="music">1</int>
<int name="connector">2</int>
<int name="electronics">3</int>
<int>1</int>
</lst>
<lst name="inStock">
<int name="false">3</int>
<int name="true">1</int>
</lst>
</lst>
</lst>
</response>
_FACET_FIELDS3
my $d3 = {
responseHeader => { status => '0', QTime => '3' },
facet_counts => {
facet_fields => {
cat => { '' => '1', music => '1', connector => '2', electronics => '3' },
inStock => { false => '3', true => '1' }
},
facet_queries => {}
},
t/12facet.t view on Meta::CPAN
#warn Dumper decode_xml($f3);
is_deeply(decode_xml($f3), $d3, 'example 3 xml');
### Facet Field with Limit
check_get
'http://localhost:8983/solr/select?rows=0&q=inStock:true&facet=true&facet.field=cat&facet.limit=5',
{ q => 'inStock:true', rows => 0
, facet => { field => 'cat', limit => 5 }
}, 'example 4 get';
my $f4 = <<'_FACET_FIELDS4';
<response>
<responseHeader><status>0</status><QTime>4</QTime></responseHeader>
<result numFound="12" start="0"/>
<lst name="facet_counts">
<lst name="facet_queries"/>
<lst name="facet_fields">
<lst name="cat">
<int name="electronics">10</int>
<int name="memory">3</int>
<int name="drive">2</int>
<int name="hard">2</int>
<int name="monitor">2</int>
</lst>
</lst>
</lst>
</response>
_FACET_FIELDS4
my $d4 = {
responseHeader => { status => '0', QTime => '4' },
facet_counts => {
facet_fields => {
cat => { memory => '3', drive => '2', monitor => '2',
electronics => '10', hard => '2' }
},
facet_queries => {}
},
t/12facet.t view on Meta::CPAN
### Facet Fields and Facet Queries
check_get
'http://localhost:8983/solr/select?q=video&rows=0&facet=true&facet.field=inStock&facet.query=price:[*+TO+500]&facet.query=price:[500+TO+*]',
{ q => 'video', rows => 0
, facet =>
{ field => 'inStock'
, query => [ 'price:[* TO 500]', 'price:[500 TO *]']
}
}, 'example 5 get';
my $f5 = <<'_FACET_FIELDS5';
<response>
<responseHeader><status>0</status><QTime>11</QTime></responseHeader>
<result numFound="3" start="0"/>
<lst name="facet_counts">
<lst name="facet_queries">
<int name="price:[* TO 500]">2</int>
<int name="price:[500 TO *]">1</int>
</lst>
<lst name="facet_fields">
<lst name="inStock">
<int name="false">2</int>
<int name="true">1</int>
</lst>
</lst>
</lst>
</response>
_FACET_FIELDS5
my $d5 = {
responseHeader => { status => '0', QTime => '11' },
facet_counts => {
facet_fields => { inStock => { false => '2', true => '1' } },
facet_queries => { 'price:[500 TO *]' => '1', 'price:[* TO 500]' => '2' }
},
result => { numFound => '3', start => '0' }
};
t/12facet.t view on Meta::CPAN
### Facet prefix (term suggest)
check_get #XXX huh? Ruby? on -> true on index and facet
'http://localhost:8983/solr/select?q=hatcher&wt=ruby&indent=true&facet=true&rows=0&facet.field=text&facet.prefix=xx&facet.limit=5&facet.mincount=1',
{ q => 'hatcher', wt => 'ruby', indent => 'on', rows => 0
, facet => {field => 'text', prefix => 'xx', limit => 5, mincount => 1}
}, 'example 6 get';
my $f6 = <<'_FACET_FIELDS6';
{
'responseHeader'=>{
'status'=>0,
'QTime'=>88,
'params'=>{
'facet.limit'=>'5',
'wt'=>'ruby',
'rows'=>'0',
'facet'=>'true',
'facet.mincount'=>'1',
t/12facet.t view on Meta::CPAN
'response'=>{'numFound'=>90,'start'=>0,'docs'=>[]
},
'facet_counts'=>{
'facet_queries'=>{},
'facet_fields'=>{
'text'=>[
'xx',7,
'xxxviii',2,
'xx909337',1,
'xxvi',1] } }
_FACET_FIELDS6
### Date Faceting: per day for the past 5 days
try { # catch 'deprecated warning'
check_get
'http://localhost:8983/solr/select/?q=*:*&rows=0&facet=true&facet.date=timestamp&facet.date.start=NOW/DAY-5DAYS&facet.date.end=NOW/DAY%2B1DAY&facet.date.gap=%2B1DAY',
{ q => '*:*', rows => 0
, facet => { date => 'timestamp', date_gap => '+1DAY'
, date_start => 'NOW/DAY-5DAYS', date_end => 'NOW/DAY+1DAY'}
}, 'example 7 get';
} hide => 'WARNING';
my @ex = $@->exceptions;
cmp_ok(scalar @ex, '==', 1, 'exceptions');
is("$ex[0]","warning: Deprecated solr main::check_get(facet.date) since 3.1\n");
my $f7 = <<'_FACET_FIELDS7';
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">5</int>
<lst name="params">
<str name="facet.date">timestamp</str>
<str name="facet.date.end">NOW/DAY+1DAY</str>
<str name="facet.date.gap">+1DAY</str>
<str name="rows">0</str>
<str name="facet">true</str>
t/12facet.t view on Meta::CPAN
<int name="2007-08-13T00:00:00.000Z">3</int>
<int name="2007-08-14T00:00:00.000Z">7</int>
<int name="2007-08-15T00:00:00.000Z">2</int>
<int name="2007-08-16T00:00:00.000Z">16</int>
<str name="gap">+1DAY</str>
<date name="end">2007-08-17T00:00:00Z</date>
</lst>
</lst>
</lst>
</response>
_FACET_FIELDS7
my $d7 = {
responseHeader => {
params => {
facet => 'true', indent => 'true', q => '*:*', rows => '0',
'facet.date.end' => 'NOW/DAY+1DAY', 'facet.date.gap' => '+1DAY',
'facet.date.start' => 'NOW/DAY-5DAYS', 'facet.date' => 'timestamp'
},
status => '0', QTime => '5'
},
t/12facet.t view on Meta::CPAN
is_deeply(decode_xml($f7), $d7, 'example 7 xml');
### Pivot (ie Decision Tree) Faceting
check_get
'http://localhost:8983/solr/select?q=*:*&facet.pivot=cat,popularity,inStock&facet.pivot=popularity,cat&facet=true&facet.field=cat&facet.limit=5&rows=0&wt=json&indent=true&facet.pivot.mincount=0',
{ q => '*:*', rows => 0, wt => 'json', indent => 1
, facet => { pivot => [ 'cat,popularity,inStock', 'popularity,cat' ]
, pivot_mincount => 0, field => 'cat', limit => 5 }
}, 'example 8 get';
my $f8 = <<'_FACET_FIELDS8';
"facet_pivot":{
"cat,popularity,inStock":[{
"field":"cat",
"value":"electronics",
"count":14,
"pivot":[{
"field":"popularity",
"value":"6",
"count":5,
"pivot":[{
t/12facet.t view on Meta::CPAN
"pivot":[{
"field":"inStock",
"value":"false",
"count":2},
{
"field":"inStock",
"value":"true",
"count":2}]},
{
...
_FACET_FIELDS8
( run in 1.238 second using v1.01-cache-2.11-cpan-49f99fa48dc )