AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 04.06.2019, 14:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
crmtipoftheday: Tip #1270: Table or view is not full-text indexed
Источник: https://crmtipoftheday.com/1270/tabl...-text-indexed/
==============

Today’s tip is from Marius Agur Hagelund “Viking” Lind (actually, I’m confused, perhaps it’s Marius “Viking” Agur Hagelund Lind?). Got a tip of your own? Send it to jar@crmtipoftheday.com.
Cannot use CONTAINS or FREETEXT predicate on table or indexed view because it is not full-text indexed

Mean SQL Server
If you’veever got this error message it’s probably because you tried searching using theSDK using the contains keyword on a field which isn’t full-text indexed.

For me it was searching for systemusers:

nameSearch.Criteria.AddCondition("firstname", ConditionOperator.Contains, searchString);I got the following nice error message in return,which puzzled me at first

Cannot use a CONTAINS or FREETEXT predicate on tableor indexed view 'SystemUserBase' because it is not full-text indexed.I triedchecking in the system, and found that I could search for names there when Iused wildcard characters, and then it dawned on me that all these years ofautocomplete, intellisense and helpers have made my lazy and dumb. Usingwildcards is not the same as using CONTAINS, which is very obvious if you takea SQL Server 101 course found anywhere, so the solution was as easy as this:

nameSearch.Criteria.AddCondition("firstname", ConditionOperator.Like, $"%{searchString}%");But what about the web api? Well, turns out they removed the Microsoft.Dynamics.Crm.Contains action and only use the Contains keyword (api/data/v9.1/systemusers?$contains(firstname, ‘mike d’). That is, unless you want to perform a full-text search in knowledge base articles:

https://docs.microsoft.com/en-us/dyn...ics-ce-odata-9

So lesson learned: Stop being a dinosaur and start using the web api.

Viking out.




Источник: https://crmtipoftheday.com/1270/tabl...-text-indexed/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crmtipoftheday: Tip #1167: Impersonation does not grant extra powers Blog bot Dynamics CRM: Blogs 0 06.09.2018 09:11
crmtipoftheday: Tip #1063: Do not touch currency system views Blog bot Dynamics CRM: Blogs 0 29.01.2018 04:21
german_nav_developer: Catch Me If You Can – try-catch für .NET in C/AL Blog bot Dynamics CRM: Blogs 0 22.09.2014 11:00
A default full-text catalog does not exist in database 'MicrosoftDynamicsAX' or user does not have permission to perform this action. lvan DAX: Администрирование 7 18.10.2013 20:38
dynamicsaxbi: Better together: Microsoft Dynamics AX 2012 R2 and SQL Server Power View Blog bot DAX Blogs 0 12.12.2012 13:11
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 08:48.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.