Search Highlights in file Contents - azure-cognitive-search

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

Related

Rename salesforce columns from API_name to field label

When you use salesforce data that has being exported through any API, tables you get have column names in their "API_Name" format. This differs a bit from their "Filed Label" format in which they are presented on salesforce's web UI (for example on reports).
You can find what API name corresponds to any of the columns (objects) in the salesforce object manager.
My question is: is there anywhere a dictionary to map API Names back to their Filed Labels? It will be very helpful to have in JSON or anything that can be used programmatically.
It's called "describe" data. It's available for whole object (label, plural label), fields (label, picklist value translations), names of related lists.
In Apex this is a good initial reading: https://developer.salesforce.com/docs/atlas.en-us.200.0.apexcode.meta/apexcode/apex_dynamic_describe_objects_understanding.htm and for fields: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm
If you're using REST API - make GET to /services/data/v55.0/sobjects/Account/describe for example.
Have a look at https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_quick_start.htm too. For example if you need to build your own UI for "dependent picklists" it can be painful to read it all from "describe", https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_features_records_dependent_picklist.htm is bit better. And when you fetch records via this API you get fields as object with visible label and raw value (useful when displaying dates, numbers for example)

How to remove highlights tags before in Azure Cognitive Search documents before searching

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.

How to create search engine in leaflet map using apache solr?

I'm building an app that lets user find vacation rental from map. I've several data in my leaflet application. So my question is about:
How to make a search engine from the map itself that search the marker id(and content of it)?
In this case, i wish to create a search bar outside the map which user can search any places and the result should be appear in the map in the form of marker pointer which indicate the result instead of list of result in list view.
How to make the marker appear when user query the result
Your use case have a solution In Kibana-6 with elasticsearch , there is a lucene bar search which search interactively your data.
this is my work on nyc-cabs-data :
as you can see in the lucene bar i search the field total_amount which is a column in my csv

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.

How to generate tile of artical automatically in drupal?

There are several fields and I want generate title from these fields by concatenating them by character '||' in an article in Drupal. However I find it that you must input article title manually, then how to generate title automatically?
I have used Auto Node Title in a project for my client and worked fine to generate titles automatically for the nodes. I don't know if with it you can generate title for the other fields also, but maybe with some additional configuration it would be possible to do

Resources