The pre-query search suggestions feature (“find-as-you-type” functionality in the Search Center) automatically populates a list of keywords using previously searched terms by users. Obviously, this may take a while to compile, so it is a good idea to pre-populate a list of keywords from a CSV file (providing you know what the keywords are of course). This PowerShell script does exactly that. The format of the CSV file must have the word “Suggestion” on the top line and then your keyword list – for example:
Suggestion
SharePoint
SharePoint Server 2010
Sharing Files
SharePoint Designer
SharePoint Foundation
The script itself looks like this:
#Set up default variables
$csvfile="C:\Install\SearchSuggestions.csv"
$ssa = Get-SPEnterpriseSearchServiceapplication -Identity "Search Service Application"#Create Lists from each item in CSV file
$csvData = Import-Csv $csvfile
foreach ($line in $csvData)
{
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $ssa -Language en-US -Type QuerySuggestionAlwaysSuggest -Name $line.Suggestion
}$timerJob = Get-SPTimerJob "Prepare query suggestions"
$timerJob.RunNow()
Note that the we also run the “Prepare query suggestions” Timer job – which normally runs daily – to prepare these suggestions for use in search.
Great job :-)
ReplyDeleteBenjamin
Wonderful, A big Thanks
ReplyDeleteThis code is not working, use below code
ReplyDeleteget-content "C:\Install\SearchSuggestions.csv" | foreach-object { New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication "Fast Query" -Language en-US -Type QuerySuggestionAlwaysSuggest -Name $_ }
Srikanth - Thanks for the info, but my original published script has worked for me a number of times on different implementations and it seems like it also worked for the other guys who commented above!
ReplyDelete# If you have already populated a TermStore with the terms you want to add to the query suggestions use this code
ReplyDelete#function for a TermSet having one level of Terms
function SetTermToSuggestion($TermStoreName,$TermGroupName,$TermSetName,$theTermStores,$searchapplication)
{
foreach($TermStore in $theTermStores)
{
if ($TermStore.Name -eq $TermStoreName)
{
$TermStoreGroups = $TermStore.Groups
foreach($TermStoreGroup in $TermStoreGroups)
{
#the operator -eq is case insensitive
if ($TermStoreGroup.Name -eq $TermGroupName)
{
$TermSets = $TermStoreGroup.TermSets
foreach($TermSet in $TermSets)
{
if ($TermSet.Name -eq $TermSetName)
{
$Terms = $TermSet.Terms
foreach ($Term in $Terms)
{
#this works when there is only one level of terms
#get the default label of the Term object
$TermNameToAdd = $Term.Name
#then run the command to add the term to the suggestion list
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapplication -Language en-us -Type QuerySuggestionAlwaysSuggest -Name $TermNameToAdd
}
}
}
}
}
}
}
}
#function for a TermSet having more than one level of Terms
function SetSubTermSuggestion($TermStoreName,$TermGroupName,$TermSetName,$theTermStores,$searchapplication)
{
foreach($TermStore in $theTermStores)
{
#the operator -eq is case insensitive
if ($TermStore.Name -eq $TermStoreName)
{
$TermStoreGroups = $TermStore.Groups
foreach($TermStoreGroup in $TermStoreGroups)
{
if ($TermStoreGroup.Name -eq $TermGroupName)
{
$TermSets = $TermStoreGroup.TermSets
foreach($TermSet in $TermSets)
{
if ($TermSet.Name -eq $TermSetName)
{
#first level of terms
$Terms = $TermSet.Terms
foreach ($Term in $Terms)
{
#second level of terms
$subTerms = $Term.Terms
foreach ($subTerm in $subTerms)
{
#third level of terms : the one to be added to the query suggestions
$subSubTerms = $subTerm.Terms
foreach ($subSubTerm in $subSubTerms)
{
#get the default label of the Term object
$TermNameToAdd = $subSubTerm.Name
#then run the command to add the term to the suggestion list
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapplication -Language en-us -Type QuerySuggestionAlwaysSuggest -Name $TermNameToAdd
}
}
}
}
}
}
}
}
}
}
#Main
# Set the root web site URL
$websiteurl = ""
#get all the TermStores
$TaxSession = Get-SPTaxonomySession -Site $websiteurl
$TermStores = $TaxSession.TermStores
#get the search application
$searchapp = Get-SPEnterpriseSearchServiceApplication -Identity ""
#loop to add all the Terms of the TermSet taken from the TermStore to the query suggestion
SetTermSuggestion "" "" "" $TermStores $searchapp
# or if you're trying to add sub terms from a sub level of a TermSet (here the sample code get the third level only)
#loop to add all the subTerms of the TermSet taken from the TermStore to the query suggestion
SetSubTermSuggestion "" "" "" $TermStores $searchapp
#launch the default timer job to add the query suggestions
Start-SPTimerJob -Identity "prepare query suggestions"
# End of Main, enjoy !
obviously you will have to put values in between the ""for the root URL, the TermSet Name, the TermGroup Name and the TermStore Name
ReplyDeletean example :
$websiteurl = "http://myrootwebsite"
SetTermSuggestion "myTermStoreName" "myTermGroupName" "myTermSetName" $TermStores $searchapp
2015-12-7 xiaozhengm
ReplyDeletefitflops clearance
michael kors uk
tory burch outlet
oakley sunglasses
nike outlet
louis vuitton outlet
louis vuitton pas cher
kate spade outlet
gucci outlet
coach outlet
michael kors outlet
canada goose uk
coach factory outlet
christian louboutin shoes
nike blazer
jordan 8s
michael kors handbags
jordan 3 infrared
caoch outlet
true religion outlet
air jordan uk
michael kors
longchamp outlet
adidas shoes uk
coach factory outlet
coach factory outlet
nike blazers
ugg australia
nike uk
coach factory outlet
tiffany and co
basketball shoes
michael kors outlet uk
louboutin
air jordans
chaussure louboutin
air jordan 13
ugg outlet
louis vuitton outlet
Great Article..
ReplyDeleteOnline DotNet Training
.Net Online Training
Dot Net Training in Chennai
IT Training in Chennai
20160301meiqing
ReplyDeletecoach outlet store online
christian louboutin outlet
ugg boots
nike running shoes
oakley sunglasses
louis vuitton
louis vuitton handbags
hollister kids
ugg outlet
michael kors
beats headphones
michael kors outlet stores
louis vuitton handbags
coach outlet
louis vuitton outlet
canada goose
canada goose outlet
coach outlet online
coach outlet online
mont blanc pens
coach outlet store online
true religion outlet
michael kors bags
ugg boots
louis vuitton handbags
ray ban outlet
ray ban uk
burberry handbags
p90x workouts
cheap oakley sunglasses
louis vuitton outlet
michael kors outlet online
tods shoes
air max 90
kate spade
abercrombie and fitch
canada goose outlet
nike roshe run
kd shoes
jianbin0309
ReplyDeletetrue religion jeans outlet
celine outlet
louis vuitton handbags outlet
air jordan shoes for sale
asics,asics israel,asics shoes,asics running shoes,asics israel,asics gel,asics running,asics gel nimbus,asics gel kayano
tiffany outlet
swarovski crystal
michael kors outlet store
michael kors clearance
hermes bags
ray ban sunglasses
marc jacobs
valentino outlet
swarovski crystal
mac cosmetics
cheap nba jerseys
ray ban sunglasses
louis vuitton handbags outlet
ray-ban sunglasses
michael kors outlet store
michael kors outlet online
swarovski outlet
chicago blackhawks
true religion canada
michael kors outlet
ed hardy clothing
longchamp handbags outlet
prada outlet
ralph lauren shirts
michael kors factory store
cheap nfl jersey
rolex watches for sale
cheap nike shoes
mbt shoes outlet
police sunglasses
ReplyDeletehollister clothing store
mcm backpack
chrome hearts outlet online
louis vuitton outlet
michael kors handbags
air max 90
hermes belt
tory burch outlet online
longchamp outlet
nike roshe run
nike roshe
swarovski outlet
ferragamo shoes
mont blanc pens
coach outlet online
true religion outlet
oakley sunglasses
michael kors outlet online
nike blazer pas cher
cartier outlet
prada outlet
lululemon outlet online
true religion jeans
michael kors handbags
michael kors factory outlet
ralph lauren uk
michael kors outlet
herve leger outlet
juicy couture tracksuit
cai20160519
20160530meiqing
ReplyDeleteair jordans
true religion jeans
nike free flyknit 4.0
red bottom shoes
michael kors outlet clearance
yeezy boost 350
louis vuitton pas cher
jimmy choo shoes
converse shoes
louis vuitton factory outlet
michael kors outlet online
michael kors outlet
ralph lauren outlet
reebok shoes
polo ralph lauren outlet
cartier love bracelet
hollister sale
adidas gazelle
the north face
pandora outlet
michael kors handbags
instyler max
louis vuitton borse
coach outlet
coach outlet store online
discount oakley sunglasses
coach outlet store
ed hardy outlet
louis vuitton outlet online
adidas superstar
hollister clothing
ralph lauren outlet
michael kors outlet
michael kors outlet
chaussure louboutin
ReplyDeleteair max 90 white
louis vuitton outlet online
yeezy boost 350 white
cheap jordan shoes
louis vuitton purse
skechers outlet
fitflops shoes
adidas pure boost black
louis vuitton bags
fitflops
true religion jeans
burberry outlet stores
discount oakley sunglasses
michael kors outlet
cheap ray bans
coach outlet online
louis vuitton outlet
ferragamo outlet
ray ban outlet store
michael kors outlet online
moncler uk
dolce and gabbana outlet online
pandora charms uk
nike store uk
ralph lauren uk
yeezy boost
michael kors handbags
reebok shoes
ed hardy
michael kors canada
louboutin pas cher
pandora jewelry outlet
cheap basketball shoes
longchamp handbags
20160721caiyan
oakley sunglasses
ReplyDeletelebron james shoes
cheap ray ban sunglasses
gucci handbags
tory burch flats
tory burch sale
jordan 11
oakley vault
louis vuitton outlet
true religion outlet
louis vuitton outlet
michael kors outlet
michael kors outlet
celine handbags
louis vuitton outlet
nike roshe run
oakley vault
gucci handbags
toms shoes
adidas originals shoes
ray-ban sunglasses
coach outlet
michael kors outlet
coach factory outlet
gucci outlet
michael kors handbags
michael kors outlet
michael kors outlet online sale
michael kors handbags
coach factory outlet
jordan 8
louis vuitton
christian louboutin shoes
true religion
michael kors handbags
michael kors outlet
toms outlet
timberland boots
louis vuitton outlet stores
coach factory outlet
20168.8wengdongdong
ugg boots sale
ReplyDeleteugg boots
hollister outlet
fitflops shoes
coach factory online
cheap uggs
oakley outlet
ugg australia
oakley outlet
warriors jerseys
20169.27chenjinyan
cheap ugg boots
ReplyDeleteugg boots outlet
jordan femme pas cher
patriots jerseys
beats headphones
ugg australia
michael kors outlet online
cheap rolex watches
true religion jeans
ray ban wayfarer
2016.11.26xukaimin
Nice Post...
ReplyDeleteLinux Trainng in Chennai
hxy2.14
ReplyDeletetiffany jewellery
tiffany outlet
tiffany and co jewelry
tiffany and co
tiffany and co
tiffany jewellery
timberland boots
timberland shoes
tods outlet online
tods outlet
michael kors
ReplyDeleteralph lauren outlet
replica watches
borse louis vuitton
oklahoma city thunder jerseys
denver broncos jerseys
cheap oakley sunglasses
louis vuitton belt
gucci outlet
ralph lauren polo
20173.9chenjinyan
longchamp soldes
ReplyDeletechristian louboutin outlet
hollister clothing store
ralph lauren sale
adidas outlet online
coach outlet store online
discount oakley sunglasses
lakers jerseys
kate spade outlet online
coach factory outlet online
0324shizhong
hermes birkin bag
ReplyDeletereplica rolex
cheap ray ban sunglasses
adidas originals nmd
nike outlet store
polo outlet
michael kors outlet clearance
coach factory online
prada bags
levis jeans outlet
hzx20170415
cheap oakley sunglasses
ReplyDeletecoach outlet store online clearances
oakley sunglasses cheap
adidas trainers shoes
longchamp outlet
coach outlet store online clearances
fred perry polo shirts
oakley sunglasses outlet
nike store
michael kors handbags
2017.5.15chenlixiang
coach outlet store online
ReplyDeletemarc jacobs
coach factory outlet online
louboutin shoes
coach factory outlet
michael kors outlet clearance
oakley sunglasses outlet
coach factory outlet
coach outlet store
ralph lauren sale
171517yueqin
oakley sunglasses wholesale
ReplyDeletenike air max 1
michael kors outlet stores
michael kors outlet
adidas nmd runner
michael kors handbags
cheap oakley sunglasses
louis vuitton
coach outlet online
true religion jeans
chanyuan2017.06.08
I could hardly abandon your web site just before suggesting we particularly cherished the common info a person offer on your own visitors? Will be usually yet again routinely to analyze cross-check completely new posts
ReplyDeleteI like this post, enjoyed this one thanks for posting .
ReplyDeleteKeep up the fantastic work , I read few content on this web site and I believe that your website is rattling interesting and has got lots of fantastic information.
ReplyDeleteNice Posting...
ReplyDeleteRed Hat Training in Chennai
Best Linux Training Center in Chennai
Best Linux Training Institute in Chennai
Rhce Training in Chennai
RHCSA Training in Chennai
Next type the path and filename where you want the merged file to appear. Hit enter, and windows will create a combined file! Easy as that.excel reporting dashboard
ReplyDeleteGood Posting...
ReplyDeleteReal Estate Companies
Real Estate Brokers in Chennai
Real Estate Agents in Chennai
Real Estate Advisory in India
Real Estate Private Equity in Chennai
Real Estate Research in Chennai
Real Estate Tax Advisor in Chennai
Legal advisor in Chennai
Angularjs Training in Chennai
ReplyDeleteVmware Training in Chennai
Core Java Training in Chennai
Google Cloud training in Chennai
CCNA Training in Chennai
QNC Jelly Gamat is the latest breakthrough drugs to cure various diseases
ReplyDeletePengobatan Nyeri Sendi Lutut
Cara Mengobati Luka Jahitan Supaya Cepat Kering
Pengobatan Asam Urat Ampuh
Cara Mengatasi Masalah Lambung
Cara Ampuh Menghancurkan Batu Empedu
Pengobatan Untuk Menyembuhkan Penyakit Epilepsi
This information is very useful. thank you for sharing. and I will also share information about health through the website
ReplyDeleteCara Mengobati Sinusitis
Obat Sakit Mata Belekan Alami
Cara Mengatasi Diare
Obat Sakit Dada
Obat Sariawan Alami
Pengobatan Alami untuk Tipes
Cara Menghilangkan Stretch mark
ReplyDeleteI don't apperceive what it is about the bendable blow and matte finish, but I accept a anemic atom for printed suede Christisn Louboutin Outlet. One of the best brands to cull this off is YSL Wallet Outlet. I accept to acquaint you about a backpack attraction of mine. I am in fact mad at myself that I did not splurge on the Ralph Lauren Polo Outlet Croc Muse Two which has two colors that I admire with a sueced croc pattern. To see a formed suede accomplishment off a Red Bottoms Outlet that I already adore, my affection melts. Replica Watches are additionally pretty reflective of their user's persona. Amazing furthermore multi-colored Replica Watches are commonly worn because of the younger. Conversely, exquisite dress Swiss Rolex Replica are regularly sported by highly developed gentlemen. And then usually there's the luxurious Swiss Replica Watches worn by the individuals who're properly to complete. Check out observing your mates furthermore you can before long see how the layouts are actually ranging.
1、
ReplyDeletecheap jordan shoes
golden goose sneakers
golden goose
fitflops clearance
coach outlet
basketball shoes
cheap jordans
reebok outlet store
cheap basketball shoes
cheap air jordans
his article is very helpful at all thanks
ReplyDeleteObat Penyakit Asam Urat
Obat Mata Juling
Obat Kanker Rahim
Cara Mengobati Sakit Pinggang
Cara Mengobati Benjolan Di Vagina
Pengobatan Alami Penyakit vertigo
thank you very helpful article. allow me to join to share health articles with your article hopefully useful.
ReplyDeletePengobatan Penyakit Polip
Pengobatan Epilepsi Dengan Bahan Alami
Cara Mengobati Rematik
Cara Mengobati Penyakit Trigliserida Tinggi
Cara Mengobati Paru-Paru Basah
Obat Penyakit Jantung Bengkak
thank you very useful information admin, and pardon me permission to share articles here may help :
ReplyDeleteCara mengatasi bayi kuning
Obat kerumut anak ampuh
Cara menyembuhkan mata lelah
Cara mengobati kuku kekeongeun
Obat kencing campur darah ampuh
También puede visitar una tienda de ladrillo y mortero de Michael Kors o su sitio web y comprar directamente un bolso Michael Kors desde allí. Usar un bolso de Michael Kors les permite a los demás reconocer que el habitante urbano educado toma la moda realmente con seriedad. Los bolsos de hombro son particularmente refinados y elegantes.
ReplyDelete{Bolsas Michael Kors Precios | Bolsos Michael Kors Outlet | Michael Kors Rebajas}
En vacker konstnärlig skapelse av vävt läder, som ger ett skalskaligt utseende - liknar en snakeskin eller fiskhud, linjer utsidan av påsen. Läderens bältros är små läderringar. Det finns också gyllene accenter på väskan. Slutresultatet är svagt liknar kedjepost.
{Michael Kors Rea | Michael Kors Väska Rea | Michael Kors Plånbok}
cheap nfl jerseys
ReplyDeletecheap jerseys
cheap jerseys from china
wholesale jerseys
cheap nfl jerseys from china
china jerseys
nfl jerseys china
wholesale nfl jerseys
cheap authentic nfl jerseys
cheap jerseys online
cheap authentic jerseys
cheap sports jerseys
cheap wholesale jerseys
china wholesale jerseys
discount nfl jerseys
cheap authentic jerseys from china
discount jerseys
custom cowboys jersey
nfl jerseys cheap
cheap nfl jerseys china
authentic nfl jerseys
This article is interesting and useful. Thank you for sharing. And let me share an article about health that God willing will be very useful. Thank you :)
ReplyDeleteObat Penghilang Nyeri Pada Payudara
Obat Luka Bernanah bekas Caesar
Perawatan kesehatan mata
Thank you for joining us. his article is very helpful
ReplyDelete4 Tanaman Herbal Untuk Hernia
Cara Mengobati Penyakit Lupus
Pengobatan Untuk Rorombeheun
Penyubur Kandungan Paling Ampuh
Obat Batuk Rejan
Very Nice Blog Updation Keep Updating !!
ReplyDeletePengobatan Kelenjar Tiroid
Pengobatan Penyakit Sinusitis
Pengobatan Varises dengan Bahan Alami
Obat Radang Dinding Rahim
Obat Penyakit Miom dan Kista
Cara Mengobati Penyakit Kencing Nanah
Thank you, the article is very petrifying, hopefully it can be useful for everyone.
ReplyDeleteObat Tukak Lambung Paling Ampuh
Obat Penghancur Batu Ginjal
Obat Herbal Untuk Tulang Keropos
Obat Kelenjar Air Liur Yang Membengkak
Obat Mata Trakoma
Obat Polip Usus Besar
The article is very interesting. And I also want to share articles about health, I'm sure this will be useful. Read and share it. Thank you very much :)
ReplyDeletePenyebab Telat Haid dan Solusinya
Cara Menghilangkan Benjolan di Kelopak Mata
kiri serta kanan anda. Jika ada yang memperoleh 2 kartu balak, maka bisa anda beli jackpot serta beralihlah ke tempat yang kosong.
ReplyDeleteasikqq
dewaqq
sumoqq
interqq
pionpoker
bandar ceme terbaik
hobiqq
paito warna
forum prediksi
A beautiful purse or handbag from Coach Outlet Online can last for many years, and represent a great overall value.
ReplyDeleteThere are Michael Kors Bags Outlet in a large number of shopping malls located throughout the country.
Cheap Michael Kors Bags is a great way to determine which models best suit your needs.
Official Coach Factory Outlet Online all strive to provide comfort and convenience for their owners and the seams are double-stitched for maximum durability.
Michael Kors Factory Store, has one of the most popular handbag and accessory lines on the market today.
Coach Handbags Wholesale says a lady is classy, elegant and sophisticated.
Coach Store Near Me trends come and go, but a Coach stands the test of time.
The official Michael Kors Handbags On Sale Outlet regularly posts various handbags being offered for sale.
Compare your Coach Bags On Sale Outlet to the logo provided on the website to make sure it is similar.
All Michael Kors Outlet Online Store have serial numbers.
No matter what type of Michael Kors Bags Outlet each individual got, they all had one thing in common. We all know that getting something on sale is like winning a mini lottery, but to find a name brand handbag like Michael Kors Black Friday Sale for instance, discounted is like a slice of heaven on earth. I have personally attacked my husband with hugs and kisses when finding Official Coach Outlet Online at discounted prices.
ReplyDeleteMichael Kors Factory Outlet stores can be found in malls all over. MK Outlet and other Coach merchandise can also be found in some boutiques. Inspired by the same material baseball gloves are made from, these Coach Bags On Sale Online are versatile and stylish. Since it's conception, the Michael Kors Handbags Outlet has been produced into a variety of designs, colors, shapes, and styles that have won top pick of millions of women the world over.
New Michael Kors Bags are the most sought after handbag. Since Coach Outlet Online is one of the most recognized name brands in the world of fashion, you will find A-list celebrities down to small girls wearing them.
tags:Coach Outlet|Coach Bags Factory Outlet|Coach Purses Outlet