When using the D2 searches you are likely to go into trouble regarding special characters such as apostrophes. The goal in this blog is to show you how to parameterize new special character searches.

In many documents you’ll have text with apostrophes or special characters that you want to search on. But unfortunately by default the D2 search will return nothing when you enter apostrophes directly into the search bar. The xPlore will replace special characters by spaces and store the two words one after the other to match them more easily in this order.

In fact this is not a D2 issue. Your xPlore is likely to not be set for special characters handling. By default xPlore is set to recognize apostrophes but in Word for example you have different kind of apostrophes. These characters have a different ascii code, so xPlore doesn’t recognize them.

To solve this issue you simply have to tell xPlore to handle Word’s apostrophes (or whatever character you want to search on).
In order to do this, login to your xPlore server then edit the following file:

Find the line with:

special-characters="@#$%^_~`&:.()-+='/[]{}" context-characters="!,;?""
Then add your apostrophes or special characters as follow (copy and past directly from Word to the file):

New Line
And save the file.

Now, new indexed documents can be searched with apostrophes. But note that if you want the older documents to be searchable as well, you will need to re-index the whole repository.