Searching other fields in the internal backoffice search box - v7.1.0 - asp.net-mvc

My aim is to add additional fields to the searching parameters for the internal search - I have amended ExamineIndex.config to index the new property:
<IndexSet SetName="InternalIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/Internal/">
<IndexUserFields>
<add Name="briefing"/>
</IndexUserFields>
</IndexSet>
However, after rebuilding the internal index, it seems as though the internal search is only using the node name.
Is it possible to search multiple properties with the internal search?

You are quite right - the Content and Media searches only take into account the Node Name, along with a path restriction if the current user has a starting node specified.
Member search also includes the following additional fields:
email
loginName
As a reference, see the implementation here:
https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web/Editors/EntityController.cs#L227-L283
If you want to implement a custom search, you'd have to create a plugin or dashboard that would allow you to implement the search features you want.
For some ideas, checkout the MemberListView project (which uses custom examine searching to populate the list): https://github.com/robertjf/umbMemberListView

Related

ServiceNow Rest API (using PowerBI)

I'm on a project in which I need to get data from a ServiceNow instance and treat all data with PowerBI. I'm able to retrieve a big amount of data (Snow collect a lot of data), but I still need a way to filter data correctly. I'm calling to this URL:
Besides, I want also to apply a filter to retrieve just some specific registries from the table Requested Items. For that, I use the sysparm_query parameter to filter the field "cmdb_ci" and more specifically it's "name", something like:
&sysparm_query=cmdb_ci=What I need to Filter
Apart from this, I have also tried:
&sysparm_query=cmdb_ci.value=What I need to Filter
&sysparm_query=cmdb_ci.display_value=What I need to Filter
&sysparm_query=cmdb_ci.sys_id=What I need to Filter
&sysparm_query=cmdb_ci.name=What I need to Filter
But still not found the solution... as all these does not respond the solution needed.
Does someone know how I can manage this?
Thanks!!
JLG
There are two "Configuration item" fields in sc_req_item: cmdb_ci and configuration_item. Make sure that you are using the correct one. Either cmdb_ci.name=value or configuration_item.name=value should work, depending on which of the two fields you are using. cmdb_ci.value and cmdb_ci.display_value will not work as there are no fields on the record with these names. cmdb_ci.sys_id should work if you are supplying a sys_id (although it is redundant to type .sys_id for a reference field).
You should first verify your query through the ServiceNow UI before attempting to use it in an API call.
Type sc_req_item.list in the Filter navigator
On the filter list select "Show related fields"
Get your filter to work correctly
Right-click on the filter and select "Copy query"
The next step is to test it using the REST API Explorer.
Final step is to configure your client tool (PowerBI).

Algolia search with attribute name

Data on algolia is like this
objectID:3464542
Type:"Accelerator"
Country:"Germany"
City:null
Name:"ProsiebenSat1 Accelerator Batch #8"
I want to search any name which are in Germany. How I do that?
When I do Contact.raw_search("Batch"), I get all records even whose name include this even non-German. I want to get all those which are of specific country.
To do so, you'll first need to put the Country attribute in your attributesForFaceting list. You can do that using the REST API, your client of choice or from the Algolia Dashboard. Using the later one, go to the Indices page, select your index and click on the Display tab. Here, you could add your Country field to the Attributes for faceting list. After that, click on save and your index will be rebuild.
Now, your index is ready to filter the search queries according to the country you want. To perform the search query, you can use (using the Ruby client):
Contact.search("Batch", {
facets: ["Country"],
facetFilters: ["Country:Germany"]
})
For more informations about faceting, here is a quick intro from the FAQ and a more detailed guide in the documentation.

How do I localize the interface of Google Custom Search Control

