If I understand you correctly you want to index everything so you don't have to do LIKE matches. I think this is both unrealistic and defeats the utility of searching.

Eg, a casual grep of my dict file gives 1,001 matches for "til" and 7 for "dows" none of which is "windows." (no plurals in the dict.) So searches are going to return tens, hundreds, or thousands (depending on your document base) of meaningless results with this approach.

Many people do indexes with stemming with things like Lingua::Stem::En and I've seen Text::DoubleMetaphone used to great effect to aid foreign users in finding the English terms and names that natives can barely spell. Both these techniques will blow up DB indexes a lot but still within reason.

What you seem to be talking about would require indexing everything in every composite element. So something like windows is split into indices: w, wi, win, wind, windo, window, windows, i, in, ind, indo... etc, at some length. Even a partial approach like that (on syllables or something) would probably be huge and not very helpful for searching. Sidenote: I actually wish search engines would never even stem; it clouds result sets more than it helps.

You can also do LIKE searches on 'partial-string%' with better speed and efficiency than '%partial-string%' if that's something you really need to do. Don't forget to force the user to enter in at least X letters too. There is no point whatsoever in searching for "e" for example and less than 4 characters is not likely to be meaningful in normal text.


In reply to Re: Search engine help by Your Mother
in thread Search engine help by cassiano

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.