line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dezi::Lucy; |
2
|
1
|
|
|
1
|
|
21254
|
use Moose; |
|
1
|
|
|
|
|
479479
|
|
|
1
|
|
|
|
|
7
|
|
3
|
|
|
|
|
|
|
extends 'Dezi::App'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.014'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
1; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
__END__ |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Dezi::Lucy - Dezi Apache Lucy backend |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 SYNOPSIS |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# create an index |
20
|
|
|
|
|
|
|
use Dezi::Lucy; |
21
|
|
|
|
|
|
|
my $app = Dezi::Lucy->new( |
22
|
|
|
|
|
|
|
invindex => 'path/to/dezi.index', |
23
|
|
|
|
|
|
|
aggregator => 'fs', |
24
|
|
|
|
|
|
|
indexer => 'lucy', |
25
|
|
|
|
|
|
|
config => 'path/to/dezi.conf', |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
$app->run('path/to/files'); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# then search the index |
31
|
|
|
|
|
|
|
my $searcher = Dezi::Lucy::Searcher->new( |
32
|
|
|
|
|
|
|
invindex => 'path/to/dezi.index', |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
my $results = $searcher->search('my query') |
35
|
|
|
|
|
|
|
while ( my $result = $results->next ) { |
36
|
|
|
|
|
|
|
printf("%s : %s\n", $result->score, $result->uri); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 DESCRIPTION |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
B<STOP>: Read the L<Dezi> and L<Dezi::App> documentation before you use this |
43
|
|
|
|
|
|
|
module. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Dezi::Lucy is an Apache Lucy based implementation of L<Dezi::App> |
46
|
|
|
|
|
|
|
using the L<SWISH::3> bindings for libswish3. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Dezi::Lucy is to Apache Lucy what Solr or ElasticSearch is to Lucene. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
See the L<Dezi::App> docs for more information about the class |
51
|
|
|
|
|
|
|
hierarchy and history. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
See the Swish3 development site at L<http://swish3.dezi.org/>. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 Why Not Use Lucy Directly? |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
You can use Lucy directly. Using Lucy via Dezi::Lucy |
58
|
|
|
|
|
|
|
offers a few advantages: |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=over |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=item Aggregators and Filters |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
You get to use all of Dezi's Aggregators and SWISH::Filter support. |
65
|
|
|
|
|
|
|
So you can easily index all kinds of file formats |
66
|
|
|
|
|
|
|
(email, .txt, .html, .xml, .pdf, .doc, .xls, etc) |
67
|
|
|
|
|
|
|
without writing your own parser. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item SWISH::3 |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
SWISH::3 offers fast and robust XML and HTML parsers |
72
|
|
|
|
|
|
|
with an extensible configuration system, build on top of libxml2. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=item Simple now, complex later |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
You can index your content with Dezi::Lucy, |
77
|
|
|
|
|
|
|
then build a more complex searching application directly |
78
|
|
|
|
|
|
|
with Lucy. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=back |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 AUTHOR |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Peter Karman, E<lt>karpet@dezi.orgE<gt> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 BUGS |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Please report any bugs or feature requests to C<bug-dezi-app at rt.cpan.org>, or through |
89
|
|
|
|
|
|
|
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Dezi-App>. |
90
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 SUPPORT |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
perldoc Dezi::App |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
You can also look for information at: |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=over 4 |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item * Website |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
L<http://dezi.org/> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item * IRC |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
#dezisearch at freenode |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=item * Mailing list |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
L<https://groups.google.com/forum/#!forum/dezi-search> |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Dezi-App> |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
L<http://annocpan.org/dist/Dezi-App> |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=item * CPAN Ratings |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
L<http://cpanratings.perl.org/d/Dezi-App> |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=item * Search CPAN |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
L<https://metacpan.org/dist/Dezi-App/> |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=back |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Copyright 2014 by Peter Karman |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
137
|
|
|
|
|
|
|
it under the terms of the GPL v2 or later. |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head1 SEE ALSO |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
L<http://dezi.org/>, L<http://swish-e.org/>, L<http://lucy.apache.org/> |
142
|
|
|
|
|
|
|
|