Free Support Forum -

Search finds the "same" text twice, if used in a hyperlink in .NET

Searching for “text” in the attached document shows 6 hits, although there are supposed to be only 5.
If you search for “highlight” you also get one more result than expected.
It seems to be related to the hyperlink at the bottom of the first page, every word here is found twice.
GroupDocs Parser 20.12 was used in .NET.

Aspose (42.6 KB)

using (Parser parser = new Parser("Aspose Sample.docx"))
    // Search a keyword with page numbers
    IEnumerable<SearchResult> sr = parser.Search("text", new SearchOptions(false, false, false, true));

    // Iterate over search results
    foreach (SearchResult s in sr)
        // Print an index, page number and found text:
        Console.WriteLine(string.Format("At {0} (page {1}): {2}", s.Position, s.PageIndex, s.Text));


We searched for keyword “highlight” and it showed two results. Although there is only one such word in the source file (Aspose Sample.docx).
And when we searched “text” keyword, it showed 6 results. Contrary, there are 14 results in the Word file.

Could you please confirm?
However, we have logged this behavior at our end. Your investigation ticket ID is PARSERNET-1727.

1 Like


Yes you’re right, sorry for that. I meant that there are 6 results on the first page, although there should be 5.
Thank you for checking :slight_smile:


You’re welcome. We’ll continue investigation and let you know in case of any update.

1 Like