Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by jbullock35 (Hermit)
on Aug 24, 2005 at 19:42 UTC ( #486343=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

Alas, they're in one large text file. I work at a university. Basically, I've got a 5MB text file containing thousands of paragraphs, each of which is a description of a different course. I want students to be able to search this catalog, and I want their results to be the full text of all matching paragraphs.

Right now, I handle this by using a regex to search each paragraph, returning to the user every paragraph that matches the query. The file is searched each time, so this is quite inefficient. As Tanktalus suggests below, I'd be better off if these descriptions were already in a database. But there's no question that this particular project isn't worth the time I would need to do that.

Of course, using a database would also permit the students to run more powerful queries, which is what I'd really like to do. My main concern at this point is not the efficiency of the search (which isn't terribly slow as it is), but improving the query capabilities.

Thanks,
--John


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-09-23 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (210 votes), past polls