1 (edited by 2012-11-23 14:47:38)

Topic: search problem

why, inserting criterias in the TITLE and AUTHOR fields, it show also news that don't have that criteria in their TITLE or in the name of their AUTHOR?
It seems that they work like inserting criterias in the NEWS field, because it search posts have that criteria also in the text of the story...

Re: search problem

why, inserting criterias in the TITLE and AUTHOR fields, it show also news that don't have that criteria in their TITLE or in the name of their AUTHOR?
It seems that they work like inserting criterias in the NEWS field, because it search posts have that criteria also in the text of the story...


Dear User!

Please would you attach some screenshots with examples of these issues to this topic?

Best regards,
CN Support team

3 (edited by 2012-11-28 14:19:57)

Re: search problem

I start by saying that I migrated from cutenews 1.4.7 to Cutenews 1.5. As you can see above, inserting in Title field the word "studenti", search script doesn't show only the news which title contain the word "studenti", but it shows other news that haven't that word in their title.

http://marnevi.altervista.org/screen.JPG

Furthermore, if I insert, in Author field, an author's name that doesn't exist, like the name "stato", search script shows a lot of news, rather than to show nothing. Look above:

http://marnevi.altervista.org/screen2.JPG

You can try here http://www.pasqualemarinelli.com/b/example2.php

How to fix?

Re: search problem

Dear User!

Please find some changes in the code made by our programmers at https://github.com/CuteNews/cute-news-r … fd0bf65df1

Please also download the latest CuteNews build at https://github.com/CuteNews/cute-news-repo/downloads

We hope that this will help to resolve your problem.

Best regards,
CN Support team

5 (edited by 2012-12-01 10:24:23)

Re: search problem

I downloaded it!
It works better. But I noted that if I insert the word "studenti" (letter "s" little) in Title field, search script doasn't show nothing:

http://marnevi.altervista.org/screen3.JPG

If I insert the word "Studenti" (letter "S" capital) in Title field, search script finds news correctly:

http://marnevi.altervista.org/screen4.JPG

It's the same about Author Field. You can try here http://www.pasqualemarinelli.com/b/example2.php

Can you fix this issue, removing this difference?

Re: search problem

Any reply?

Re: search problem

Support_Team, I'm waiting for a your reply....

Re: search problem

Most people would want the search to be case dependent (I do)  so in order to give a choice the script would need to be re-written with this as an option.
However you can change your copy of search.php at your own risk.
find:

 // Actual search result?
                    if (preg_match("/$preg_author/", $item[1]) == 0 ||
                        preg_match("/$preg_title/", $item[2]) == 0 ||
                        preg_match("/$preg_story/", $item[3]) == 0)
                        continue;

Replace with:

// Actual search result?
                    if (preg_match("/$preg_author/i", $item[1]) == 0 ||
                        preg_match("/$preg_title/i", $item[2]) == 0 ||
                        preg_match("/$preg_story/i", $item[3]) == 0)
                        continue;

See if that works.

Re: search problem

it works better in this way:

// Actual search result?
                    if (preg_match("~$preg_author~i", $item[1]) == 0 ||
                        preg_match("/$preg_title/i", $item[2]) == 0 ||
                        preg_match("/$preg_story/i", $item[3]) == 0)
                        continue;

Thank you very much!!!