Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





MySQL 5.0, FULL-TEXT Indexing And Search Arabic Data, Unicode


MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode

[This version has a couple subtle edits from the orginial I posted
on mailing.database.myodbc - I'm cross posting here on this
topic/subject related newsgroup]

I was wondering if anybody has experienced the same issues
challenges I'm experiencing I'll describe shortly. Once
resolved some fascinating and powerful multi-lingual
apps incorporating non-English/latin character sets can be
realized by many developers.

I have a Unicode utf8 English - Arabic - Hebrew - Greek (and
several other languages) database in Microsoft Excel. I KNOW
that it is Unicode utf8 data because MySQL tells me it
recognizes the encoding as such but not in the context I want.

Allow me to explain ...

I can search the Unicode utf8 encoding with no problem in
Excel. While in Excel I highlight a complete word or a
partial string of an Arabic word copy it to the clipboard
(i.e. memory). I then do a find and the process is the
same successful result as if it was an English string.

MySQL 5.0 is supposed to handle Unicode utf8

I created a MySQL database I named: languages

CREATE DATABASE languages ;

and I implemented the following command on a MySQL
command prompt:

ALTER DATABASE languages DEFAULT CHARACTER SET utf8;

No problem (so far) MySQL seemingly recognized utf8 and
accepted it. My understanding is with the ALTER command
the tables I create against languages will be utf8.

I now created a table I named mainlang which denotes it
will be the main table for my languages.

mysql>CREATE TABLE mainlang
->(
->langNumID varchar(30),
->colB varchar(30),
->colC varchar(30),
->primary key (langNumID, colB)
->);

Again so far no problem: Table successfully created.
My third column 'colC' is where the Unicode data
will be stored.

I now attempt to import the database from my
Excel file into my MySQL database as follows:

mysql>load data infile 'c:arabicdictionary.csv'
->into table mainlang
->fields terminated by ','
->lines terminated by '
'
->(langNumID, colB, colC);
ERROR 1406 (22001): Data too long for 'colC' at row 1

So what to do? I did a search and found other
people seemingly had the same problem and someone
suggested:

ALTER DATABASE languages DEFAULT CHARACTER SET cp1250;

I dropped mainlang, recreated it, redid the load and
Lo and behold ... it seemed to work. No Data too long
error occurred and when I did the following query:

mysql>select langNumID, colB, colC
->from mainlang
->where colB = ��'

I see colA have a correct numeric value, colB a
correct numeric value (4994) and for colC a string of
unintelligible characters with diacritical marks,
oomlats etc. which I know is the cp1250 encoding
interpretation of the Unicode utf8 data which is
similarly unintelligible in its own regard.

Now what I try is: do a copy of the obscure colC
cp1250 character string into the clipboard/memory
and then do the following tweak on the original
select statement to see if I can search on the
(now) cp1250 character string:

mysql>select langNumID, colB, colC
->from mainlang
->where colc = 'paste of the cp1250 character string'

The computer would not allow a paste unless I pressed
the escape key. On initiating this select command
I got an empty set (no match)

My questions are:

Has anyone been successful creating a Unicode utf8
MySQL database that accepts Arabic?

If yes, how did you get around or not encounter the
Data too long issue?

Have you tried the cp1250 (or cp1251 - same mechanics
same results) work around as I have? Are you
able to search the cp1250 character string (my colC)?
If yes, how did you successfully manage to do it?

Lastly, if I take the cp1250 encoded string and paste
it into Excel ... I can string search the cp1250
encoding with no problem.

Also, here's how I know my Unicode utf-8 data is
correct apart from my own manual cross-referencing
and being recognized by MySQL in some respect:

When I copy the Unicode utf8 encoding and try to
paste it into the select command to see what would
happen I get the following error:

ERROR 1257 (HY000): Illegal mix of collations
(cp1250_general_ci, IMPLICIT) and
(utf8_general_ci, COERCIBLE) for operation '='

