skip to Main Content

I have a document structure like this:

Title

[[TOC]]

#Topic 1
x
x
x
x
x
x
x
x

##Sub-Topic 1
x
x
x
x
x
x
x
x

#Topic 2
x
x
x
x
x
x
x
x

##Sub-Topic 1
x
x
x
x
x
x
x
x

I am new to azure cognitive search. What I want to achieve is an index with multiple elements having same source (since it is a same document) with title, answer and url link to that title. The information about the location of topic and subtopics is in the table of contents. When I click them, I reach to that section of the page. So when I search something, and the answer is found (may via semantic search), I would like to get the link to that section of the page. Is this possible in azure cognitive search?

2

Answers


  1. Yes, this is possible with Azure Cognitive Search. You might have to implement some client-side logic to reach the location of the semantic answer of the document if you choose to open up to raw document in a new window as the default behavior would be to just open up the selected document that has the answer.

    Login or Signup to reply.
  2. Linking to sections in content from search results depends on the content source you have. If the content is your on own website and you are in control of it, you can add HTML anchor links in the HTML of the content. If your content is HTML that you don’t control, you can only use the anchor links already present in the documents.

    If your content consists of PDF documents, you have to use the linking mechanisms that PDF provides as documented by Adobe:

    To target an HTML link to a specific page in a PDF file, add
    #page=[page number] to the end of the link’s URL.

    For example, this HTML tag opens page 4 of a PDF file named
    myfile.pdf:

    From your description, it seems like you are looking for a simple option in Azure Search that enables deep-linking to any content. There is no such option.

    1. Figure out how you can craft a URL that links users to the relevant sections of your content.
    2. Process your content and extract the necessary bits needed to produce the links to the relevant sections. If you are using a built-in indexer, you can define custom skillsets to do this. Alternatively, use the SDK to push content directly to the index without using the indexer. That way you can process the content with your own code which is much easier than learning how to use skillsets.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search