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.


Erratic highlighting of Search-keywords

Login / Search

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

Well-settled

Greetings!

I just now set the .comcode_highlight rule in my theme's global.css to colour-highlight keywords/phrases in returned Search results. It works - but decidedly erratically. For certain Comcode-generated pages, typically   some, but rarely all, instances of my keywords get highlighted, while for others there'll be none at all (not even the page title). Using alternative, more advanced, search-options makes no difference. I'm presuming the explanation for this is that the highlighting will only occur conditionally (requires fully compatible page-markup), but I've no idea what the required or excluding conditions actually are (at least, without undertaking a minute correlative analysis of my pages' HTML).

Would anyone be able to advise me on this, please?

Thanks for reading!
Back to the top
 
Posted
Rating:
#101899
Avatar

Please post a screenshot demonstrating what you searched for, and a result that had no highlighting.


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:
#101902
Avatar

Well-settled

Hi Chris,

Thanks for getting back to me so soon! As you requested, I've attached a few screenshots illustrating various behaviours.


Shots 1 and 2 relate to the same page, searched with 2 different keywords. Note that "2 Results" are returned in both cases - and in both cases, only one result was actually displayed.

Shot 3 - only the screen title is highlighted, nothing in the body text.

Shot 4 & 5, using the Forum search, before and after searching. Forum posts are consistently unhighlighted.

Incidentally, Forum Search-query page has a fault on my ocP, v9.0.9 - the "search under" Forum Tree items are not selectable.

Hope this gives you some idea.
Many thanks,

Richard.
Back to the top
 
Posted
Rating:
#101914
Avatar

Thanks. I couldn't actually reproduce any of this, and I tried fairly hard – but if you can open a bug report ticket with site access (e.g. FTP), I can work through it on your server.

https://ocportal.com/site/tickets/ticket.htm?ticket_template=bug&cost=free


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:
#101915
Avatar

Note that "2 Results" are returned in both cases - and in both cases, only one result was actually displayed.

This is actually a known limitation of the search system. It will be because the result actually got hit on two fields. De-duplicating it for arbitrary amounts of data is computationally unfeasible, due to limitations of MySQL (either you come up against serious problems with how MySQL fulltext indexing works when used across multiple fields at once, or you come up with a situation where you have to de-dupe arbitrarily long data lists manually), so we decided just to advise of the limitation existing.


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:
#101953
Avatar

Ah, I took I took another look now and I can reproduce. Investigating...


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:
#101954
Avatar

Shots 1 and 2 relate to the same page, searched with 2 different keywords.

"Test" will not show up because it is listed in text/EN/too_common_words.txt. So that's an explicit filter designed to focus on the more relevant search terms.

Shot 3 - only the screen title is highlighted, nothing in the body text.
&
Shot 4 & 5, using the Forum search, before and after searching. Forum posts are consistently unhighlighted.

If the content is within a Comcode 'html' tag then it won't be processed as Comcode and hence we won't pick up on a word to highlight. The highlighting works on a Comcode level, rather than an HTML level.
I have added to the tracker to consider implementing HTML-level search result highlighting, but it's a challenging thing to try and do: 0001555: Allow highlighting of keywords within Comcode html tags - ocPortal feature tracker

Incidentally, Forum Search-query page has a fault on my ocP, v9.0.9 - the "search under" Forum Tree items are not selectable.

There may be errors in your browser's error console, which may help explain the cause of that.


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:
#101984
Avatar

Well-settled

Many thanks, Chris - I really appreciate your further attention to this!

I'm pleased to report making some positive progress on the matter, having now had the chance to systematically troubleshoot and eliminate possible causes of failed highlighting. Actually I was all set to send you my findings late last night, but on submitting my post, lost it  owing to exceeding the forum's time-out (which I hadn't previously experienced - would you mind telling me what the time-allowance is set to? Can I prevent that and initialize a new session by periodically previewing as I write?) I'm rather concerned as a result that your own effort and time pursuing the problem isn't proceeding without knowledge of my findings, which reveal an entirely different cause contradicting your own explanation and which might make your proposed fix unnecessary. First, though, I ought to reply to your first and third comments:

RichT said

Shots 1 and 2 relate to the same page, searched with 2 different keywords.

Chris Graham said

"Test" will not show up because it is listed in text/EN/too_common_words.txt. So that's an explicit filter designed to focus on the more relevant search terms
Aha! If I'd known about such filtering, I would have attached a result for the same page based on a less common keyword showing the same lack of highlighting. I could certainly do that if you still wish after I've reported what I found.

RichT said

Incidentally, Forum Search-query page has a fault on my ocP, v9.0.9 - the "search under" Forum Tree items are not selectable.

Chris Graham said

There may be errors in your browser's error console, which may help explain the cause of that.
I confess I was misled by finding that when clicked the items don't get highlighted (!), but on looking again, the line at the bottom "...is currently selected" changes according to which item is clicked. Embarrased apologies for the false alarm here!

So, now to the results of my testing.

Chris Graham said

If the content is within a Comcode 'html' tag then it won't be processed as Comcode and hence we won't pick up on a word to highlight. The highlighting works on a Comcode level, rather than an HTML level. I have added to the tracker to consider implementing HTML-level search result highlighting, but it's a challenging thing to try and do:  http://ocportal.com/tracker/view.php?id=1555

After eliminating possible causes regarding markup tags, font incompatibilities etc.,, it finally became apparent that the problem is Usergroup related. Specifically, all posts/pages submitted by Administrators consistently don't receive any keyword-highlighting whatsoever, while all submitted by Members are thoroughly highlighted. These results are in no way dependent on the presence or absence of surrounding Comcode HTML tags - Member-submitted pages are highlighted regardless of what, if any, tag is enclosing them! Moreover, simply as the consequence of a Member editing and submitting a page previously submitted by Administrator, the originally un-highlightable keyword text thereafter receives perfect highlighting (though it's again abolished if an Administrator subsequently re-edits the page). Simple as that! I wonder if you can reproduce this behaviour yourself?

I may be entirely mistaken, but I'm wondering if this is tied up with specifying Usergroup ranking order. I specified mine to be Guests (lowest level) as 1, working upwards to Administrators as 6. Maybe that's the reverse of what ocP's developers expected, and there's a supposition that level 1 = Guests, who wouldn't (in the out-of-the-box installation) have access to Site features like the Search module. However, there's nothing stating that anywhere I've seen, and I chose my own ordering presuming that there were no implications of numbering one way or the other.

I intend to look into that possibility next, before investigating the behaviour of Usergroups I haven't tested yet, and I'll post my findings as things progress further.

Hope this is of use to you - greatly looking forward to any comments you (or anyone, of course) might want to make at this stage.

Best regards for now,

Richard

Back to the top
 
Posted
Rating:
#101990
Avatar

which I hadn't previously experienced - would you mind telling me what the time-allowance is set to

It depends what happened. If your IP address changed (e.g. moving a mobile device, or if just your ISP reassigned you), nothing can stop a session being lost unless you have "remember me" on. If the session expired, it is 1 hour. I've actually just put it to 3 hours.

It should just have gone through as guest though. Oh, I guess it wouldn't because there'd have been no CAPTCHA, ok.

If you post from the full reply screen, it should auto-save as you type. The quick-reply won't though.

I confess I was misled by finding that when clicked the items don't get highlighted (!), but on looking again, the line at the bottom "…is currently selected" changes according to which item is clicked. Embarrased apologies for the false alarm here!

It should show nicely. Make sure you didn't delete the ".native_ui_selected" CSS class.

Specifically, all posts/pages submitted by Administrators consistently don't receive any keyword-highlighting whatsoever, while all submitted by Members are thoroughly highlighted. These results are in no way dependent on the presence or absence of surrounding Comcode HTML tags - Member-submitted pages are highlighted regardless of what, if any, tag is enclosing them!

I think it is actually that html or semihtml tags are in place, because you're using the WYSIWYG editor, which is an HTML editor. If you turn off WYSIWYG you'll see them.

Non-admins probably haven't been assigned the "Subject to a more liberal HTML filter" privilege, and thus are having their HTML converted to Comcode. If you want admins to have HTML converted to Comcode, you can enable the "Convert XHTML to Comcode" option, but I would not recommend it because if you are doing complex layout in HTML, it won't be preserved.


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:
#101991
Avatar

Well-settled

I omitted pointing out that my investigating so far has been confined to ocForums! As yet, I haven't ascertained whether pages created in other zones or distinct catalogues behave in the same way as Forum posts.

Also I realize I've muddled my words about numbering of Usergroups - I meant to say that ocP's developers may have assumed that Usergroup 1 (being at the top of the ranking list) =Administrators, and that the bottom group (lacking Site/Search access) =Guests would logically have the largest id number.

Apologies for any bewilderment caused by either of my mistakes! 
Back to the top
 
Posted
Rating:
#101992
Avatar

To be clear: usergroup IDs sequence is inconsequential when it comes to permissions.


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:
#101994
Avatar

Well-settled

Many thanks for all those points of info and instructions, Chris - each in its own way is going to save me a great deal of work!

Point by point:
Make sure you didn't delete the ".native_ui_selected" CSS class.


It's there in my global.css and unadulterated by me (!) The explanation why it's not working: the selector's 2 declarations derive their values from {$GET, foo} entities, and for styling my theme I deliberately removed the entire "Colors" section from global.css, preferring to work with directly declared color values. What I failed to take account of is that the Search page, unlike all other pages with similar trees on them, is the only one that's styled by the user-defined global.css, rather than by the default theme (so far as I've encountered to-date).

I think it is actually that html or semihtml tags are in place, because you're using the WYSIWYG editor, which is an HTML editor. If you turn off WYSIWYG you'll see them.


I turned it off to investigate every page I tested. Some, as I stated, had html comcode tags, others [semi]s, and others none. Which of these in each instance, I guess, would reflect how I'd composed the page - in WYSIWYG, in WYSIWYG "Source view", or in WYSIWYG Disabled mode.

Non-admins probably haven't been assigned the "Subject to a more liberal HTML filter" privilege, and thus are having their HTML converted to Comcode. If you want admins to have HTML converted to Comcode, you can enable the "Convert XHTML to Comcode" option, but I would not recommend it because if you are doing complex layout in HTML, it won't be preserved.


That's helpful to me beyond words, Chris! Essential for what I'm trying to achieve. Thanks! As an aside, regarding the last dozen words here, I imagine you're acquainted with ​XStandard, a WYSIWYG editor expressly designed to conserve code conversions between WYSIWYG and XHTML. I guess ocP is so thoroughly built around the behaviour of its own editor as to preclude all possibility of integrating it with the core as an alternative, but I'm wondering whether  stuff composed in XStandard and pasted into ocP's editor might be treated more conservatively than otherwise. Maybe I should just try for myself and see.
I've actually just put it to 3 hours.

Thank you, thank you, thank you. Having ADHD, it can take me a ridiculous amount of time to crank out a coherent post of any length. This will help bods like me no end.

Best regards,

Richard
Back to the top
 
Posted
Rating:
#102005
Avatar

What I failed to take account of is that the Search page, unlike all other pages with similar trees on them, is the only one that's styled by the user-defined global.css, rather than by the default theme (so far as I've encountered to-date).

Right, so you're kind of correct, but you're thinking of it in an unusual way.

By default, we only set the public zones to use the webmaster's theme. The CMS and Admin Zones use the default theme. It's all configurable, but that's the default.

It is true to say that the tree-list widget is rare outside the CMS and Admin Zones.

I imagine you're acquainted with ​XStandard, a WYSIWYG editor expressly designed to conserve code conversions between WYSIWYG and XHTML

Yes, however…

The issue here is not actually the validity of XHTML, it's actually the sanctity of Comcode (for want of a better term).
The highlighting works inside our Comcode parser. We don't parse HTML in order to try and say what to highlight, as that would be a bit of a minefield. Comcode is our tech layer that we already parse and have control over. I added something to the tracker suggesting we could change this, but it's a long and complex thing to do so I doubt would happen any time soon.

Last time I checked, XStandard uses browser plugins to do what it does. It's a quality tool, but plugins goes against how people would normally use ocPortal. It's something better suited to organisations that have standardised IT set ups, rather than user contributions.
WYSIWYG editors nowadays tend to be pretty good though. I find CKEditor excellent (which is what we're using – it's not our own editor, although we have added patches to it and integrated it tightly). We used to use something based on Xinha, which definitely was inferior.


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:
#102007
Avatar

It's your lucky day, it suddenly occurred to me that we could workaround this HTML/Comcode issue at run-time:

0001559: Improved highlighting in searches - ocPortal feature tracker

I've put it in as a hidden option. I'm not going to make the behaviour official as I think display integrity trumps highlighting for most sites. However we'll maintain the hidden option.


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:
#102064
Avatar

Well-settled

Hi, Chris - my apologies for being unable to reply sooner. 

Many thanks indeed for your hotfix, which I've just downloaded. Before I upload the files to my server may I just ask - is the enabling OcCLE command required on a per-search basis, on a per-session basis or does it enable the functionality enduringly? If not on a per-search basis, I'm presuming it can be disabled simply by typing in :set_value('really_want_highlighting','0'); - am I correct?

Thanks again and best regards,

Richard.
Back to the top
 
Posted
Rating:
#102066
Avatar

"If not on a per-search basis, I'm presuming it can be disabled simply by typing in :set_value('really_want_highlighting','0'); - am I correct?" yes


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:
#102067
Avatar

Well-settled

Many thanks!
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: