Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

RE: Search engine

by nuance (Hermit)
on Aug 01, 2000 at 17:02 UTC ( #25446=note: print w/replies, xml ) Need Help??

in reply to Search engine

foreach $i (keys %Index_db) { if ($i == $id) { @fileId = split( /:/, $Index_db{$i}); . . . } }

Why are you iterating over the keys of this hash? surely you should just do:

$id = $Words_db{$word}; @fileId = split( /:/, $Index_db{$id});

And that would have the same effect in a much shorter time.

Why do you have two hashes if the first only holds an index into the second. Reading over this it looks like you were previously using an array for Index_db, and that the hash held the array index where you could find the information. I think you should look at the code again as you can probably do without the Words_db hash, and clean up the logic to exploit the hash you are using.


Replies are listed 'Best First'.
RE: RE: Search engine
by larsen (Parson) on Aug 01, 2000 at 17:41 UTC
    Oh yes, surely. I think this is a very old version of my code (by the way, I think one has to be very stupid to write something like this).
    I hope there's a way to decrease monks' experience :) Thank you.
      You don't have to be stupid to write that, if you've been dealing with a problem for a long time sometimes you forget why you made certain implementation decisions. Often a "fresh" pair of eyes see things that you missed because you are "too familiar" with them.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2022-05-22 14:54 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (80 votes). Check out past polls.