[wp-trac] [WordPress Trac] #56294: WordPress search finds block name in comment

WordPress Trac noreply at wordpress.org
Mon Apr 3 18:03:05 UTC 2023


#56294: WordPress search finds block name in comment
--------------------------------------+------------------------------
 Reporter:  zodiac1978                |       Owner:  (none)
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Database                  |     Version:  5.0
 Severity:  normal                    |  Resolution:  maybelater
 Keywords:  needs-patch dev-feedback  |     Focuses:  performance
--------------------------------------+------------------------------

Comment (by zodiac1978):

 > > Replying to [comment:12 l1nuxjedi]:
 > > And with the example from the MariaDB knowledge base:
 https://regex101.com/r/CY0zuJ/1 (just added "5 < 1" in the content).
 >
 > I would hope in that case that you have literal < and > encoded using
 HTML entities.

 Of course you are right. Content is encoded in WordPress database posts
 table, so in the database there is only `<`.

 > Otherwise the only real solution to avoid edge cases would be a proper
 HTML parser to retrieve the raw text from and parse that into some index
 generating code to use for the search.

 Yes, but this would be out of scope for a core ticket, I think. ;)

 > Another suggestion would be an engine such as Sphinx as the backend
 instead, which can intelligently filter out meta tags. Not necessarily
 that one though. [...]

 Yes, another one would be Elastic Search, but using an own search engine
 would be overkill for most users. My main goal with this ticket was
 examining the possibilities to fix the search without too much overhead
 (like duplicating the posts table with a cleaned content version as search
 index, like Relevanssi is doing it).

 As WordPress is not requiring the versions which support REGEXP_REPLACE
 this will still be closed as `maybelater`, but I will fix my plugin, and
 we could re-evaluate this ticket if the requirements change.

 Thank you all for helping!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56294#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list