Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > Database
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases.

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 06-10-2007, 12:26 AM   #1
Roland Tanner
 
Roland Tanner's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default FULLTEXT search - getting part of a line

Hi,

Not really sure if this is possible.

I am using a fulltext search to search through very large entries. Basically
an entry might contain 200,000 words, which are searched for exact matches.

What I want to do is SELECT, say, the 300 words surrounding the exact match
from the 200,000 word entry and pass it to a PHP script, rather than
passing the entire 200,000 words to the script.

Am I explaining myself clearly? In other words I want to limit the amount of
text SELECTed, so that I am not wasting memory, etc, by passing huge
strings to PHP.

Is it possible? I've done a lot of looking, but the MySQL documentation is
pretty limited on fulltext. If it is possible, can anyone give me a rough
idea of how to go about it?

Many thanks

BMA


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 06-10-2007, 12:26 AM   #2
Sean
 
Sean's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default FULLTEXT search - getting part of a line


"Roland Tanner" <roland@tannerritchie.com> wrote in message
news:0NE9h.14897$tP.10831@read2.cgocable.net...
> Hi,
>
> Not really sure if this is possible.
>
> I am using a fulltext search to search through very large entries.
> Basically
> an entry might contain 200,000 words, which are searched for exact
> matches.
>
> What I want to do is SELECT, say, the 300 words surrounding the exact
> match
> from the 200,000 word entry and pass it to a PHP script, rather than
> passing the entire 200,000 words to the script.
>
> Am I explaining myself clearly? In other words I want to limit the amount
> of
> text SELECTed, so that I am not wasting memory, etc, by passing huge
> strings to PHP.
>
> Is it possible? I've done a lot of looking, but the MySQL documentation is
> pretty limited on fulltext. If it is possible, can anyone give me a rough
> idea of how to go about it?
>
> Many thanks
>
> BMA
>
>



[in my examples, I have a simple table (Called DAYS) with 7 rows, stating
"It is Monday", etc.,]

You can establish the position (start point) of a match with
SELECT instr(day_name, 'day') from days

Span some text so that I get two characters before the start and extend to a
total of four in length
SELECT substring(day_name, instr(day_name, 'day') - 2, 4) from days

That "could" get you started, but I immediately two areas of concern:

1: In my example; if the field was "Day is Monday" then we have two matching
instances for 'day' and my example would only return information for the
first instance.

2: In my example; if the fields was "Day is Monday" then it's no possile to
obtain the characters before 'day', as there aren't any. In VB I would get
round this by padding the whole data with more than enough spaces, that are
trimmed. If I wanted 100 characters each side...

trim(substring(space(110) & day_name & space(110), instr(day_name,
'day') - 100, 200))

[the above line is written in MySQL style, but is based on my VB knowledge
and is untested in MySQL]

Hope that gets you started in the right direction....

Sean



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags: , , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fulltext search "LIKE" operator Morten Database 0 06-10-2007 12:22 AM


Featured Websites




All times are GMT +1. The time now is 4:38 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98