Search for existent phrase including an ampersand produces no results

  • Unknown's avatar

    I had multiple pages that included a recording by a duo named alternatively “Jackie & Roy” or “Jackie and Roy.” However, a search for the name with the ampersand produced no results despite the fact that I found two pages that included that spelling. I changed the spelling in one of those two to the alternative spelling with “and” in the middle, but left the one the “&” in the middle, here.

    Two concerns:
    1. There may be other pages with the phrase “Jackie & Roy” that I’m unaware of. Since the search tool fails to find that phrase when it exists on the site, it is very difficult to find the phrase by other means. I can for example look for pages that include by “Jackie” and “Roy,” and then check each page for the key phrase.

    2. The example is certainly not the only phrase on my large site that includes an ampersand in the middle. My concern is that the same failure to produce search results will presumably occur in every case of a three word phrase in which the middle “word” is “&.”

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Correction:
    Change “but left the one the “&”” to “but left the other with the “&””

  • Howdy, doc!

    Of which search are you speaking? If I search for “Jackie & Roy” using the search box on your site I get several search results:

    https://songbook1.wordpress.com/?s=jackie+%26+roy

    Same if I search WP-Admin:

    https://songbook1.wordpress.com/wp-admin/edit.php?s=jackie+%26+roy&post_status=all&post_type=page&action=-1&m=0&paged=1&action2=-1

    And My Site ->Pages:

    https://wordpress.com/pages/songbook1.wordpress.com?s=jackie+%26+roy

  • Unknown's avatar

    Howdy, kokkieh!

    Of which search are you speaking?

    The search I’m referring to is precisely “Jackie & Roy” — with an ampersand in the middle, and including quotation marks. I want the search results to include only posts and pages that have that exact phrase in them. The quotes aren’t part of the phrase that I’m searching for, but are used in the search term to limit the results to only that exact phrase (though the searched for phrase itself doesn’t have quotation marks).

    Regarding the searches you mention:

    1. https://songbook1.wordpress.com/?s=jackie+%26+roy — This one produces false positives. The results includes pages that have only one of the three elements of the phrase in their content. For example, one of the results is the page 1925 hits and standards. That page has only the word “Jackie” in the content of the page, while the word “Roy” appears in the sidebar (of any page). The difference between this search and the one I’m referring to is the quotation marks around the phrase.

    2. The searches in WP Admin and My Sites of the phrase “Jackie & Roy” that you mention, without quotation marks, again produce false positives. The quotes are necessary to limit the search to that exact phrase.

    So the search for the phrase “Jackie & Roy” — with the quotation marks included in the search keyword phrase — produces zero results in each of the places you mention: a. search box on visible post or page, b. WP-Admin pages (or posts), and c. My Sites pages (or posts).

    I also found another search failure yesterday, on an existent (in a page on my site) external URL that includes a page extension. Searching for the URL without the extension is successful, but if I include the extension in the search phrase there is no result, despite the fact that the precise URL with the extension is present in the page I’m searching on. I may address this one in a separate topic.

  • Unknown's avatar

    I don’t know how I obtained the indent in the preceding post. That was unintentional.

  • Of which search are you speaking?

    The search I’m referring to is precisely “Jackie & Roy”

    No. I’m asking which search option on your site, as there are several.

    The quotes aren’t part of the phrase that I’m searching for, but are used in the search term to limit the results to only that exact phrase (though the searched for phrase itself doesn’t have quotation marks)

    The difference between this search and the one I’m referring to is the quotation marks around the phrase.

    Okay, so you are trying to get an exact phrase match. It’s worth mentioning a detail like that in your original report, as the quotation marks could reasonably be interpreted to separate the search term out from the rest of the sentence rather than being part of the actual search term.

    It looks like there’s a known issue with the encoding of the & character in searches, and the moment you do a phrase search the search box cannot just ignore that character. If you use the HTML entity instead in your search term, & amp ; (without the spaces), the search will work.

    I’ll add your report to the open issue about this, but cannot say when a fix will be made so please use that workaround for now.

  • while the word “Roy” appears in the sidebar (of any page).

    Sidebar content is not included in search results. The Search widget only returns matches in post/page titles and content, media file titles, file names, alt text and captions:

    https://en.support.wordpress.com/widgets/search-widget/#what-it-searches

  • Unknown's avatar

    Okay, so you are trying to get an exact phrase match. It’s worth mentioning a detail like that in your original report…

    You’re right, but I thought that I’d made it clear in the OP that “&” was the middle term in the exact three term phrase I was searching for. Apparently not.

    It looks like there’s a known issue…If you use the HTML entity instead in your search term, & amp ; (without the spaces), the search will work.

    Got it. Thanks!

  • Unknown's avatar

    For example, this statement from the original post

    There may be other pages with the phrase “Jackie & Roy” that I’m unaware of.

    indicates that I’m looking for that exact phrase in pages, as does the following sentence in item #1 of the OP, which goes:

    Since the search tool fails to find that phrase when it exists on the site, it is very difficult to find the phrase by other means.

  • Unknown's avatar

    and
    The example is certainly not the only phrase on my large site that includes an ampersand in the middle.

  • Unknown's avatar

    I mean, from the OP:

    The example is certainly not the only phrase on my large site that includes an ampersand in the middle.

  • The topic ‘Search for existent phrase including an ampersand produces no results’ is closed to new replies.