close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problem with "advance text search"

Thread began 2/11/2020 8:24 am by Rokon | Last modified 2/15/2020 8:38 am by Ray Borduin | 124 views | 11 replies |

Rokon

Problem with "advance text search"

Dear Ray

I am having a problem with the "advance text search". I found that the result are not what it suppose to be. Example when I am searching with the word like "asked about donkeys" then it is only bringing with the result of "asked" and not searching the other two words i/e "about donkeys". While if I do exact search then it is bringing the result without any problem.

it suppose to search for all the input text and then bring the result base on best match, like if I search with "asked donkeys" then it suppose to bring the result of "asked about donkeys" too in the first place.

Pls help!

Sign in to reply to this post

Ray BorduinWebAssist

How do you want it to work? The interface allows you to define whether to use a space as an AND or an OR or require the full string. You can also do an "includes" search. I think you want "includes" and you want the space to be an "AND" So it can do:

WHERE column LIKE '%asked%' AND column LIKE '%about%' AND column LIKE '%donkeys%'
but you could have it do:
WHERE column LIKE '%asked%' OR column LIKE '%about%' OR column LIKE '%donkeys%'
or you could have it do:
WHERE column LIKE '%asked about donkeys%'

It all depends on how you want the search to work. If you tell me which is the one you want and attach the page you are working on, then I can show you how to adjust the code.

Sign in to reply to this post
Did this help? Tips are appreciated...

Rokon

Hello

I have tested the search page and when I am running it in my local PC then I am getting results but after I upload to the server it does not get any result. I am sending herewith the ftp access to the site in private.

You can check the search.php page

Sign in to reply to this post

Ray BorduinWebAssist

I've seen this once before... for some reason prepared statements aren't working on this server.

I've fixed the problem by turning off prepared statements in your rsobj.php file on line 25. That seems to have fixed the page.

I'm not sure what would cause this, but it shouldn't cause any other problems, so just update that line on your local file and you should be good to go.

Sign in to reply to this post
Did this help? Tips are appreciated...

Rokon

Originally Said By: Ray Borduin
  I've seen this once before... for some reason prepared statements aren't working on this server.

I've fixed the problem by turning off prepared statements in your rsobj.php file on line 25. That seems to have fixed the page.

I'm not sure what would cause this, but it shouldn't cause any other problems, so just update that line on your local file and you should be good to go.  




Hi Ray

Thanks for your support. I am sorry that I think still there is some more problem exist. I made some change on the local search page and tested that on the local server and it is working fine and what result I am expecting it is pretty much near my expectation.

While I upload the same file to the server then it is showing that "There is an error in your SQL syntax." but the same page is working fine with my local PC.

The new search page is search.hadithbd.com/index.php

** Note that I still didn't modify the rsobj.php in my local PC.

Sign in to reply to this post

Ray BorduinWebAssist

There was an issue with doing comparisons on both numeric and text columns with the same field when a non-numeric value was entered. I updated the rsobj.php version to 2.35 to fix that issue.

Please download the live version to your localhost to make sure it doesn't get accidentally overwritten, but the issue should be resolved now.

Sign in to reply to this post
Did this help? Tips are appreciated...

Rokon

Originally Said By: Ray Borduin
  There was an issue with doing comparisons on both numeric and text columns with the same field when a non-numeric value was entered. I updated the rsobj.php version to 2.35 to fix that issue.

Please download the live version to your localhost to make sure it doesn't get accidentally overwritten, but the issue should be resolved now.  




Thanks Ray, It's working fine now!

Sign in to reply to this post

Rokon

Dear Ray

It seems that when I am trying to create a separate page for exact match then it is showing another kind of problem.
I was trying to do an "exact search" on the server which page name is http://search.hadithbd.com/exact-search.php and now it shows memory error like below.

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /home1/x0g1kgnj/search.hadithbd.com/webassist/mysqli/rsobj.php on line 198

Sign in to reply to this post

Ray BorduinWebAssist

Your database has 84,184 rows and your recordset is set up to return all rows on this page. You would probably want to add pagination and a maximum number of rows to allow this page to load in a reasonable time without using too much memory.

One thing you can do is add a default where clause so that the database doesn't return any rows before filtering with the search field. This is done by adding 0=1 to the default search clause in the Database Search server behavior.

Another thing that might make sense is to set a maximum number of rows to display on the page and add pagination. Maybe show 20, 50 or even 100 rows on one page with next and previous page links.

For now I've just added the default where clause to the page to allow it to load and that might be enough for this page.

Sign in to reply to this post
Did this help? Tips are appreciated...

Rokon

Originally Said By: Ray Borduin
  Your database has 84,184 rows and your recordset is set up to return all rows on this page. You would probably want to add pagination and a maximum number of rows to allow this page to load in a reasonable time without using too much memory.

One thing you can do is add a default where clause so that the database doesn't return any rows before filtering with the search field. This is done by adding 0=1 to the default search clause in the Database Search server behavior.

Another thing that might make sense is to set a maximum number of rows to display on the page and add pagination. Maybe show 20, 50 or even 100 rows on one page with next and previous page links.

For now I've just added the default where clause to the page to allow it to load and that might be enough for this page.  



Well noted and thanks for the information, I followed and works fine. Meanwhile I could not figure out one matter and I need your guide here because I am very much new with your tools.

What I am trying to do is:

Only one search input filed should work for partial match and exact match. For exact match I want to put a check box so that when the checkbox is checked it should perform exact match and if the checkbox is not checked then it should perform a general partial match search.

Pls help me to figure it out, Thanks a lot for your great support!

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...