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 Complete Forum Thread with Replies
Related Forum Messages:
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 !
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 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 !
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 !
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 !
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 !
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 !
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 Ƈ'. 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 !
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 !
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 !
% 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 !
Full Text Searching MSWord Files
I have a project that require to full text search some user uploaded documents on a Linux PHP based server. I basically need to open the word (.doc) files and full text search them, than simply allow the user to retrieve them. I know on win based servers you can use the COM module to read word file, my question is if anyone has figured out how to do the same on Linux. Code:
View Replies !
Creating Temporary Table From Full-text Query
i'm using a full-text search on my db which works fine, but now i'm working on filtering the results further, like products in range of prices. my logic is to simply SELECT them out of the temporary table, only if it would be created. i don't think i need to paste any code since i think you get the idea.
View Replies !
Displaying Full URL Address From Mysql DB
Hi all I am having a problem, displaying a field form my mysql db. the field is a text varchar(80) containing url's (web addresses more importantly). the issue is, when a user enters into the db an address without the 'http' suffix on the start of the url, I try to display it.. but obviously the browser then renders it as a file to the root directory when actually its an entire new url. Did I explain that good enough?
View Replies !
Full Stops In Mysql Queries
I am using Mysql to search for domains in a database. For example: PHP Code: SELECT COUNT(*) FROM domains WHERE domain = 'phpbuilder.com' The problem is that the query will always return 0 whatever domain I input (that is present in the database). Unfortunately I built some more complicated parts of this script before testing the query itself so it took me a little while to figure out the problem was because of the full stop. If I remove the full stop in the database and use domaincom in the SQL query then the query works fine.
View Replies !
Showing Full 2d Array On Screen From MySQL
I have successfully created a MySQL database, and inserted a table "65chain" into it. The table has 10 columns, including the primary key column Drop_1, and 6 rows. The Drop_1 column is indexed at 600, 800, 1000, 1200, 1400, and 1600. The table is representative of a series which will have varying numbers of rows and columns. In phpMyAdmin, I see the 2d array I would like to see eventually on my web page, when I select the SQL tab and enter SELECT * FROM `65chain` WHERE Drop_1 is not null Great. I am now creating my script. So far I have:
View Replies !
Full HTML Pages In MySQL Page?
I'm working on a small script to put full html pages in a database and then retreive the data to show on the page. The problem is that VARCHAR can only go up to 255 characters I believe. I also tried TEXT, but then I get a few columns like 'Field','Type','Function','Null' and 'Value'. I don't know what to do with the other columns. I also can't seem to be able to put data in the table with a script. Can anyone tell me what the best way is to do this and how to insert data into it with PHP? And are there any problems when I try to display it on the page (I read somewhere that special characters are being left out sometimes).
View Replies !
Adding Text To A Search Box By Clicking On The Text
I'm trying to create a series of hyperlinked strings such that when the user clicks on the hyperlinked string, the text automatically goes into a search box and all the user has to do is to press a button to execute the search. I am expecting this to be easy, but I have no idea how to link the two parts up. My expection is that this involves making the search box dynamic. But of all the tutorials I've read, you can create an initial value for the statement within the search box by simply using the "value" command, but I've not seen a way to manipulate that value statement on the go.
View Replies !
String Search - Search A String Of Text & Return A TRUE Value.
I'm trying to do something pretty simple but I'm stuck on what function I need to use. Basically, I have a script where you can type a message and submit it. But I don't want people to use bad words, so if they do, it displays an error message. Example: $string = "Fudge off!" Let's say I don't like the word "fudge" if ( stringcontains('fudge', $string) { echo "No cussing!" } else { Post the string } Does that make sense? I'm basically trying to find some kind of search that will search a string of text looking for the word "fudge" and if it finds it, return a TRUE value. Does such a function exist?
View Replies !
Search Function - Search In MySql Databases., How To?
How do I set up a page where the visitors can search through a mysql database? It's linxcafe.net Im talking about. I want the visitors to be able to seach among all my links (both categories and links) so they find what they are looking for easier. I have searched on google after tutorials on this but I have only found complicated ones.
View Replies !
Smart Text Search - How To ?
I've got a list of names in a mysql table: example: Mike John Peter .... (100,000) entries How do I perform a search in this table, so that it is tolerant to mild spelling errors ? Am I looking for a phoenetic search algo ? Or is there a simpler algorithm to do this ? Or perhaps a PHP library for this ? For example if someone searched for "Jon", he should find "John" from the table.
View Replies !
Search A Text For Linebreaks
Got some text that contain url`s. Whenever there is an occurence of the string "http://" its going to read what comes after it - until next whitespace and make a link of it. But theres a problem when the link is at the end of a sentence, then it doesn`t treat the linebreak as a whitespace and the first word on the next line is treated as a part of the link. Is there any way I can search for linebreaks in a text/string?
View Replies !
Text Search Question
I'm working on a new project with php & mysql. I anticipate that one of the tables may grow above 40 GB in a short time. The main content is text. Now what tools do I need to implement a text search in this big text database ? I'd like the search to be quite advanced, supporting boolean operations and metaphones and so on. What should I be surveying now ?
View Replies !
Search A Text File
I have a text file that each line is an array, I think. I looks like this name | id | # | # | # | total name | id | # | # | # | total and so on... I would like to seach the file by "id" and only display the line with the particular "id". I also think that the bit size of each line will change from line to line, so I don't think that I can put in a static number to search to the end of. I thought about using fseek(), is that the best way to go.
View Replies !
Search A String Of Text...
I would like to search a string of text for "x" if "x" is found then it echo's something, else it echo's something else... Anyways I'm kind of lost as to the best way to search a string of text (for example "1,2,3,4,5,6,7,8,9,10,11,12") and find lets say "7,"...
View Replies !
Search Through A String For Various Text
My users enter text into a database field in the form of: this file {link:afile.pdf} is big and this file {link:another.doc} is small. I have no idea how many times they may enter {link:xxx} into a given field. The code we worked out (see other post below) fabulously translates the text into a hyperlink. The problem is that no matter how often the {link:xxx} is in a given field, I only ever get the first file returned; i.e: This file afile.pdf is big and this file afile.pdf is small. But what I should get is, obviously: This file afile.pdf is big and this file another.doc is small. I need to use some kind of looping function, or a foreach type function. Does anyone have any clues? Code:
View Replies !
How To Search Text In A PDF File?
Does anyone know how to search a PDF document for a specific word? I have found a class file which can do search in a PDF file but some times it wont return the correct results. I have attch the files so if anyone like to modify that class file and make it work please go ahead. Actually this class is not written by me but the author is giving the full rights to anyone who like to modify his class. Well actually I need ur guys comments on the below matter, I really appreciate if everyone can post their comment on this. I have to do a search module, where ppl can search for PDF files by giving search key words. Well to do this i have two options, 1. when admin upload the PDF file, ask him to enter keywords related to the PDF file contents and store it in a table so when ever a client search for a PDF i can search that table and display the results. *The fastast option that i can think of but because it dont search the file contents the search is not 100% accurate. 2. Read the PDF files individually and search the keyword in that file contents and display the results. *Still couldn`t find a stable PDF file search but Im sure it can be done. *I have more that 200+ PDF files, so is it gonner be slow if i use this option? *What will happen many uses open the same file at same time? will the file crash?
View Replies !
Search A .txt File For A Particular Text
How can I search a .txt file for a particular text? Or search a php page for a particular text? Is that possible? It's database related at all, its' all based off text. can it be done? if so anyone have an example or the command to use?
View Replies !
Search For Text In A Database
A user writes this sentence: "It was the New Urbanist's nightmare of sprawl run amok." They input that and my PHP script hits it with addslashes() and then the sentence gets put in the database. A slash is likely inserted in front of the quote mark in "Urbanist's". Later the user runs a search of the database for "New Urbanist's nightmare". Even if I run this query using LIKE, nothing will come back? Should I hit the text with addslashes before I run the search? How do most coders handle this?
View Replies !
Quickly Adding Text To A Mysql Text Field That Is NOT Empty
Is there a way to insert text into a mysql text field that already has text into it; without having first to extract the existing data and append the new text to that string variable and then insert the new string. Basically i'm looking for a way to do it with a single query not 2 (one being a select to gather existing data).
View Replies !
Search And Replace In Text File
I have a text file with 30 or so lines. Each line has this format: sometext somevalue. They are separated by a single space. I want to search in the file for "sometext" and replace "somevalue" with a particular string.
View Replies !
Eregi Search And Replace For Some Text
I'm trying to do a search and replace for some text. For example, I have a word that is 'history', I want to replace every occurence of 'history' with: <a href="history.html">history</a> Now, that's easy, I can do that - however, as 'history' could also be 'History', I want to ensure that the format of 'history' stays the same. For example: $strRep = 'history' $str = eregi_replace($strRep, '<a href="history.html">'.$strRep.'</a>, $my_other_string); That's fine - however if history is capitalised (History), then I have a problem: $str = eregi_replace($strRep, '<a href="history.html">'.$strRep.'</a>, $my_other_string); because the above example would lowercase History to history.
View Replies !
Search For Words Within The Text Of The PDF Files.
I have an online library of PDF files. Each PDF is roughly 500 pages. We would like to be able to search for words within the text of the PDF files. The PDF files will be searched across author, publication year, etc. Does anyone have any good tips/examples of how I might attempt to accomplish this? I had thought about using pdftotext to convert each pdf to a text file and then using grep to pull the words, but I think there is probably a better way of doing it.
View Replies !
Search String In Text File
i need to search strings in text file. the string to be searched are in an array: string = array(?',?', '...............'); so how can i read the text file n for each line, find those string in the array?
View Replies !
Writing Text Search Function
i get "Parse error: parse error in /home/houseproudlancs_co_uk/search.php on line 65" when i open the page, line 65 would be the line that starts with if (textsearch $search_for = "is"; $the_items_description = "this is where the description would go"; if (textsearch($item_category) == true { echo ("correct"); } else { echo ("incorrect"); } function textsearch($the_items_description) { $pos = strpos($the_items_description, $search_for);
View Replies !
|