Randomize content search web part results - search

I am attempting to randomize search results from a content search web part on an o365 sharepoint farm.
The end goal is to have a randomized employee spotlight web part. So I cannot use a list column to randomize, it needs to come from the web part only.
I have seen this:
https://msdn.microsoft.com/en-us/library/office/jj938031%28v=office.15%29.aspx#SP15_Sort_search_results_in_random_order
using this parameter I can get a rest url to randomize results:
http://localhost/_api/search/query?querytext='home'&sortlist='[random:seed=5432]:ascending
The problem is I cannot get [random:seed=5432] to work in the web part. I tried adding it as a dynamic sorting rule but no luck.
Any help is much appreciated.

Related

Facets count limit 5 in Azure cognitive search site autogenerated

first of all I am not familiar with javascript but I saw the easy way azure search generator offers a portal with search features and I used it to make a search portal for more than 100K files. Everything is fine except that I'm facing the same issue of the limit of 5 facets mentionned in this old post (Facet count in Azure cognitive search (Automagic)). Using search explorer I can see the request url needed (example : facet=category,count:10 / https://xxxxxsearch.search.windows.net/indexes/azureblob-index/docs?api-version=2020-06-30-Preview&search=*&facet=category%2Ccount%3A10) but can't figure out where to put this in search app hmtl page or how I can parse it to automagic to consider this.
thank you Gaurav for your feedback. no, that part is clear for me. Please let me show an example of what I want to achieve.I generated a search a portal using AzSearchGenerator and for this sample I have 7 files with the same metadata key but with 7 differents values (blob-content-files). I am seeking a way to override the limit of 5 checkboxfacets in the search portal generated (check here : portal-search-generated). Is there a way to change this by including the request url with count parameter higher than 5 checkboxes (storage-explorer-request ) to update the automagic instance in the html code (automagic-intialization-html).
Could you please advice me how I can complete this.
If I understand correctly, you're looking for a way to specify facet parameter in Search Explorer in Azure Portal.
Simply add &facet=category,count:10 in the Query string field and that should do the trick. For example, see the screenshot below.
I finally found which parameter to update. In the AzSearch.bundle.js referenced in in the html page (see printscreen parameter to change), the default value is at line 44 on the checkboxfacet part. I just updated it with the right value, in my case I put count:30 and now I have more than 5 items in the checkboxes.
Result after change

Kentico Smart Search for application with multiple sites

I am having quite the difficulty. on our company site https://temp-quitlogixbase.quitlogix.org I had set up the Smart Search functionality. setting up indexes for each of the sites with in the application
(i.e.
https://colorado.quitlogix.org https://arkansas.quitlogix.orghttps://idaho.quitlogix.org
)
I even made sure to limit each site to the index meant for it. the problem is that the smart search results, either changes for each site, or if I include multipule indexes it gives me all the results for all the indexes, not just for the site I am working with. can some one help as to what I am doing wrong?
From your description, it sounds like you want each site's search to work independently so that - e.g. - Idaho results are not served on the Colorado search results.
To do this, you'll have (and sounds like you do) a SmartSearch index set up for each site with the allowed content in the index limited to the site in question.
What I would look at is the template your using for the search results. It looks very similar on the three sites you've listed, which makes me think that they are the same template. If that is the case and you're using a web part for the search results, you'll need a macro or some other logic to tell the page which index to look at.The template is effectively global, so each time you set the index on the Smart search results web part, it will override the previous value, even if you're switching between sites.
A way to do the switching can be to set the Indexes field to something like the following macro:
{% if (CurrentSite.CodeName == "QuitLogix_Arkansas") { "ArkansasSiteIndex" } else if(CurrentSite.CodeName == "QuitLogix_Colorado") { "ColoradoSiteIndex" } else {"IdahoSiteIndex"} #%}
If you've done all that or are using separate templates, you will not need that. Other options can include using multiple Smart search results web parts with their set the visibility based upon the current site or by having a different template for each sub-domain.

SharePoint online search not returning Home Pages

I cannot for the life of me work out how to return home pages within SharePoint Online search.
I have a single site collection with a number of sub sites that have a home page set as the default page, however when I create a query results source in SharePoint Online I cannot retrieve any of the homepages. They seem to be excluded?
Any ideas or thoughts to why they would be excluded?
Ideally, I just want to return all homepages for each sub-site within the site collection.
Many thanks.
You need to make sure that all your home pages are having same content type you are using in your filter. You might also use the name of content type in filter instead of id in your filter.
ContentType:"your content type name"
You also need to make sure all these pages are checked in and published to be picked up in search. If you are sure of all that, then try to reindex the whole site collection frim site settings and recheck after a while, normally it takes a couple of hours for crawl to finish and het your results. However, it sometimes take longer depending on search index load on cloud.

Sharepoint MOSS 2007 advanced search customization

In my sharepoint site, the master page template is chagned and we moved the search box into the site which showed as a web part, When the user enters a search string in that box, it should search whatever the materials available in the site itself, document library, blogs in the web, forums and wikis. Therefore, I think I need a way to figure out how these types of searches are done using sharepoint as well as how programmatically provide a search string to advanced search and receive search results. Any Idea how to do this? my code behinds are in C#
I don't think that should be any issue as sharepoint search is based upon the query string K parameter stands for Keyword, s parameter stands for scope, cs stands for contextual scope So use these parameters in query string to your results page having the core results webpart.
eg.
http:// <>/ <>/ results.aspx?k="Test Keyowrd"&s="All Sites"

Sharepoint content are not searchable...why?

I create a form form infopath. On that form I took the text boxes with corresponding fields, then I embed the form in SharePoint. Then in my document library, clicked "new", filled up data. Then I can see the data columns wise in my document library. Let's say I fill data as "Lalit" when I tried to search it, it gave me message:
"No results matching your search were found."
1.Check your spelling. Are the words in your query spelled correctly?
2.Try using synonyms. Maybe what you're looking for uses slightly different words.
3.Make your search more general. Try more general terms in place of specific ones.
4.Try your search in a different scope. Different scopes can have different results.
What should the problem ?
If you're using SharePoint Server you have to configure the search before you can use it. SharePoint then crawls the content of you site and builds an index for it, that will be used by the search.
You find the search configuration in the Central Administration under the Shared Service Provider for you web application.

Resources