Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Google-like query of ASCII text with Text::Query or other modules

by jbullock35 (Hermit)
on Aug 24, 2005 at 06:16 UTC ( #486110=note: print w/ replies, xml ) Need Help??


in reply to Re: Google-like query of ASCII text with Text::Query or other modules
in thread Google-like query of ASCII text with Text::Query or other modules

This looks like a module I'd love to use. But it indexes files, and my problem is that the text passages against which I want to run queries don't exist in files. They're created on the fly—thousands of short passages. In my script, they exist as scalars. Is there any way to run a Google-like (or SWISH-like) query against them, given that they don't exist as files?

Thanks,
--John


Comment on Re^2: Google-like query of ASCII text with Text::Query or other modules
Re^3: Google-like query of ASCII text with Text::Query or other modules
by saintmike (Vicar) on Aug 24, 2005 at 07:29 UTC
    Swish supports indexing arbitrary items, not just files. If you disect the innerts of SWISH::API::Common, you'll see that it puts a 'streamer' into swish's config file.

    The 'streamer' is a program that prints out the text data that's supposed to be indexed, plus some meta data. Check out the file_stream method in SWISH::API::Common:

    print "Path-Name: $file\n", "Document-Type: TXT*\n", "Content-Length: $size\n\n"; print $data;

    So, unless you want to put your text snippets into files, there'll be some additional work involved, but it should be easy.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://486110]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2014-09-17 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (99 votes), past polls