How to remove highlights tags before in Azure Cognitive Search documents before searching - azure-cognitive-search

Azure Search by default highlights search results with <em> tag. I've met with situation where user uploads document with that tag inside:
<em>Today</em> topic will be...
When i would search for "topic" i would get:
<em>Today</em> <em>topic</em> will be...
And i wouldn't be able to distinguish the right highlight.
I know that i can modify highlight_pre_tag and highlight_post_tag so i would avoid this in this particular situation. But is there other way to encode this tags before appyling highlighs?
EDIT:
By encoding i mean getting something like this:
<em>Today</em> <em>topic</em> will be...;
So I can send it to frontend and then display <em> from "Today" as <em> and use <em> in "topic" to highlight it to yellow.

Azure Search doesn't provide any built-in mechanism to modify the "raw" content of a document if you are using the Index API directly, however, if you are using one of our built-in indexers, you can look into using the field mapper functions (such as the UrlEncode function) or create your own custom skill (if you want to only apply very specific rules) to transform the documents in transit from your data source to the search index.
Alternatively, we've seen customers use custom highlight pre and post tags that are easily recognizable (and unlikely to be mistaken for original content) and then using a simple search and replace function in their client application to transform those back into the desired tag.
For example, using
pre-tag : "!HIGHLIGHT_START!" and post-tag :"!HIGHLIGHT_END!"
and then using
String.Replace("!HIGHLIGHT_START!", "<em>")
before displaying the results in their application. That way, any client-side logic that requires finding the actual highlights can use the custom tags, while still showing the desired tag in the UX.

Related

Search Highlights in file Contents

We have .net application displaying data from using Azure Search service, based on DotNet search App Template
Is there a possibility to show only parts of the file with the highlighted term - for example PDF file page with term highlighted on top?
Have you looked up using the highlight feature?
https://learn.microsoft.com/en-us/rest/api/searchservice/search-documents#highlightstring-optional
Your search results will then have a new #search.highlights field which contains a collection of passages with the searched terms. Then you can also use the $select parameter to decide which fields to retrieve and which one to ignore.
https://learn.microsoft.com/en-us/rest/api/searchservice/search-documents#selectstring-optional

Docusign Formatting and Salesforce integration issue

I am in a Salesforce environment and trying to send out a docusign document using Docusign and Conga. I am using a 30 day trial.
1.Using Conga and Docusign works very well together and the formatting is correct except that I need to have 2 radio buttons on the form. Is there a way to add anchor tags to my Word document and hide them(white text) like I do for the Docusign signature and date tags?
I tried following the documentation for creating the radio buttons in Docusign and tie them to a picklist field in Salesforce but I have yet been able to write back to Salesforce.
How do you control the text length for a Docusign template? I have fields that make up the address but the spacing is not dynamic so depending on the field value the text may run into each other. Is there a way to have the fields adjust based on field value length?
How do I show multiple related records? I have a case with multiple activities associated to it and I need to display them. In Conga I use a table and all of the records show. But if I create a docusign template it is only showing the first record.
If at all possible I would prefer to add the anchor tags to the existing document since the formatting is cleaner.
Michael
There is. You'll want to avoid applying anchor tags directly to a DocuSign template when working in the web console. The reason for this is that when you're sending from Salesforce with or without Salesforce anchor strings you're going to receive an error message indicating that there's no text associated with an anchor string.
You can accomplish this through Custom Fields inside of Salesforce.
Basically, you place your text in white where you want the tag to attach to your document. You'll want to set the anchor string in the format of \variable{r}\ on the tag, then in the underlying document you would replace {r} with the recipient number in the signing order.
IE: \variable_{r}\ becomes \variable_1\, when Salesforce picks this up it will tag the document automatically. For more information, see here: https://support.docusign.com/guides/dfs-user-guide-use-automatic-anchor-text-with-custom-tags-user.
In terms of writing back the value of a Radio Button, as I'm sure you've noticed this can be tricky. The values for the picklist in Salesforce need to match up exactly, then be written back by adding a new line in your Connect object. A step by step guide is available on the support site: https://support.docusign.com/articles/DocuSign-for-Salesforce-How-to-update-a-Salesforce-Field-with-a-DocuSign-Radio-Button-Value.
The Width of a text field is determined in one of a few ways:
1) You can supply a fixed size in the API call being used to generate them.
2) You can save the custom field inside of DocuSign as a Custom Field after setting the width to it.
3) Set the Fixed Size flag to false, then the text field should fill itself out when text is applied to it.
Would you mind being more specific in regards to the status record?

Set Title and Id With Retrieve and Rank Web Interface