So what I have here is a situation where MySQL
is recognizing Unicode utf8 encoding but not
from the respect of packing a table!

Go Figure ...




View Complete Forum Thread with Replies

Related Forum Messages:
Full Text File Search With Indexing Service On Windows
Here's a short tutorial on how to the OLE-DB extension to access
Windows Indexing Service. Impress your office-mates with a powerful
full-text search feature on your intranet. It's easier than you think.

First, download and install the extension
(http://sourceforge.net/project/show...kage_id=198554).
Simply unzip the file and copy the correct version of php_oledb.dll
into the PHP extensions folder. Then add the line
extension=php_oledb.dll in php.ini and restart your web server.

Now, if Indexing Service isn't running on your computer, turn it on. Go
to Control Panel Administrative Tools Services and configure
Indexing Service to start automatically. You can also ask the little
dog in the search window to do it for you if you're using Windows XP.
You will need to wait a while for Windows to build the initial index.
It could take a couple hours.

Once the extension is installed and the index is ready, you can start
coding. To connect to Indexing Service, you use the oledb_open
function:

$link = oledb_open("Provider=MSIDXS");

You then call oledb_query with a SQL statement. Let us start with
something simple: We'll look for all files on the computer containing
the word "love": .....

View Replies !
Full-text Indexing Of Pdf, Rtf, Txt, Html
I have a big pile of files on my local machine that are in a variety of
formats - txt, rtf, pdf, html, etc. What I'm looking for is a script
that will crawl through the files and perform simple full-text indexing
on them, and will allow for queries to be executed on the index.

I gave PHPDig a shot but it prefers web-based setups - my files are all
stored locally and will only be accessed locally.

View Replies !
Full Text Search ( Mysql )
I was searching the sql man , for some good ways to search a mysql db. so i found that Full text search the best way is to go becease LIKE just gives to mutch output.PHP Code:

View Replies !
Full-text Search Mysql
I building a little site using PHP and mysql. Now I want to make full
text searches on some columns in one table. The problem is that I have
25 colums in the table that I want to put at full-text index on. I
belive there is a limitation of 14(?) colums. What is the proper way
to handle this?

Reading about full-text indexes, do I have to make a "repair table..."
after each time I insert data in the table the will be included in the
indexed columns? If this is the case I must repair the table every
time I insert anything?!

I am using "DBDesigner 4". How can I see in my table that it is a
full-text index. Seems like it appears as a normal index in my data
definition as well as in the reversed engineered graphical
interface.

View Replies !
Full Text Search After Upgraded Mysql To Lastest Version Not Working
i upgraded mysql to lastest version one of my query worked right in previos version but it doesn't work now. i have a table with "test" name and 4 fields (id,title,intro,content)
these fields are full text: Code:

View Replies !
Arabic Text In Mysql
I have a database for storing company data for various print catalogues. Now we have a requirement to get Arabic information from companies as well. Hence, the company data table should now contain Arabic text along with the English. To achieve that I first converted the table from latin1 to UTF8 (utf8_general_ci). Then I changed the charcter set on my web pages containing the update forms to UTF-8. Now, the arabic data entered using the webpages is displayed fine in the resultant php pages, but when we want to see the same data in mysql (using mysql query browser/SQL yog/EMS Mysql Manager) the data shows up in binary form or .

I fail to understand how can I view Arabic text as it is in a mysql query window, so that when I epxort data it comes as it is and does not come in form of special characters. Have tried searching the net but no solutions have worked so far.

View Replies !
Full Text Search
First off, I'm using MySQL 3.23 so I'm not sure if Full Text Searches are even in that version since there isn't any documentation for versions before 4. Code:

View Replies !
Boolean Full Text Search
I use MySql boolean full text search for searching and i allow user to search for phrases with 'and' and 'or' operators in it, but it doesn't work for certain words, like 'use' and 'due'. Search ignores these words. Well, 'use' is a full-text stop word, but why 'due'? Is it because it's a 3 letter word or something? how to overcome this problem or is there any better search engine for me to use with php & MySql?

View Replies !
FULL-TEXT Search Not Working?
I'm doing a Full-Text search on MySQL. My table structure is as follows:

articleID,articleTitle,articleContent
articleContent is a FULL-TEXT Index.

There are about 70 articles some which contain the "keyword" example below. For some reason I'm getting ZERO rows returned and I'm not sure why.

I figured maybe my version of mysql was too old, but it is version 4.1.24 which according to the manual should support the following:

SELECT articleTitle FROM PressArticles WHERE MATCH (articleContent) AGAINST ('Miami');

However, it doesn't give back any results. I'm thinking I did something wrong in the query itself, but after 2 hours I just cant see what is wrong with it.

I'm trying to get the Titles of the articles that have the word Miami in the content.

View Replies !
Full-text Boolean Search
I have just started working on full-text boolean search.I have coded the program but I get an error :

You have an error in your SQL syntax near 'boolean mode)' at line 1

The fields in mysql table 'pubs' are :id,author,title,year. Here's my code:

View Replies !
Full Text Search More Than One Table
I'm building a full text search but would like the search term ($id) to search more than on table.

$query = "SELECT * FROM titles, artists WHERE artists.id = titles.artist_id AND MATCH(artists.artist, titles.title, titles.content) AGAINST ('$id')";

I get the following error (the query work if I search only one table i.e. titles) Error in query: SELECT * FROM titles, artists WHERE artists.id = titles.artist_id AND MATCH(artists.artist, titles.title, titles.content) AGAINST ('music').

View Replies !
Full Text Search Any Records
The following query does not bring back any records but they are definitely there For example the category field contains the words "Designer Men" and the brand is "Duck And Cover" (in the mySQL db). This code is a direct copy of another query but for "ladies ladie women women's" and it works prefectly this is why i do not understand it Here is the offender: PHP Code:

$num3 = getPORProducts("SELECT * FROM por WHERE MATCH(longDescription, category, description, brand, name) AGAINST('+"Duck & Cover" "Duck and Cover" "Duck & Cover" +(mens men's men)' IN BOOLEAN MODE)");

p.s. to save you some time the problem is definitely with the code above, and has nothing to do with the functions i have created.

View Replies !
Full Text Search In PDF And Word Files ?
I need to perform full text searches on a batch of PDF and Word files.
What is the best way to go?

After some research, I'm thinking of extracting the plain text from the
files with "pdftotext" and "catdoc", hamonizing the various possible
encodings to UTF-8, storing the text in a MySQL database, and then
using the full text search capabilities of MySQL.
Do you think that would work well? I am told that the files are mostly
text and won't be longer than 30 pages.

View Replies !
Full Text Search With Pagination Class
I've used the Full Text search example from this site and added the pagination class from http://www.goodphptutorials.com/article/show/simple-php-mysql-pagination/1 but I'm stumbling where it actually breaks the page up into the prescribed number of page. Right now I have script set for 5 results per page and while I can get the total number of records in the search result set, I can't get the results to span over say 3 pages if there's 15 results. Code:

View Replies !
How Do I Echo Out Relevence In Full Text Search?
I wonder how to echo out relevance when doing a full text search? Here is my code that do the search:

$result = mysql_query("SELECT product_id, picture AS relevance FROM products WHERE MATCH (picture_is) AGAINST ('$keyword')");

I know how to echo out the result, but I also want to echo out the relevance like I have seen on some websites. I also tried the query in phpmyadmin and could see the relevance, just don't know how to get it in php.

View Replies !
Give User A Choice Of Fields To Search With Full Text/Boolean?
I want to give the user the option of searching a combination of the fields $Topic, $Subtopic, $Theswords in Boolean/Full Text. The problem is if I make any of the fields empty prior to the query, I get a MySql syntax error message. The user has the option of selecting fields via checkboxes, but when the field is not selected the user will get the error message because the variable is empty in the query statemtnt.

Are there any code suggestions for avoiding the error message when a field is not selected by the user to be searched? Code:

View Replies !
Gaining Access To How MySql Parses Text For Full Text
I want to gain access to the function or process MySql uses to parse words and phrases for Full Text searching. Here is an example.

If the user inputs...

Milan in history

MySql will search for milan, history, and milan history. Is there a way to extract just the combination of terms MySql uses to search the db without the stop words? Stop words are automatically eliminated from the search request unless the user encloses a phrase in quotes.

What I am trying to do is develop a script to highlight found search terms and phrases. I can explode a phrase into single words but if I do that the stop words would be included in the array. If there is some way of getting into the parsed words or phrases MySql Full Text actually uses to search, I can use each of those combinations as a keyword in my highlighting script.

This request is about searching for the code or any code related to the questions involved.

View Replies !
Extract Unicode Data From MySQL Db
I have a little, big, boring problem :)

