Re: Does MySql have any built in search functionality

From: Jerry Gitomer (jgitomer_at_erols.com)
Date: 04/30/04


Date: Fri, 30 Apr 2004 09:25:34 -0400

On Thu, 29 Apr 2004 23:44:27 -0400, Jerry Gitomer wrote:

> On Thu, 29 Apr 2004 19:29:50 -0700, lawrence wrote:
>
>> I've spent some time going over this page:
>>
>> http://dev.mysql.com/doc/mysql/en/Data_Manipulation.html
>>
>> And so far it seems the answer is no. So I thought I'd ask here. Does
>> anyone know of any built-in search algorithms with MySql?
>>
>> I'm looking for a way to return the results of my last SELECT statement
>> (which uses LIKE) based on the number of hits the LIKE came up with. In
>> other words, I want something like this:
>>
>> SELECT * FROM mainContent WHERE mainText LIKE '%$matchThis%' FROM
>> mainContent ORDER BY number of matches per entry DESC
>
> You are trying to marry two mutually exclusive conditions: The use of an
> RDBMS and "record" sequences. The order in which data is retrieved is
> random and inconsistent. In other words if you run a query more than once
> there is no guarantee that the results will be in the same order each time
> you run it or that the behavior will be consistent from release to release
> of an RDBMS.
>
> Now, if you want to know how many rows in the table match your like use
> count. e.g. SELECT COUNT(*) FROM mainContent WHERE mainText LIKE
> '%$matchThis%';
>
> HTH
> Jerry

I had another thought about your problem. If you have sufficient memory
available you could read the query result into an array and then use PHP
and/or Pear DB to manipulate the array.

HTH
Jerry



Relevant Pages

  • Re: Copying a table to an array
    ... You probably don't need a query, ... Dim rstRSet As Recordset ... table to enable data from the latter to be read into an array with GetRows. ... exercise has therefore to be repeated prior to each interrogation. ...
    (microsoft.public.access.formscoding)
  • Re: Mix/Max/Avg Help based on dynamic ranges
    ... Did you enter Biff's formula as an array? ... The query I gave you is dependent on your breaking out the ranges as Biff ... Where Nums are the values to avg based on the head count range. ... deemed optimal for building device profiles based on locn size and device ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Copying a table to an array
    ... "Peter Hibbs" wrote: ... You probably don't need a query, ... Dim rstRSet As Recordset ... table to enable data from the latter to be read into an array with GetRows. ...
    (microsoft.public.access.formscoding)
  • Re: Imitating Mail Merge on server
    ... given moment we know which data (in this case, customers) is being worked ... and concantenate each query together. ... loop the array, plug in the current recordset value. ... We have close to fifty tokens that we use in the application correspondence, ...
    (microsoft.public.inetserver.asp.general)
  • Re: Subquery Confusion
    ... Then I got this crazy idea that an Array can only contain a maximum ... number of characters, ... Then I decide that maybe I'm completely wrong with my query, ... it out of Excel VBA and spit it into Microsoft SQL Server Management ...
    (microsoft.public.excel.programming)