I'm using Google Custom Search with a CustomSearchControl to display search results for a website. I can get the search results localized, and can add a localized no results string without problems. However, I cannot get the search box itself to become localized, i.e. the "Search" button and "XXX results".
The Google documentation CustomSearchControl doesn't mention any way to achieve this. Isn't this possible?
Here is the code I'm using.
google.load('search', '1', {language : 'is', style : google.loader.themes.MINIMALIST});
google.setOnLoadCallback(function() {
var customSearchControl = new google.search.CustomSearchControl('MY_ID');
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
customSearchControl.setNoResultsString("Ekkert fannst.");
customSearchControl.draw('cse');
var queryFromUrl = parseQueryFromUrl();
if (queryFromUrl) {
customSearchControl.execute(queryFromUrl);
}
}, true);
Official response from Google support
I would like to update that currently for custom search element V2 code, you can change the search engine language only from the control panel->Basics->Language section. Whatever language you select it will be the same in all of your multilingual sites. You can't have different languages in different sites. Currently we don't have any parameter such as "language" in the Google Site Search code snippet to customize the language.
In your case you can consider creating different search engine for different languages and change the Language setting in Control Panel --> Setup --> Basics --> Language in all the search engine respectively and share the query quota by adding the search engine in the Business group.
Once you do that all these free search engines will share the query quota of your master GSS search engine.
After that, you can configure each search engine with respective sites/URL pattern only and implement the specific search engines on respective sites.
Please review the document below to know about Language settings
https://support.google.com/customsearch/answer/2633296?hl=en
Please review the document below know about business group:
https://support.google.com/customsearch/answer/2633350?hl=en
With the CSE Element v2, the search button becomes an icon, so there is no need to localize, if you switch to v2.

Grails Searchable Plugin - Filtering Result Set

I am currently using Lucene. My requirement is like facebook search box. User search people and friends. But in my requirement user have privacy settings like name, location, email address are visible to everyone or only friends. He can show and hide these fields from friends and other members of the community.
I have implemented simple search on the basis of name, location and email address. But now i am modifying search on the basis of privacy settings.
Here is my scenario..
User A has privacy settings:
Name is only shown to friends
Email is shown to every one
Location is not shown to any one.
If User X type location of the User A in the search box then it should not be in the results. But if User X type Name of User A in the search box then it should be shown because User A has not restricted name and it is visible to his friends in the privacy settings.
Can you please guide me to the approach.
Let me know if i have not clearly write my requirement.
I have analysed following approaches,
1- IndexSearcher's explain method (It will be hit overall performance)
2- Explored Filters
But couldn't get much
My Approach:
Get the resultSet on the basis of name
Get the resultSet on the basis of location
Get the resultSet on the basisi of email address
Loop on each 3 result set and apply conditions related to privacy settings and exclude the items on the basis of privacy settings. And in the end merge all 3 results set.
If there is any other approach? Please share with me. Thanks.
may be you can use lucene query syntax in searchable plugin for creating lucene Query according to requirement.
you can find here or here
you can restrict seaching by overriding default property settings. You just need to apply like this....
class A {
String x
String y
String z
static searchable = [only: ['x', 'y']]
// …
}
Using this you can restrict searchable properties.

Setting up Umbraco Indexes

I've created a site using Umbraco 6.02, and I'm going over all the final configuration of the site now, and I've come to indexes. I've done some research, but I just cant find in simple terms what I need to include in each section and why.
Which fields I should include in the <IndexUserFields> section of the index? Is it just the fields I'll be using to search with, for example:currentNode.Children(x => x.bodyText.Contains("*"))? Or fields that I'll be using to sort nodes such as a date field for news articles? Or is there more to it than that?
Which document types do I need to put in the <IncludeNodeTypes> section and the <ExcludeNodeTypes> section and why?
And do I add my fields to one of the already created indexes, or do I create my own?
Old post but may help someone along the way.
http://umbraco.com/follow-us/blog-archive/2011/9/16/examining-examine.aspx
You can create custom indexes (if you desire) to lock down what types of searching you're doing. Many times you have a search box somewhere on your page and you only want to search certain doc types and their related content.
Keep in mind that you can create NEW index sets, but remember that you'll need to register them in the Config/ExamineSettings.config file as well as the Config/ExamineIndex.config file.
The link above is how I got mine to work correctly for just searching (2) different doc types (which Examine uses as NodeTypes) in the config.
The settings below were created using the already default ExternalIndexer, not a newly created custom one.
The file that you want to edit is in Config/ExamineIndex.config. The set that you want to edit is the ExternalIndexSet (by default). The path will point to the external temp folder
<IndexSet SetName="ExternalIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/External/">
For fields, that goes in the IndexUserFields section, which are custom properties that you have defined on your doc types
<IndexUserFields>
<add Name="itemNumber" /> <-- custom property
<add Name="productName" /> <-- custom property
</IndexUserFields>
The doc types (NodeTypes) that you want are whatever you named your document types. Remember that these are the alias, not the name
<IncludeNodeTypes>
<add Name="Product" /> <-- document type
<add Name="Variant" /> <-- document type
</IncludeNodeTypes>
Remember after setting this up you want to re-index your Examine. You can get to this by logging into the backend of Umbraco and going to Developer, then clicking on the tab that says Examine Management.
Please note that the interface is Umbraco 7 but the config file will still be applicable for v6.

Resources