I have a utf8 txt file to import in a MySQL db, cause I must create a
web-application in PHP for reading this information on-line.

I have create a new DB in MYSQL 4.1.1a setting CHARACTER=utf8,
then I have create a table t1 with character set utf8 and some fileds
also with CHARACTER=utf8.

Then I imported the Txt file (really in UTF8 format, with 22600
records!) in my db. MySQL have imported the non-utf8 field correctly,
26000 records.
When I try to read this utf8 filed they appear like "?-?-?".

Then, also my PHP application show this field with stranges
characters. I have try also with PHPfunction utf8_encode with no
success :(

View Replies !
MySQL Full-Text Searching
I am reading this article that says by default, the ft_min_word_len is 4 characters and the ft_max_word_len is 84 characters. I don't have access to the MySQL configuration file, is there a way to change the full-text word length settings like using .htaccess?

I access my MySQL using phpMyAdmin, which is shared with a bunch of other users. So I have no rights to make modification whatsoever. Is there a way to modify just my table in there?

View Replies !
Pdf With Unicode Support Or Arabic Characterset Support
I am working on a project that have a featre to print the news as a PDF file format. I am having a problem in generaing pdf with unicode support or Arabic characterset support. I can generat eenglish document like a charm but the probem in Arabic text. I am geting the data from the MySQL database. Anyone have any idea what to do, I search everywhere on net find some small results but still I am not been able to accomplish the task.

View Replies !
How To Validate Arabic Text
my client need to validate arabic text when entering it in the form.

View Replies !
Problem Related To Search For Arabic Meta Tags
I have special problem in using Meta tags searching, I have succeed to use
attached php page to make perfect Meta tags searching trough any site pages, but the problem raises when I try to use the same php code to search Arabic meta tags, I totally failed to fix this problem, no result was generated for Arab tags.

View Replies !
PDF Indexing/Search
I was wondering if anyone has any information about any function and or 3rd party software that can work with PHP to index and search PDF, Word, Excel documents? I am a Cold Fusion programmer starting to go PHP and Cold Fusion has a verity search feature that does this. There has to be something in PHP or products that PHP can use to do the same thing right?

View Replies !
How To Build An Indexing Search
I know there are many pre-built indexing search engines, some pretty good like ht://dig. However, I'm running Win NT 4 and consequently can't use it .

What I've found so far isn't bad, but to meet my needs I'd have to revamp most of them. I know I've seen how-to's on creating an indexing search engine in the past, but all I can seem to find now are pre-built engines. I realize that it's probably going to be more difficult to "re-invent" the wheel, but I want to exhaust the possibility that it's not.

View Replies !
Search Engine Indexing And '?'
It's well known that many search engines will not index pages that contain a question mark in the URL.

Can anyone provide me with any advice about a better way to pass information between my pages without using a query string e.g. index.php?page=home. After searching the web a little a number of solutions have popped up - the most popular being 'PATH_INFO' (if using Apache).

View Replies !
Indexing Search Results
I'm trying to use the following to limit search results per page and index results pages. The index renders, but when I select a "next" or numbered page index, the query doesn't run again and I get a blank page instead.

I've tried including my variables in the URL (index.php>variable=$variable&variable2=$variable2&page=$i , but that doesn't work either. Code:

View Replies !
Session Id In Url And Search Engine Indexing
I would like searchengines to index pages without the session id appended in the url.

When a visitor has cookies disabled the urls look like :

http://www.site.com/main.php?SESSID...7325099c755b25b

This is what a searchengine would see also.


However I would like the searchengine to index :

www.site.com/main.php

It's important for this site that sessions also work for people who have cookies disabled, so simply not appending the session id in the url is not an option in this case.

View Replies !
Session_start() Ruining Search Engine Indexing
Google is trying to index my pages with session id's attached to them.

Ex. =   show_cat.php?catid=P70&PHPSESSID=aeg3klbcaeoirjerfodfifs

And I don't know if this is right but I put these to lines in my robots.txt but it still didn't work.
Disallow: /*?PHPSESSID=
Disallow: /*?*PHPSESSID=
I am using session_start();

at the beginning of all my pages. What do I need to do? I will be toast if I don't change something.

View Replies !
PHP - Using Mail() And Unicode Text - Text Gets Disturbed
I have the following problem. On a website there's a (simple) feedback
form. This is used also by Polish visitors who (of course) type Polish
text using special characters.

However, when I receive the text in my mailbox, all special characters
have been turned into mess......

For example: "wspólprace" is turned into "współprace".

It seems PHP is handling the Unicode-8 strings quite well (when I
'echo' the strings on the site, I see the text correctly), until the
point that it is send by using mail().

Is this a server configuration issue? Or something else?

How can I get my text to remain in Unicode?

I have this problem both on my testserver (Apache 1.3.28, PHP 4.3.2 on
Windows XP) as on my providers server (Apache under Linux).

View Replies !
Mod_rewrite - Changing Dynamic Urls For Search Indexing
is it worth it? or will search engines other than google soon come around and start indexing past the '?' symbol ?

View Replies !
MS Access Data Stored In Arabic Language
am retriving data from MS Access MDB file ... database ... the probem is the data stored in arabic language, and when i get the result each arabic word appears Code:

View Replies !
Command That Enables To Search Every $data Value For The Text
I have an array assigned to $data (line of text), I'm wishing to search within the array for any lines which match a certain IP, ie 192.168.x.x. What is the command that enables me to search every $data value for the text, and return the results in the form of a new array such as $data_matches.

I'm not fussed about the lines which do not contain the ip's so these can be discarded. 've had a look into some of the preg commands but these seems to return true or false values rather than the whole line the text is contained within.

View Replies !
Indexing Text Files In A Folder
I'm newbie on Php. I cannot write codes but only modify.
I need a code doing this:
I'll put text files in a folder like file1.txt,file2.txt ...
I want to search this files, list most recent 10 and if files

call, script will put into the site design with <pre> tags.

View Replies !
How To Convert Any Text To Unicode?
How can I convert any text to unicode please help me

View Replies !
Insert Arabic In Mysql Problem
I display arabic text using php(V.5) b4 inserting it exactly to mysql(New version) and it displays fine. If i insert the arabic text manually to mysql using PHPMyAdmin then it displays right also. But if i insert it to mysql using PHP then it shows as &#1593;&#1604;&#1610;&#1603;&#1605; I googled a lot and i put all the required stuff as meta tags and choosing the right collation in mysql (UTF8-Unicode) but still shows wrong.

View Replies !
Why Can't Php Write A Unicode Text File?
I can't find any way of writing a unicode, or UTF-8 format text file.
Right now i have a Unicode string that i write to the text file and
the unicode characters are replaced with ANSI question marks '?'.
Please, How do i accomplish this?

I've been searching for a solution for weeks... why has nobody even
asked this question? shouldn't it be a FAQ?

View Replies !
Text Search In MySQL Database
I am wiriting a PHP program that allows users to search item in the MySQL database. The items may have Chinese in their name or desciption. A form is created to allow users to input the search string and then it is transfer to another script to search the MySQL database by GET. I find that some strings can be found but some are not. Is it related to the property of Chinese characters.

View Replies !
Arabic Character Inserting To Mysql Database
i am facing problem incase of inserting and viewing arabic characater to mysql database using php. i changed the table character set to utf8 and also in php.ini default character set is changed to UTF-8. i also used <meta> tag with encoding set utf8 in html file. so can anyone help me to solve this problem ? or what is the procedure for inserting and viewin character to and from mysql database?

View Replies !
Full Text RSS
I am trying to built up an script that will produce Full Text RSS from Partial Feeds/RSS, but I couldn't figure out from where I have to start.

Furthermore I wanted to filter-out certain data like graphics, adsense code, html code etc from the RSS. Code:

View Replies !
Full Text
I'm trying to tweak my search engine a bit and I've discovered a weird lil' glitch. My SCORE variable for every single entry is coming back as a &#391;'. It's not a floating number like the examples are in the MySQL manual. PHP Code:

$query_articles = "SELECT *, MATCH(body, title, subject1, subject2, author) AGAINST ('$searchtopic' IN BOOLEAN MODE) AS score FROM data_array WHERE MATCH (body, title, subject1, subject2, author) AGAINST ('$searchtopic' IN BOOLEAN MODE) AND live_timestamp < $now AND `live` = 1 ORDER BY score DESC";

View Replies !
Inserting And Viewing Arabic Characater To Mysql Database
I am facing problem incase of inserting and viewing arabic characater to mysql database using php. i changed the tabel character set to utf8 and also in php.ini default character set is changed to UTF-8.but i am getting error as ??? while retrieving. so can anyone help to solve this problem?

View Replies !
Identifying Different Unicode/utf-8 Types Inside A Text String
I am dealing with a script that reverses a string that is in hebrew, so I can display it properly when I write that string onto an image, however sometimes the string might be half hebrew half english, so I need a way to identify what language is in the string and only reverse the hebrew parts.

in technical terms the hebrew text is encoded in utf-8, and the english text will be encoded in the normal encoding for english, (anscii, latin-swedish whatever, i dont know the name of that encoding)

so the simple question is how do I identify different types of encoding within a string?
that way I can break up the parts that i identify as being utf-8 and reverse only those

(yes I am well aware of methods to display hebrew properly in php, but when writing to an image this is another story, only method i found so far is reversing the hebew text string)

View Replies !
Mysql Data Search
I have lots of tables on my database and I need to search all the tables and fields for a specific keywords and list out the data with table fields.

Suppose I have 2 tables and following fields as following.

table1
===================
field1      field2      field3
===================
aaa         bbb        ccc
bbb         ccc        aaa
ccc         aaa        bbb


table2
===================
field_a      field_b      field_c
===================
aaa           bbb          ccc
aaa           bbb          ccc
aaa           bbb          ccc

so I need to make a query so that I can list out following if searched for keyword 'aaa' it will list out data like:

from table1
==============
field1: aaa
field2: bbb
field3: ccc

field1: bbb
field2: ccc
field3: aaa

field1: ccc
field2: aaa
field3: bbb

from table2
==============
field_a: aaa
field_b: bbb
field_c: ccc

field_a: aaa
field_b: bbb
field_c: ccc

field_a: aaa
field_b: bbb
field_c: ccc

so can I use a combined query for all the table or have to do it differently. what will be the query??

View Replies !
Search Mysql Data
I have created a mysql data and a login script based in my data Attached is the login php
I would like that when the users enter the web to be able to retrieve their data based on their name.

So I would like a serach php page based on mysql data I am completely begginer in php and mysql so I would like to have the complete code Attached is my login page and my data.

View Replies !
Full Text Query
I have a very simple query in php:

$query = "SELECT *, MATCH(products_name, products_description, products_keywords, products_notes)
AGAINST ('carb') AS score FROM products
WHERE MATCH(products_name, products_description, products_keywords, products_notes)
AGAINST ('carb') ORDER BY score DESC";
$result = mysql_query($query) or die('Error, query failed');

I get "query was empty", but when i put this query in phpmyadmin, it works fine.

View Replies !
Echo RAW Data From Unicode Page?
How can I print raw data (string) from a UTF-8 .php file?

Simple

echo $var

ouputs unicode string to browser (with unicode prefix bytes), but if I
want to ouput BLOB data (jpeg file)?

View Replies !
MySQL Indexing Or Something
There would be messages like msg1 msg2 msg3 msg4 rolling all the time like a scroller. That was the easy part. But when user is typing msg5 and we are example in position msg2 so the msg5 should came between msg2 and msg3. So after user input it should be msg1 msg2 msg5 msg3 msg4. Code:

View Replies !
% Wildcard & FULL-TEXT Searches
With regards to this SQL statement.... It works great for multi-word searches but those searches have to be spelled correctly. I have discovered two FLAWS:

1. It does not allow for partial matches: i.e. 'shane' if the search is spelled 'shan' it will not find it. I cannot figure out how to get the '%' Wildcard into this statement so it will work.

2. It will ony show results for the first column the search word(s) are found in.

For example, I type in 'shane' and I will get all listings for 'shane' only from the 'wname' column. The search query stops at the first column 'wname' in the SQL statement below and ignores that 'shane' is also located in several other columns and records. Code:

View Replies !
Boolean Full Text Searchs
So i've got the basic jist of how the boolean searches for full text myisam databases work, One small gripe that I have a concern with and thats literal string searching. By default when you type in a search, For example the word "QUIT" it literally only finds a word that matches exactly "QUIT". However, I would like to figure out somehow to automatically add wildcard to the end of that to take any result with the word quit in it, Such as "QUITE" or "QUITS" or even "QUITESSON".

View Replies !
Full-text Searching Two Tables
I'm trying to create a full-text search engine for my blog. I read the tutorial, and I grasp the basics of how to search a single table.

However, when a user enters a search term, I want to search both the table of blog posts (vsns_news) and the table of comments (vsns_comments) for the term and treat the results on equal footing.

That is, I don't want to display first the results from blog posts and then the results from comments: they should intermingle in order of decreasing relevancy.

However, I can't for the life of me come up with a query that will search both tables and return a combined result set for them. Is there a way to use just one query?

View Replies !
Full-text And Sort By Score?
how to sort full-text by score. This is the query I'm using right now.

sql = "SELECT product_id, bild, bilden_forestaller FROM products WHERE MATCH (bilden_forestaller) AGAINST ('$fritext')";

I have tried several ways but I can't get it to work. Please tell me how to rewrite my query. I also want to show the score (in percent) for every row I get back from the query.

View Replies !
Indexing Weirdness In MySQL
Before I begin, note that this is a contrived example.

Scenario: I have a table with two fields in it, one varchar field and one integer field. Both fields are indexed. The varchar field often contains just an integer.

Problem: If I search for an integer in the varchar field and don't quote it MySQL refuses to use the index on that field. No such problem occurs the othe way, if I quote the integer when searching agains the integer field. Example:

Code:
# field1 - varchar
# field2 - int

# Uses Index Fine
SELECT * FROM table WHERE field1 = &#391234;'
SELECT * FROM table WHERE field2 = 1234;
SELECT * FROM table WHERE field2 = &#391234;'

# Fails To Use Index
SELECT * FROM table WHERE field1 = 1234;

Any ideas why this is?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved