HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


v7.0.1 Bug - Searching catalogue entries returns all catalogue entries

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#87324 (In Topic #17807)
Avatar

Community saint

When "catalogue entries" is included in content type to search for, the results always include all catalogue entries and not just those matching the search criteria.

Behaves the same in v8-RC7.

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#87349
Avatar

I couldn't reproduce this.

However from past experience, I do know MySQL's full-text search to be rather poor. You can see what queries ocPortal is performing by putting &keep_show_query=1 onto the URL. If it really is not including appropriate SQL clauses, please ping back with more detail.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#87360
Avatar

Community saint

Chris Graham said

I couldn't reproduce this.
Feel free to run any searches you need to on my site.

Searching for "NonExistantWord" in catalogue_entries only generates this URL:
/cms/site/pg/search/results/index.php?content=NonExistantWor
d&author=&days=-1&sort=relevance&direction=DESC&search_catalo
gue_entries=1&keep_show_query=1
Which results in this SQL:

Code (sql)

SELECT
   r.*,
   r.id AS id,
   r.cc_id AS r_cc_id,
   b.cv_value AS b_cv_value,
   MATCH (t0.text_original) AGAINST ('NonExistantWord') AS contextual_relevance
FROM
   ocpo_catalogue_fields f
LEFT JOIN
   ocpo_catalogue_entries r
      ON (
         r.c_name=f.c_name
      )
