Jump to content

Admin Page Search Inconsistency?


iank
 Share

Recommended Posts

Hi,

I have a text field called refcode that I wanted to add to the fields searched by the Ajax Admin Page Search, so was able to add it in the Module Settings.  The default search operator I've left unchanged at "%= Contains phrase/word using LIKE". 

The refcode field contains something like "ABCD000126".   If I type a three or less  character search term, e.g.  "126" or "012" in the admin search box, the ajax search finds a match.  However if I type a longer term, e.g. "0126" it doesn't.  

It seems that if the search term is more than three characters the ajax search switches from "%=" to using "*=" and I guess this may be looking for word boundaries?  The only way I can get a match for more than three character search term is if I enter the full value "ABCD000126". 

Strangely, if you press enter to display the actual results list, all of the above search terms will display matching results, so this must honour the default search operator "%=".

It's not a huge problem, but if I wanted to find just the record with refcode "ABCD000012" I would need to enter "012" but this would also return "ABCD000126" and "ABCD001200" as well.

I wonder if this is the intended behaviour?

I'm on master version 3.0.42 with default theme.

Thanks,

Ian.

Link to comment
Share on other sites

I tested this and can confirm. It's quite a weird bug - I suggest you open a GitHub issue for it.

A few more details based on my tests:

  • It isn't related to adding another searched field in the ProcessPageSearch module settings - the bug also occurs when only the title field is searched.
  • It occurs only when searching for a string that is part of a word and does not start at the beginning of a word. For example, if I have a page titled "My amazing page" then...
    • "maz" will match the page (2 or 3 character searches work)
    • "mazi" will not match the page (4 or more characters not at the start of a word do not work)
    • "amazin" will match the page (any number of characters will work so long as they start from the beginning of a word)
  • Only pages are affected - the bug does not affect field, template or module results within the admin search.
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...