I have used IBM Watson Retrieve and Rank Web Interface to create a collection of html articles. Via the web interface I was able to upload my html articles. The problem is when I query the collection the data for id and title are not usable. Here is the query I made in the browser:
https://MY-USER-NAME:MY-PASSWORD#gateway.watsonplatform.net/retrieve-and-rank/api/v1/solr_clusters/MY-CLUSTER/solr/MY-COLLECTION/select?q=what is the basic mechanism of the transonic aileron buzz&wt=json&fl=id,title
The response I get is:
{"responseHeader":{"status":0,"QTime":106,"params":{"q":"what is the basic mechanism of the transonic aileron buzz","fl":"id,title","wt":"json"}},"response":{"numFound":12,"start":0,"docs":[{"id":"6a06f47c-cb3f-4791-9914-c84772eb9415","title":"no-title"}.....
The bold section is the problem. When using the web interface is there a way to set the title and id when uploading documents? Or, better yet, is there another way I query my collection to get the file name of the document I uploaded and/or the text from the document?
When using the web interface is there a way to set the title and id when uploading documents?
No, sorry.
However, if you upload the documents yourself from outside of the web interface, you can specify the title and ID (and the documents will be shown in the web interface when you come back to it).
is there another way I query my collection to get the file name of the document I uploaded
Yes
In the query you posted above, the last parameters you have are the fields you want to retrieve
&fl=id,title
You're retrieving the ID and the title.
If you want the name of the file that the content came from, add fileName. For example:
https://MY-USER-NAME:MY-PASSWORD#gateway.watsonplatform.net/retrieve-and-rank/api/v1/solr_clusters/MY-CLUSTER/solr/MY-COLLECTION/select?q=what is the basic mechanism of the transonic aileron buzz&wt=json&fl=id,title,fileName
is there another way I query my collection to get text from the document
Yes.
Similar to above, you just need to update the list of fields that you retrieve. The contents of the doc is put in a field called body.
So to get the ID, title, and the body, you could use:
https://MY-USER-NAME:MY-PASSWORD#gateway.watsonplatform.net/retrieve-and-rank/api/v1/solr_clusters/MY-CLUSTER/solr/MY-COLLECTION/select?q=what is the basic mechanism of the transonic aileron buzz&wt=json&fl=id,title,body
That gets you a plain text version of the contents. If you want the HTML, use contentHtml instead.
https://MY-USER-NAME:MY-PASSWORD#gateway.watsonplatform.net/retrieve-and-rank/api/v1/solr_clusters/MY-CLUSTER/solr/MY-COLLECTION/select?q=what is the basic mechanism of the transonic aileron buzz&wt=json&fl=id,title,contentHtml

Overview page of elements from a Typo3 page tree

I'm primarily a UI and graphic designer and, eventhough I have some experience with Typo3, I'm completely stuck at the following problem:
I have a large page tree with single pages for items from a catalogue (one item per page), the layouts for these items are built with Armin Vieweg's beautiful "Dynamic Content Elements" extension (DCE).
Now I want to create an overview page where I reference some of those items automatically - ideally I want to check a box in each element I want to display there (I would add a field catalogueItemPreview to the item DCE which authors can check or uncheck).
Unfortunately, I have no concrete idea of how the database is structured and how I could build a query (where would I even do that? in a custom-made plugin?).
This is how I imagine it could work: On the overview page I use a plugin/an extension in a Content Element that does the following:
search Typo3 DB for content elements with a field called "catalogueItemPreview"
return fields "catalogueItemTitle", "catalogueItemShortDescription", "cataloguePreviewImage"
use a template to render previews of all those elements on the overview page
I'm happy for ANY pointers towards a solution as currently I'm completely in the dark about where even to begin ...
Schematic screenshot from the Typo3 backend
thanks for using my DCE extension :)
Well the fields you have defined and their values in content elements are stored as XML, because the current version of DCE is based on Flexforms.
This makes it very very difficult to do MySQL queries using one of the field properties in WHERE clause. You could check for a xml string in the field pi_flexform but this is not recommended.
Instead I would use another property of content elements (tt_content) to mark the items as "Show on frontpage". For example you could create a new layout or section_frame value for that. Then it is very easy to just output the elements you want, using TypoScript.

Salesforce: How to add a Custom Object to Search results

Seems like a simple question, but I can't see where this is set.
I created a custom object, Account Thing, which is related to Accounts with a Master-Detail relationship.
It has a text area field, Body.
It has a Search Results Layout, and if i search for something contained in Body, a result returns.
I created another analogous custom object, Contact Thing. It also has a text area field, Body.
It does not have a Search Results Layout. If i search for something contained in Body, nothing returns. Looking at the list of objects being searched in the results page, Account Thing is listed, but not Contact Thing (or any other custom object i have created)
I'm thinking there must be a flag or search setting that i set for Account Thing, but I can't find it now.
I looked under App Setup > Customize > Search > Search Settings,
but there is no relevant config there.
Any help is appriciated!
I did some digging and found the solution to this issue.
Apparently only Custom Objects that have their own tab are included in search results.
I had somehow created a tab for Account Thing (but removed it from view), but not for
any of the other Custom Objects. After I added a tab, Contact Things were returned in relevant searches.
One other side piece of info is that the body was a Rich Text type, not a standard Text Area. So that explains why it is searchable.
Are you sure the Body on Account think uses a text area? I didn't think those would be searchable as you can't use them in the where clause of a SOQL query so would be surprised if the system did search them. Other than that, is the object marked as 'Deployed' or 'In Development'? If the latter, it probably wouldn't appear.
Because this is a non-code question you may well get closed down here, please follow (and vote on some questions) my Salesforce Stack Exchange proposal, I'm putting it forward so that these kind of questions (which are valid Salesforce development questions) have somewhere to live on Stack Exchange network!

Resources