LEFT JOIN
   ocpo_catalogue_efv_short_trans a
      ON (
         r.id=a.ce_id
         AND f.id=a.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_long_trans b
      ON (
         r.id=b.ce_id
         AND f.id=b.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_long d
      ON (
         r.id=d.ce_id
         AND f.id=d.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_short c
      ON (
         r.id=c.ce_id
         AND f.id=c.cf_id
      )
LEFT JOIN
   ocpo_group_category_access z
      ON (
         z.module_the_name='catalogues_category'
         AND z.category_name=r.cc_id
         AND z.group_id=1
      )
LEFT JOIN
   ocpo_group_category_access p
      ON (
         p.module_the_name='catalogues_catalogue'
         AND p.category_name=r.c_name
         AND p.group_id=1
      )
JOIN
   ocpo_translate t0
      ON t0.id=a.cv_value
      AND t0.LANGUAGE='EN'
WHERE
   MATCH (t0.text_original) AGAINST ('NonExistantWord')
   AND z.category_name IS NOT NULL
   AND p.category_name IS NOT NULL
   AND ce_validated=1
UNION
SELECT
   r.*,
   r.id AS id,
   r.cc_id AS r_cc_id,
   b.cv_value AS b_cv_value,
   MATCH (t1.text_original) AGAINST ('NonExistantWord') AS contextual_relevance
FROM
   ocpo_catalogue_fields f
LEFT JOIN
   ocpo_catalogue_entries r
      ON (
         r.c_name=f.c_name
      )
LEFT JOIN
   ocpo_catalogue_efv_short_trans a
      ON (
         r.id=a.ce_id
         AND f.id=a.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_long_trans b
      ON (
         r.id=b.ce_id
         AND f.id=b.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_long d
      ON (
         r.id=d.ce_id
         AND f.id=d.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_short c
      ON (
         r.id=c.ce_id
         AND f.id=c.cf_id
      )
LEFT JOIN
   ocpo_group_category_access z
      ON (
         z.module_the_name='catalogues_category'
         AND z.category_name=r.cc_id
         AND z.group_id=1
      )
LEFT JOIN
   ocpo_group_category_access p
      ON (
         p.module_the_name='catalogues_catalogue'
         AND p.category_name=r.c_name
         AND p.group_id=1
      )
JOIN
   ocpo_translate t1
      ON t1.id=b.cv_value
      AND t1.LANGUAGE='EN'
WHERE
   MATCH (t1.text_original) AGAINST ('NonExistantWord')
   AND z.category_name IS NOT NULL
   AND p.category_name IS NOT NULL
   AND ce_validated=1
UNION
SELECT
   r.*,
   r.id AS id,
   r.cc_id AS r_cc_id,
   b.cv_value AS b_cv_value,
   MATCH (c.cv_value) AGAINST ('NonExistantWord') AS contextual_relevance
FROM
   ocpo_catalogue_fields f
LEFT JOIN
   ocpo_catalogue_entries r
      ON (
         r.c_name=f.c_name
      )
LEFT JOIN
   ocpo_catalogue_efv_short_trans a
      ON (
         r.id=a.ce_id
         AND f.id=a.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_long_trans b
      ON (
         r.id=b.ce_id
         AND f.id=b.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_long d
      ON (
         r.id=d.ce_id
         AND f.id=d.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_short c
      ON (
         r.id=c.ce_id
         AND f.id=c.cf_id
      )
LEFT JOIN
   ocpo_group_category_access z
      ON (
         z.module_the_name='catalogues_category'
         AND z.category_name=r.cc_id
         AND z.group_id=1
      )
LEFT JOIN
   ocpo_group_category_access p
      ON (
         p.module_the_name='catalogues_catalogue'
         AND p.category_name=r.c_name
         AND p.group_id=1
      )
WHERE
   MATCH (c.cv_value) AGAINST ('NonExistantWord')
   AND z.category_name IS NOT NULL
   AND p.category_name IS NOT NULL
   AND ce_validated=1
UNION
SELECT
   r.*,
   r.id AS id,
   r.cc_id AS r_cc_id,
   b.cv_value AS b_cv_value,
   MATCH (d.cv_value) AGAINST ('NonExistantWord') AS contextual_relevance
FROM
   ocpo_catalogue_fields f
LEFT JOIN
   ocpo_catalogue_entries r
      ON (
         r.c_name=f.c_name
      )
LEFT JOIN
   ocpo_catalogue_efv_short_trans a
      ON (
         r.id=a.ce_id
         AND f.id=a.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_long_trans b
      ON (
         r.id=b.ce_id
         AND f.id=b.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_long d
      ON (
         r.id=d.ce_id
         AND f.id=d.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_short c
      ON (
         r.id=c.ce_id
         AND f.id=c.cf_id
      )
LEFT JOIN
   ocpo_group_category_access z
      ON (
         z.module_the_name='catalogues_category'
         AND z.category_name=r.cc_id
         AND z.group_id=1
      )
LEFT JOIN
   ocpo_group_category_access p
      ON (
         p.module_the_name='catalogues_catalogue'
         AND p.category_name=r.c_name
         AND p.group_id=1
      )
WHERE
   MATCH (d.cv_value) AGAINST ('NonExistantWord')
   AND z.category_name IS NOT NULL
   AND p.category_name IS NOT NULL
   AND ce_validated=1
GROUP BY
   r.id
ORDER BY
   contextual_relevance DESC
 
Which returns every catalogue entry that the member has permission to access.

A couple of other thing I have also observed.

Issue #2 - Use of "keep_show_query=1" should be an admin-only feature.

Issue #3 - If I want to refine the search by going to the setting section, the default items (forum, images, etc.) are checked even though I have limited it to Catalogue entries. I shouldn't have to re-select my categories every time I want to refine my search.




Last edit: by temp1024

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#87362
Avatar

Definitely reproducable on your site, but I can't explain it. I wonder if there is some MySQL setting involved, or a corrupt index. The SQL generated by the search system is pretty complex, but tolerable if you look at it in parts. Split it up around 'UNION' and you have independent queries you can understand and test in phpMyAdmin, e.g…

Code


SELECT
   r.*,
   r.id AS id,
   r.cc_id AS r_cc_id,
   b.cv_value AS b_cv_value,
   MATCH (t0.text_original) AGAINST ('NonExistantWord') AS contextual_relevance
FROM
   ocpo_catalogue_fields f
LEFT JOIN
   ocpo_catalogue_entries r
      ON (
         r.c_name=f.c_name
      )
LEFT JOIN
   ocpo_catalogue_efv_short_trans a
      ON (
         r.id=a.ce_id
         AND f.id=a.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_long_trans b
      ON (
         r.id=b.ce_id
         AND f.id=b.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_long d
      ON (
         r.id=d.ce_id
         AND f.id=d.cf_id
      )
LEFT JOIN
   ocpo_catalogue_efv_short c
      ON (
         r.id=c.ce_id
         AND f.id=c.cf_id
      )
LEFT JOIN
   ocpo_group_category_access z
      ON (
         z.module_the_name='catalogues_category'
         AND z.category_name=r.cc_id
         AND z.group_id=1
      )
LEFT JOIN
   ocpo_group_category_access p
      ON (
         p.module_the_name='catalogues_catalogue'
         AND p.category_name=r.c_name
         AND p.group_id=1
      )
JOIN
   ocpo_translate t0
      ON t0.id=a.cv_value
      AND t0.language='EN'
WHERE
   MATCH (t0.text_original) AGAINST ('NonExistantWord')
   AND z.category_name IS NOT NULL
   AND p.category_name IS NOT NULL
   AND ce_validated=1

Studying that SQL (and the SQL for the others too) there's no reason I can see that should return anything. It hinges on MATCH (t0.text_original) AGAINST ('NonExistantWord') passing, regardless of join type that has got to hold true for any row that comes through.

So I wonder if there are MySQL threshold settings, or settings on what to do for unindexed words, or something to do with the stop word list or the minimum/maximum word sizes.

At any rate, messing about in phpMyAdmin may give clues. Try simplifying down the query and seeing if maybe you find a bug in your MySQL version that affects complex queries. Try replacing the "MATCH" clause with a simple "LIKE" clause to isolate the problem to the MySQL full-text subsystem.

Issue #2 - Use of "keep_show_query=1" should be an admin-only feature.

I know people are a bit nervous about the idea of people probing their sites, but I don't see a security issue. The query structure is already Open Source, and there's nothing privileged embedded in these queries – it is essentially just an API call, similar to the kind of stuff AJAX might do (okay, totally different language, but you see what I mean).

I'm open to being convinced of course ;).

Issue #3 - If I want to refine the search by going to the setting section, the default items (forum, images, etc.) are checked even though I have limited it to Catalogue entries. I shouldn't have to re-select my categories every time I want to refine my search.

Looking at this now.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#87363
Avatar

Issue #3 - If I want to refine the search by going to the setting section, the default items (forum, images, etc.) are checked even though I have limited it to Catalogue entries. I shouldn't have to re-select my categories every time I want to refine my search.

I believe we fixed this in a newer version at some point. The change would have been in site/pages/modules/search.php.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#87369
Avatar

Community saint

Chris Graham said

The SQL generated by the search system is pretty complex,
No arguments there O_o . I took one look at that 3,890 byte query and my eyes instantly glazed over, and it only started to become comprehensible after I put it through a formatter.

Chris Graham said

At any rate, messing about in phpMyAdmin may give clues. Try simplifying down the query and seeing if maybe you find a bug in your MySQL version that affects complex queries. Try replacing the "MATCH" clause with a simple "LIKE" clause to isolate the problem to the MySQL full-text subsystem.
I'll have a play with it.

Chris Graham said

Issue #2 - Use of "keep_show_query=1" should be an admin-only feature.

I know people are a bit nervous about the idea of people probing their sites, but I don't see a security issue. The query structure is already Open Source, and there's nothing privileged embedded in these queries…
While I agree that this specific situation isn't a security issue, it goes against the general security practices where internal database operations are supposed to be kept internal because there may be an inadvertent leak of some kind. What may be fine today, may potentially leak in the future if a the query is changed.

Chris Graham said

it is essentially just an API call, similar to the kind of stuff AJAX might do
AJAX is a very bad example as it should not be creating direct SQL queries on the client side. All client side DB access must be abstracted to prevent direct access to the DB.

Chris Graham said

Issue #3 - If I want to refine the search by going to the setting section, the default items (forum, images, etc.) are checked even though I have limited it to Catalogue entries. I shouldn't have to re-select my categories every time I want to refine my search.

I believe we fixed this in a newer version at some point. The change would have been in site/pages/modules/search.php.
OK, thanks!

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#87371
Avatar

AJAX is a very bad example as it should not be creating direct SQL queries on the client side. All client side DB access must be abstracted to prevent direct access to the DB.

Sure, I was just saying it as an example of an internal communication path that is accessible by the public if they know where to look.

I do take your point, but I also don't want to fiddle with the code unnecessarily. In particular I want the parameter to be available to admins using SU, because queries may be different for different usergroups. It's almost a trivial change to do the admin check with a SU provision, but if I do 10 trivial changes I'll probably create 1 bug, so I prefer to be cautious nowadays. It is now on the tracker: 0000636: Consider making keep_show_query admin-only - ocPortal feature tracker
If we are changing the search system, we'd see that issue on the tracker too, for the unlikely event that somehow the queries did start to leak important data.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Item has a rating of 5 (Liked by Chris Graham)  
Rating:
#87383
Avatar

Community saint

I think I may have isolated the problem, which is that the ocpo_catalogue_efv_long table is empty (even after being repaired) and instead of treating that as a failed match its matching it.

So its failing at

Code

MATCH (d.cv_value) AGAINST ('NonExistantWord') AS contextual_relevance
where d is the alias of ocpo_catalogue_efv_long.

I tested this by using c.cv_value (ocpo_catalogue_efv_short) instead and that returned an empty set for 'NonExistantWord' as expected, and only the relevant records when I used a valid word such as 'burner'.

How do I rebuild ocpo_catalogue_efv_long ?

Chris Graham said

I do take your point, but I also don't want to fiddle with the code unnecessarily. In particular I want the parameter to be available to admins using SU, because queries may be different for different usergroups.
That's fair enough, you have to prioritise your time and it hardly a show-stopper issue.



Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#87385
Avatar

which is that the ocpo_catalogue_efv_long table is empty

So your table is literally empty, and MySQL is returning true when MATCHES's are run against an empty table, and hence the catalogue entry rows get through due to the joins?

Lol, thanks MySQL ;).

These efv_* tables are where the catalogue entry data is stored. 'efv' means "entry field value". You can see the data is put in 1 of 4 tables, depending on what the type of field it is.

So as a test, if you put a nonsense row in the efv_long table, it 'fixes' the problem?


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#87386
Avatar

Actually, I think this may be my fault afterall :lol:.

I suspect MySQL may be using the mathematically-accurate definition of NULL (different databases use this inconsistently in different capacities). As there is no field using 'long' data, it has to join in NULL's for that table. Probably MySQL is running the match against NULL and considers that a match, with a match accuracy itself of NULL. i.e. it doesn't know if an unknown value matches so it lets through a match with an unknown accuracy. Of course, our original NULL was an entirely different definition of NULL – a "no value" one, but SQL only defines one type so it can get confused  :lol:.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#87387
Avatar

Try altering sources/database/shared/mysql.php with this subbed function…

Code


   function db_full_text_assemble($content,$boolean)
   {
      if (!$boolean)
      {
         $content=str_replace('"','',$content);
         if ((strtoupper($content)==$content) && (!is_numeric($content)))
         {
            return 'MATCH (?) AGAINST (_latin1\''.$this->db_escape_string($content).'\' COLLATE latin1_general_cs) AND (?) IS NOT NULL';
         }
         return 'MATCH (?) AGAINST (\''.$this->db_escape_string($content).'\') AND (?) IS NOT NULL';
      }

      return 'MATCH (?) AGAINST (\''.$this->db_escape_string($content).'\' IN BOOLEAN MODE) AND (?) IS NOT NULL';
   }

I am a bit worried this could impact performance (messing with the WHERE clause for primary indexes can sometimes make MySQL not realise it can use an index), and not 100% it will work, so I will let you test first ;).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#87389
Avatar

Community saint

Chris Graham said

So as a test, if you put a nonsense row in the efv_long table, it 'fixes' the problem?
Lets see….YEP!

'Fix' applied, and you can try it yourself Chris!

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#87390
Avatar

My question now is, if you remove that test row, does my code fix still fix it? If so I'll formalise it.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#87391
Avatar

Community saint

Chris Graham said

not 100% it will work, so I will let you test first ;).
And it didn't. Although the results seem to be correct it is accompanied by:

Code

Unfortunately a query has failed [SELECT s_primary,COUNT(*) as cnt,MAX(s_num_results) AS s_num_results FROM ocpo_searches_logged WHERE MATCH (s_primary) AGAINST ('burner') AND (?) IS NOT NULL AND s_primary NOT LIKE '%<%' AND s_primary<>'' GROUP BY s_primary ORDER BY cnt DESC LIMIT 20] [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?) IS NOT NULL AND s_primary NOT LIKE '%
Note that I am running this code on a clone site, and the dummy record method on my live site.

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#87392
Avatar

Taking a look (on my machine) now.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#87394
Avatar

temp1024 said

Chris Graham said

not 100% it will work, so I will let you test first ;).
And it didn't. Although the results seem to be correct it is accompanied by:

Code

Unfortunately a query has failed [SELECT s_primary,COUNT(*) as cnt,MAX(s_num_results) AS s_num_results FROM ocpo_searches_logged WHERE MATCH (s_primary) AGAINST ('burner') AND (?) IS NOT NULL AND s_primary NOT LIKE '%<%' AND s_primary<>'' GROUP BY s_primary ORDER BY cnt DESC LIMIT 20] [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?) IS NOT NULL AND s_primary NOT LIKE '%
Note that I am running this code on a clone site, and the dummy record method on my live site.
So to be clear, the search worked, but another error maybe happened in an error mail, or somewhere else, but not on the page itself?

Because opensearch and search-autocompletion were broken by the change, but I'm surprised you noticed…

https://github.com/chrisgraham/ocPortal/commit/c3e4875813856914ad48703eb51582e211b885a4

https://github.com/chrisgraham/ocPortal/commit/65586e874aae8e34582ec32d6502cd8fc7968a7b


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#87396
Avatar

Community saint

Chris Graham said

So to be clear, the search worked, but another error maybe happened in an error mail, or somewhere else, but not on the page itself?
Correct. Error message was in email.


Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#87397
Avatar

Community saint

Chris Graham said

Applied changes and now search works without errors.


Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Item has a rating of 5 (Liked by Fletch)  
Rating:
#87399
Avatar

Thanks for helping debug and testing.

For information of others - you'll find a hotfix in the bugs list if you need it.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Item has a rating of 5 (Liked by Fletch)  
Rating:
#87400
Avatar

Community saint

Chris Graham said

Thanks for helping debug and testing.
 :thumbs:


Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: