How to include the hyphen in the search pattern
We want to be able to search for string patterns that include the hyphen symbol like the following example:
“…Despite its fearsome reputation, the T–Rex was actually quite slow, with a top speed of around 20 miles per hour…”
A search that includes a hyphen in the search pattern is not supported in the default configuration of DocFetcher. For that we need to configure DocFetcher in the following way:
- Remove all indexes
- Set the [word segmentation] option to “Source Code”:
![](http://www.iteacorner.com/wp-content/uploads/2023/04/image-2.png)
- Recreate all indexes again
Now you can search and find a text pattern that includes a hyphen.
Searching a string pattern inside a longer string
Let’s assume we want to search for the string pattern travel inside a longer string like myblog.cheaptraveling.blog
To achieve that you can use both of the following queries:
*travel*
or
content:*travel*
Including special characters in search patterns
According to the following discussion in the official DocFetcher discussion forum as of 2017-11-17 DocFetcher was not designed for searching for special characters:
https://sourceforge.net/p/docfetcher/discussion/702424/thread/35cc5659/