Search with Numbers and Special Characters

Hi,

I am using GroupDocs.Search to perform content search from my documents.
The issue is I want to search text “SO(FOOD)/1723/2023” as a whole word but I am unable to search this text. As it contains special characters and numbers.

Is there any way to search this whole text.

and another concern is Can I search number as a string ?
For example, I want to search “1683265324332”.

1 Like

@Hamdah

Please take a look at this documentation article - Phrase search. You can use this feature to perform the search.

As far as this issue is concerned, we have created an investigation ticket in our internal issue tracking system. Your investigation ticket ID is SEARCHNET-2857. You’ll be notified in case of any update.

The documentation says:
Phrase search other than words can also use two kinds of wildcard characters:

    • byte-number
    • byte-number ~~ byte-number

where byte-number is a number from 0 to 255.
The first pattern represents the exact number of unknown words in a phrase, for example *2. The second pattern represents the range of the number of unknown words in a phrase, for example *1~~2.

I want to search large numbers such as “1683265324332” as a string. I don’t want use numbers as a pattern in the phrase.

1 Like

@Hamdah

Please take a look at the following code, this source/sample sample.zip (165.0 KB) and this output.png (3.3 KB):

//C# code
License lic = new License();
lic.SetLicense(@"D:/license.lic");
var settings = new IndexSettings();
string documentsFolder = @"D:/sample/";
var index = new Index(@"D:/Index", settings);
index.Add(documentsFolder);   
//large number as string
string query = "1683265324332";
SearchResult result = index.Search(query);  
Console.WriteLine("Query: " + query);
Console.WriteLine("Documents: " + result.DocumentCount);
Console.WriteLine("Occurrences: " + result.OccurrenceCount);
Console.WriteLine(); 

Thankyou, this issue is resolved.
Let me know if there is any update about SEARCHNET-2857

1 Like

@Hamdah

We prepared this documentation article for you - Search for text containing special characters.