semiColon Posted November 6, 2007 Share Posted November 6, 2007 Hello every one.How could I include any web page a search engine that just searches in that page? Anybody know something about : full-text search? what is it? how can i use it? and why?Thanks a lot. Link to comment Share on other sites More sharing options...
Jesdisciple Posted November 6, 2007 Share Posted November 6, 2007 I think that would have to be JavaScript. My implementation would be to find all text nodes in the DOM and do indexOf() for each of them; then (I imagine) you could highlight the ones you found.Why isn't Ctrl+F good enough? Link to comment Share on other sites More sharing options...
justsomeguy Posted November 6, 2007 Share Posted November 6, 2007 Full-text search is something you use to search in a database column that has a data type of "text". Link to comment Share on other sites More sharing options...
Reg Edit Posted November 6, 2007 Share Posted November 6, 2007 Full-text search is something you use to search in a database column that has a data type of "text".Or a data type of XML. (info) Link to comment Share on other sites More sharing options...
justsomeguy Posted November 6, 2007 Share Posted November 6, 2007 I didn't even know that Microsoft added an XML data type to SQL Server. What's the difference between xml and text? Link to comment Share on other sites More sharing options...
Reg Edit Posted November 6, 2007 Share Posted November 6, 2007 I didn't even know that Microsoft added an XML data type to SQL Server. What's the difference between xml and text?For instance, a stored procedure can include XQuery stuff that addresses elements within the XML field, without retrieving the record. Link to comment Share on other sites More sharing options...
semiColon Posted November 6, 2007 Author Share Posted November 6, 2007 Thanks a lot...chris, i have to use a PHP.. it's 4 an exam (:..justsomeguy,thanks, i'm know reading about it (:..Reg Edit,thanks for that (:i have to do it only with: PHP, xhtml, MySQL....Do you see the box search in the bottom of this topic? this is what i mean (:.. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 6, 2007 Share Posted November 6, 2007 Do you see the box search in the bottom of this topic? this is what i mean (:Apparently it doesn't work very well.You searched for: PHPUnfortunately your search didn't return any results. Link to comment Share on other sites More sharing options...
Reg Edit Posted November 6, 2007 Share Posted November 6, 2007 Do you see the box search in the bottom of this topic? this is what i mean (:If you want a search box on a web page, you will probably place it in an html form, and when that form is submitted, it will submit the form contents. (See the w3schools stuff on html forms).The page that receives the form submission (a PHP page in your case) will be a search results page, but it will contain some server-side script that executes a MySQL database query. You will have to design that query from your knowledge of what data is being searched and what results are to be returned. You say the "current page" is to be searched; therefore your query needs to search the database by reference to the data that was used to display that page. So the form fields you submit will probably need to include some context information about that (which will probably be hidden fields).The PHP page will take the results of the database query and format these results into html for the browser to display the search results page. Link to comment Share on other sites More sharing options...
semiColon Posted November 10, 2007 Author Share Posted November 10, 2007 Is it okay if use this stmt:SELECT * FROM articles WHERE body LIKE '%$keyword%'; is it okay to use that syntax?i know that it's slow and inefficient, but i couldn't understand the: Full-text search until now. I have to understand this method these two days.. Link to comment Share on other sites More sharing options...
eko_wardoyo Posted November 13, 2007 Share Posted November 13, 2007 for full text search you can use this syntax:SELECT * FROM articles WHERE body='$keyword'; Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted November 13, 2007 Share Posted November 13, 2007 Just do java script:do.Search()Dunno if that searches in page Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.