Results 1 to 4 of 4

Thread: Database Search

  1. #1
    Join Date
    Mar 2002
    Posts
    162

    Unanswered: Database Search

    What is the quickest way to search an entire database for a text string....e.g if I were looking for a every instance the word "Triangulate" occured, how would I do it?

    I use ASE 11.5 by the way

  2. #2
    Join Date
    Mar 2002
    Posts
    162
    don't bother I think I would have to install

    ASE's "Full-Text Search Engine " to do this. unless there is another way of course

  3. #3
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    EFTS (enhanced full-text search) would allow you to use indexes to find the data instead of a table scan.

    If you have text columns or the like, you could do
    Code:
    SELECT *
      FROM table
     WHERE textcol LIKE "%triangulate%"
    Note that will table scan since you cannot use an index for that query. If you do not want to use EFTS, you could try breaking it up into a keywords table, e.g.
    articles( article_id, article_text )
    keywords( article_id, keyword )

    Then if you store each row like this:
    articles
    --------
    1, "We can triangulate..."

    keywords
    --------
    1, "we"
    1, "can"
    1, "triangulate"

    Then you can run something like:
    Code:
    SELECT *
      FROM article a,
           keywords k
     WHERE a.article_id = k.article_id
        AND k.keyword = 'triangulate'
    Thanks,

    Matt

  4. #4
    Join Date
    Mar 2002
    Posts
    162
    I actually tried this already. Thanks anyhow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •