4/20/2018

The Mysterious Semicolon in SharePoint Search


Discoveries:

  • A semicolon in a search is the same as the keyword "AND".
  • You cannot uniquely find text that contains a semicolon. (such as ABC;DEF)
  • A semicolon used as data in a checkbox enabled Choice column causes data and search problems.


If you have more info, or know of an escape character for “;” please post a note to this article!


";" equals "AND"?

If I were to search a SharePoint list for "111 AND 222", I would find items where "111" might be in one column and "222" might be in another, or both are two words in the same column. I was trying to find data that looked like this, "111;222", and was getting wrong matches. At first I thought the semicolon was behaving as a wildcard, and that would have been really cool as SharePoint does not support anything other than an "*" at the end of a word.

image_thumb[24]

From testing, it appears that a semicolon is identical to the keyword "AND". In the example below, note that all of the sample text entries are using "word delimiters" that SharePoint recognizes as search word breakers. As "data" a semicolon is treated as "white space" or a word breaker, and is ignored by search!

image_thumb[25]

Here is a search for "111" AND "44" and note that no items were found.

image_thumb[26]


You can't uniquely search for a semicolon!

If your data contains symbols in the middle of text, you will have a problem when searching for text that contains a semicolon. In the example below, note that the search for "555;777" also finds other items.

image_thumb[27]

The addition of quotes will solve this problem for other special characters, but not the semicolon.

image_thumb[28]


Semicolons and Choice Columns

A discussion of the semicolon would not be complete if we don't talk about what it does to a Choice column!

Consider Choice column with these choices: (third choice has a semicolon)

image_thumb[29]

And for this Choice column we selected Checkboxes.

image_thumb[30]

Now let's select some data. Notice the display when I select two items in a QuickEdit view. The semicolon is part of one item's data, and is also there as a delimiter between items.

image_thumb[31]

When I click off of that row, note that the two selected items are being treated as three items!

image_thumb[32]

When I attempt to edit that column again, the item with the semicolons has been lost because there are no "aaa" or "bbb" items in the list.

image_thumb[33]

So…

  • Don't put semicolons in your data if you plan to search for it.
  • Don't put semicolons in multi-choice (Checkbox) columns.

No comments:

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.