Content Queries Using SharePoint Enterprise Search API
In an earlier post to SharePoint Blues Juho wrote about the challenge of – how to find anything from the sea of content. One way of solving this issue is to use SharePoint Enterprise Search API and the FullTextSqlQuery class. This class allows you to query SharePoint content using SQL syntax. FullTextSqlQuery queries always query from SCOPE(). In the where clause you set the target scope. Here is an example how the query is formed:
As you can see the syntax is SQL and this makes querying content pretty easy. At this point I want to point out that you can only query data that has been indexed by SharePoint so you need to crawl content before you can get any results. This is also a thing that might make using FullTextSqlQuery class impossible – the content isn’t realtime because it needs to be indexed first.
For the following example I created two SharePoint pages. One with a title ‘Example’ and second with a title ‘Example of FullTextSqlQuery’. Below is the example code in which I query content from All Sites scope and where Title field must contain the word ‘Example’:
{
QueryText = "SELECT Title FROM SCOPE() WHERE \"scope\" = 'All Sites'
AND CONTAINS(Title, 'Example')",
ResultTypes = ResultType.RelevantResults
};
var queryResults = query.Execute();
var queryResultsTable = queryResults[ResultType.RelevantResults];
var results = new DataTable();
results.Load(queryResultsTable, LoadOption.OverwriteChanges);
After running the code the results DataTable contains both of the pages I had created earlier. In the query I used predicate CONTAINS and with that I was able to look for word ‘Example’ in the Title field. FullTextSqlQuery uses managed properties in its queries and in the example query Title is an managed property. You can also easily create custom managed properties from your Shared Services Provider under Search Settings.
I think using FullTextSqlQuery is one way to find essential information from the sea of content.
Couple more things to add:
- Remember to use following using statement to make FullTextSqlQuery work:
- I found out that boolean fields in where clause behave bit strangely. I couldn’t get =true working, but I found a workaround for this. You can use !=false instead of =true
Popularity: 100% [?]
Everything published made a great deal of sense.
But, think about this, what if you typed a catchier title?
I ain’t suggesting your information isn’t solid, however suppose you added a title that makes people want more?
I mean Content Queries Using SharePoint Enterprise Search API | SharePoint Blues is kinda vanilla.
You might peek at Yahoo’s home page and note how they create
post headlines to get viewers to open the links. You might add a related video or a related
picture or two to grab people excited about what you’ve got to say.
In my opinion, it could bring your website a little livelier.
Hello there I am so glad I found your site,
I really found you by accident, while I was searching on Bing for something else,
Regardless I am here now and would just like to say thank
you for a marvelous post and a all round
thrilling blog (I also love the theme/design), I don’t have time
to read it all at the moment but I have bookmarked it and also included your
RSS feeds, so when I have time I will be back to read a
lot more, Please do keep up the awesome b.
Very good article. I definitely appreciate this website.
Continue the good work!
I think this is among the so much important information for
me. And i’m glad studying your article. But should statement
on some common issues, The web site style is wonderful, the articles is really great :
D. Excellent activity, cheers
steemfilterUsing SharePoint Enterprise Search API | SharePoint Blues is kinda vanilla.
You might peek at Yahoo’s home page
With our handy online scheduling and truthful pricing, we’re right here to assist.
By shopping on-line, you get rid of all of this frustration
this is among the so much important information for
me. And i’m glad studying your article. But should statement
on some common issues
It make take several minutes for the service to move from the starting stated to started state. The system service starts two Windows services with the farm account: first the ForeFront Identity Manager Synchronization Service and then the ForeFront Identity Manager service. While these are launched,
я немедленно запишу ваш rss
адрес, поскольку я бессилен отыскать ваш
e-mail link или e-newsletter. Можно ли попросить ваши контакты?
Будьте добры, разрешите мне переговорить с вами для того, чтобы я мог
бы подписаться.
But should statement
on some common issues, The web site style is wonderful
I was able to look for word ‘Example’ in the Title field. FullTextSqlQuery uses managed properties in its queries and in the example query Title is an managed property. You can also easily create cus
SharePoint site structure hierarchy is document or item. Document and item permissions can also be granted just like you did with structures above that
сейчас же кину в закладки ваш rss, поскольку я бессилен найти ваш e-mail hyperlink или newsletter.
Можно ли попросить ваши контакты?
Пожалуйста, разрешите мне общаться с вами для того, чтобы я
мог бы подписаться. Б
Peculiar article, totally what I wanted to find.
Sex in Berlin Learnalanguage
Reife Ladys Learnalanguage
Annoncelight har et rent og elegant design, så du nemt kan gennemse alle escortpersonernes profiler. Du kan også bruge filtre til avancerede søgninger.
Klubb6 är en mycket lättillgänglig dejtingsajt där det inte alltid behöver vara seriöst att dejta. Även om den här dejtingsajten i första hand är till för att hitta ett förhållande är det också rätt ställe för andra typer av roliga och spännande kontakter.
Themenladies bietet Ihnen die Möglichkeit, schnell mit Menschen in Kontakt zu kommen, die auf der Suche nach Sex sind. Wenn Sie auf der Suche nach einer ernsthaften Beziehung sind, ist diese Website wahrscheinlich nichts für Sie, aber wenn Sie schnell einen aufregenden Kontakt finden wollen, ist dies eine ausgezeichnete Wahl.
Sex Dresden ist eine Casual-Dating-Seite, auf der Sie MILFs treffen können – Frauen mittleren Alters, die wirklich heiß aussehen. Wenn Sie jedoch auf der Suche nach einer Ehe sind, ist es eine schlechte Idee, diese Seite zu wählen – sie wurde ursprünglich für Leute geschaffen, die nichts anderes wollen als ein Treffen.
Thank you for sharing this amazing post http://gregorysuqb349.iamarrows.com/10-undeniable-reasons-people-hate-how-can-you-increase-your-acquisition
Gilfs ist der seriöseste und heißeste Ort, um Oma-Sexkontakte mit Profilen zu finden, die 100% authentisch sind. Sicherheit und Diskretion sind wichtig für dich und werden von uns sehr respektiert. Mit einer hochmodernen Benutzeroberfläche wird es für Sie einfach sein, die sexy Oma Ihrer Träume zu suchen und zu finden, für die heißeste Begegnung, die Sie je erlebt haben!
Parenclub heeft singles, swingers en stellen uit alle lagen van de bevolking voor zich gewonnen, en wij denken dat de snelle inschrijving en de gratis functies je goed van pas zullen komen, ongeacht je relatiedoelen of seksuele fantasieën.
Pretparken Learnalanguage
Tree removal should always be done with responsibility and a long-term sustainability in mind. Try to inquire now for more details!
I never thought there were so many varieties of these things! https://www.clarksvilledrywall was also amazed. And now that I know about them, I’m going to have to try some of them.
Both of the pages I had previously constructed are included in the results DataTable after the code has been run. Using the predicate CONTAINS in the query allowed me to search for the word “Example” in the Title column. Check roofing whangarei
These content queries help us improve our website. Big thanks!