full text index test job

static void vij_fulltextIndexJob(Args _args)
{
    //A full text index can improve the speed of queries that search for words that are embedded in string and memo fields on tables. [MS help]
    Query   query;
    QueryBuildDataSource  qbds;
    QueryBuildRange   qbr;
    CountryTable    ct;
    QueryRun        qr;
 
 
 
    query = new Query();
    qbds =query.addDataSource(tableNum(CountryTable));
    qbr = qbds.addRange(fieldNum(CountryTable,Country));
    qbr.rangeType(QueryRangeType::FullText);
    qbr.value('ind  usa  aus ');//space means OR  condition
    //in x++ select statements we cant use fulltextindex
    //we can only create fulltextindex for tablegroup main or group
    //we can create maximum one full text index for table
   
    qr= new QueryRun(query);
 
    while(qr.next())
    {
        ct = qr.get(tableNum(CountryTable));
 
        info(strFmt("%1 ",ct.Country));
    }
    

Comments

Popular posts from this blog

x++ code to add hyperlink to a field in D365FO

x++ code to get Vendor Email Address based on Purpose in Dynamics 365 for Operations

x++ code to get Customer Address based on purpose in ax 2012